Skip to content

Commit 89c1a65

Browse files
Merge pull request #288 from runpod/main
update branch
2 parents b1827f5 + 1127ffb commit 89c1a65

9 files changed

Lines changed: 35 additions & 16 deletions

File tree

.github/workflows/CD-publish_to_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
shell: bash
8181

8282
- name: Repository Dispatch
83-
uses: peter-evans/repository-dispatch@v2
83+
uses: peter-evans/repository-dispatch@v3
8484
with:
8585
token: ${{ secrets.RUNPOD_WORKERS_PAT }}
8686
repository: ${{ matrix.repo }}

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Change Log
22

3-
## Release 1.5.3 (TBD)
3+
## Release 1.5.3 (1/25/24)
44

55
### Added
66

7+
- Expose cuda selection when creating a pod.
8+
- Expose `flashboot` when creating a new endpoint.
79
- Expose bucket name for rp_upload.
810
- Exposed `containerRegistryAuthId` for template creation.
911

examples/api/create_endpoint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
new_template = runpod.create_template(
1111
name="test",
12-
image_name="runpod/base:0.1.0",
12+
image_name="runpod/base:0.4.4",
1313
is_serverless=True
1414
)
1515

@@ -20,7 +20,8 @@
2020
template_id=new_template["id"],
2121
gpu_ids="AMPERE_16",
2222
workers_min=0,
23-
workers_max=1
23+
workers_max=1,
24+
flashboot=True
2425
)
2526

2627
print(new_endpoint)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aiohttp[speedups] == 3.9.1
1+
aiohttp[speedups] == 3.9.2
22
aiohttp-retry >= 2.8.3
33

44
backoff >= 2.2.1

runpod/api/ctl_commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def create_pod(
9393
min_vcpu_count: int = 1, min_memory_in_gb: int = 1, docker_args: str = "",
9494
ports: Optional[str] = None, volume_mount_path: str = "/runpod-volume",
9595
env: Optional[dict] = None, template_id: Optional[str] = None,
96-
network_volume_id: Optional[str] = None
96+
network_volume_id: Optional[str] = None, allowed_cuda_versions: Optional[list] = None
9797
) -> dict:
9898
'''
9999
Create a pod
@@ -138,7 +138,7 @@ def create_pod(
138138
cloud_type, support_public_ip, start_ssh,
139139
data_center_id, country_code, gpu_count,
140140
volume_in_gb, container_disk_in_gb, min_vcpu_count, min_memory_in_gb, docker_args,
141-
ports, volume_mount_path, env, template_id, network_volume_id)
141+
ports, volume_mount_path, env, template_id, network_volume_id, allowed_cuda_versions)
142142
)
143143

144144
cleaned_response = raw_response["data"]["podFindAndDeployOnDemand"]
@@ -249,7 +249,7 @@ def create_endpoint(
249249
name: str, template_id: str, gpu_ids: str = "AMPERE_16",
250250
network_volume_id: str = None, locations: str = None,
251251
idle_timeout: int = 5, scaler_type: str = "QUEUE_DELAY", scaler_value: int = 4,
252-
workers_min: int = 0, workers_max: int = 3
252+
workers_min: int = 0, workers_max: int = 3, flashboot=False
253253
):
254254
'''
255255
Create an endpoint
@@ -274,7 +274,7 @@ def create_endpoint(
274274
name, template_id, gpu_ids,
275275
network_volume_id, locations,
276276
idle_timeout, scaler_type, scaler_value,
277-
workers_min, workers_max
277+
workers_min, workers_max, flashboot
278278
)
279279
)
280280

runpod/api/mutations/endpoints.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ def generate_endpoint_mutation(
77
name: str, template_id: str, gpu_ids: str = "AMPERE_16",
88
network_volume_id: str = None, locations: str = None,
99
idle_timeout: int = 5, scaler_type: str = "QUEUE_DELAY", scaler_value: int = 4,
10-
workers_min: int = 0, workers_max: int = 3
10+
workers_min: int = 0, workers_max: int = 3, flashboot=False
1111
):
1212
""" Generate a string for a GraphQL mutation to create a new endpoint. """
1313
input_fields = []
1414

