This Jupyter notebook automates the process of creating, configuring, and connecting to a RunPod instance. It handles everything from pod creation to environment setup and file transfer.
- RunPod API key stored in an
.env
file on your Desktop - Python environment with the following packages:
- runpod
- python-dotenv
- pyperclip (v1.9.0)
- SSH key pair (using ed25519) configured in
~/.ssh/
- A
runpod_files
directory on your Desktop containing files to be transferred - A
requirements.txt
file in therunpod_files
directory
- Loads environment variables from
.env
file - Configures RunPod API key
- Sets up file paths for data transfer
- Creates a pod with the following specifications:
- PyTorch 2.1.0 image with CUDA 11.8.0
- NVIDIA RTX A4500 GPU
- 30GB container disk
- 130GB volume
- Exposed ports: 8888 (HTTP) and 22 (TCP)
- Jupyter notebook enabled
- Location: France (EU)
- Automatically handles SSH connection setup
- Accepts host key for first-time connection
- Configures secure remote access
- Copies files from local
runpod_files
directory to pod's/workspace
directory - Supports copying files back from pod to local machine (commented section available)
- Creates a Python virtual environment on the pod
- Installs and configures Jupyter kernel
- Installs dependencies from requirements.txt
- Installs additional packages (e.g., flash-attn)
- Retrieves and formats Jupyter notebook URL
- Automatically copies URL to clipboard for easy access
- Includes functions to list all pods
- Contains commented code for pod termination
- Ensure all prerequisites are met
- Run the notebook cells sequentially
- Wait for the pod to initialize (~90 seconds)
- Environment setup takes approximately 3 minutes
- Access Jupyter notebook using the automatically generated URL
- The pod will continue running (and charging) until explicitly terminated
- Use the termination cell (currently commented out) to stop the pod when finished
- All files are mounted at
/workspace
in the pod - The notebook uses SSH key-based authentication for security
Required in the .env
file:
- Uses SSH key-based authentication
- Supports EU-based deployment
- Community cloud type selected for cost-effectiveness
- Public IP enabled for accessibility
If file transfer fails:
- Check SSH key permissions
- Verify file paths
- Ensure requirements.txt is present
- Check pod status using
runpod.get_pods()
To prevent unnecessary charges:
- Save any important files from the pod
- Uncomment and run the termination cell
- Verify pod termination using
runpod.get_pods()