This repository was archived by the owner on Jun 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change
1
+ import runpod
2
+ import re
3
+ import os
4
+
5
+ API_KEY = os .getenv ("RUNPOD_API_KEY" )
6
+ runpod .api_key = API_KEY
7
+
8
+ # Replace with the actual template ID
9
+ TEMPLATE_ID = "oqfjo3fqxu"
10
+
11
+ # Fetch running instances
12
+ running_pods = runpod .get_pods ()
13
+ manav_nums = []
14
+
15
+ # Extract existing numbers from instance names
16
+ for pod in running_pods :
17
+ match = re .match (r"manav-(\d+)" , pod ["name" ])
18
+ if match :
19
+ manav_nums .append (int (match .group (1 )))
20
+
21
+ # Determine the next available number
22
+ num = max (manav_nums ) + 1 if manav_nums else 1
23
+ print (f"Starting instance with number: { num } " )
24
+
25
+ pod_config = {
26
+ "name" : f"manav-{ num } " ,
27
+ "image_name" : "manav" ,
28
+ "template_id" : TEMPLATE_ID ,
29
+ "gpu_type_id" : "NVIDIA A40" ,
30
+ "cloud_type" : "SECURE" ,
31
+ # "region": "CA-MTL-1",
32
+ "network_volume_id" : "fbrfv5xpc9" , # Attach external disk
33
+ "env" : {}, # Add any required environment variables here
34
+ "docker_args" : "" , # Any specific Docker arguments
35
+ }
36
+
37
+ pod = runpod .create_pod (** pod_config )
38
+ print (pod )
Original file line number Diff line number Diff line change 1
1
# Base image
2
- FROM pytorch/pytorch:2.5.1 -cuda12.4 -cudnn9-devel
2
+ FROM pytorch/pytorch:2.6.0 -cuda12.6 -cudnn9-devel
3
3
4
4
# Update keys and repositories
5
5
RUN apt-get update
Original file line number Diff line number Diff line change 1
1
beartype
2
+ black
2
3
classifier-free-guidance-pytorch
3
4
einops
4
5
einx [torch ]
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ start_jupyter() {
85
85
# Main Program #
86
86
# ---------------------------------------------------------------------------- #
87
87
88
- start_nginx
88
+ # start_nginx
89
89
90
90
execute_script " /pre_start.sh" " Running pre-start script..."
91
91
@@ -95,9 +95,6 @@ setup_ssh
95
95
start_jupyter
96
96
export_env_vars
97
97
98
- mkdir /tmp/ramdisk
99
- mount -t tmpfs -o size=4G tmpfs /tmp/ramdisk
100
-
101
98
execute_script " /post_start.sh" " Running post-start script..."
102
99
103
100
echo " Start script(s) finished, pod is ready to use."
You can’t perform that action at this time.
0 commit comments