1515
# ------------------------------ Required Fields ----------------------------- #
16+
if flashboot:
17+
name = name + "-fb"
18+
1619
input_fields.append(f'name: "{name}"')
1720
input_fields.append(f'templateId: "{template_id}"')
1821
input_fields.append(f'gpuIds: "{gpu_ids}"')

runpod/api/mutations/pods.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
"""
44
# pylint: disable=too-many-arguments, too-many-locals, too-many-branches
55

6+
from typing import Optional, List
7+
68

79
def generate_pod_deployment_mutation(
8-
name:str, image_name:str, gpu_type_id:str,
9-
cloud_type:str="ALL", support_public_ip:bool=True, start_ssh:bool=True,
10+
name: str, image_name: str, gpu_type_id: str,
11+
cloud_type: str = "ALL", support_public_ip: bool = True, start_ssh: bool = True,
1012
data_center_id=None, country_code=None,
1113
gpu_count=None, volume_in_gb=None, container_disk_in_gb=None, min_vcpu_count=None,
1214
min_memory_in_gb=None, docker_args=None, ports=None, volume_mount_path=None,
13-
env:dict=None, template_id=None, network_volume_id=None):
15+
env: dict = None, template_id=None, network_volume_id=None,
16+
allowed_cuda_versions: Optional[List[str]] = None):
1417
'''
1518
Generates a mutation to deploy a pod on demand.
1619
'''
@@ -64,6 +67,11 @@ def generate_pod_deployment_mutation(
6467
if network_volume_id is not None:
6568
input_fields.append(f'networkVolumeId: "{network_volume_id}"')
6669

70+
if allowed_cuda_versions is not None:
71+
allowed_cuda_versions_string = ", ".join(
72+
[f'"{version}"' for version in allowed_cuda_versions])
73+
input_fields.append(f'allowedCudaVersions: [{allowed_cuda_versions_string}]')
74+
6775
# Format input fields
6876
input_string = ", ".join(input_fields)
6977

tests/test_api/test_mutation_endpoints.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from runpod.api.mutations.endpoints import generate_endpoint_mutation
66

7+
78
class TestGenerateEndpointMutation(unittest.TestCase):
89
"""Tests for the endpoint mutation generation."""
910

@@ -20,9 +21,9 @@ def test_all_fields(self):
2021
"""Test all the fields."""
2122
result = generate_endpoint_mutation(
2223
"test_name", "test_template_id", "AMPERE_20",
23-
"test_volume_id", "US_WEST", 10, "WORKER_COUNT", 5, 2, 4
24+
"test_volume_id", "US_WEST", 10, "WORKER_COUNT", 5, 2, 4, True
2425
)
25-
self.assertIn('name: "test_name"', result)
26+
self.assertIn('name: "test_name-fb"', result)
2627
self.assertIn('templateId: "test_template_id"', result)
2728
self.assertIn('gpuIds: "AMPERE_20"', result)
2829
self.assertIn('networkVolumeId: "test_volume_id"', result)

tests/test_api/test_mutations_pods.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from runpod.api.mutations import pods
66

7+
78
class TestPodMutations(unittest.TestCase):
89
''' Test API Wrapper Pod Mutations '''
910

@@ -28,7 +29,9 @@ def test_generate_pod_deployment_mutation(self):
2829
volume_mount_path="/path",
2930
env={"ENV": "test"},
3031
support_public_ip=True,
31-
template_id="abcde")
32+
template_id="abcde",
33+
allowed_cuda_versions=["11.8", "12.0"]
34+
)
3235

3336
# Here you should check the correct structure of the result
3437
self.assertIn("mutation", result)
@@ -57,5 +60,6 @@ def test_generate_pod_terminate_mutation(self):
5760
# Here you should check the correct structure of the result
5861
self.assertIn("mutation", result)
5962

63+
6064
if __name__ == "__main__":
6165
unittest.main()

0 commit comments

Comments
 (0)