Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spot in runpod #1119

Merged
merged 5 commits into from
May 6, 2024
Merged

Conversation

Bihan
Copy link
Collaborator

@Bihan Bihan commented Apr 11, 2024

No description provided.

@Bihan
Copy link
Collaborator Author

Bihan commented Apr 16, 2024

@peterschmidt85 @TheBits I will update this PR to include resolved issues. #1133

@TheBits
Copy link
Contributor

TheBits commented May 2, 2024

Hi @Bihan!

Functions generate_pod_deployment_mutation and generate_pod_rent_interruptable_mutation are almost the same. Please combine them into one.

@@ -1,4 +1,5 @@
-def generate_pod_deployment_mutation(
+def generate_pod_rent_interruptable_mutation(
+    bid_per_gpu: float,
     name: str,
     image_name: str,
     gpu_type_id: str,
@@ -21,11 +22,12 @@
     allowed_cuda_versions: Optional[List[str]] = None,
 ) -> str:
     """
-    Generates a mutation to deploy a pod on demand.
+    Generates a mutation to deploy a pod spot.
     """
     input_fields = []
 
     # ------------------------------ Required Fields ----------------------------- #
+    input_fields.append(f"bidPerGpu: {bid_per_gpu}")
     input_fields.append(f'name: "{name}"')
     input_fields.append(f'imageName: "{image_name}"')
     input_fields.append(f'gpuTypeId: "{gpu_type_id}"')
@@ -82,19 +84,16 @@
 
     # Format input fields
     input_string = ", ".join(input_fields)
-
     return f"""
         mutation {{
-          podFindAndDeployOnDemand(
+          podRentInterruptable(
             input: {{
               {input_string}
             }}
           ) {{
             id
-            desiredStatus
+            lastStatusChange
             imageName
-            env
-            machineId
             machine {{
               podHostId
             }}

@Bihan
Copy link
Collaborator Author

Bihan commented May 3, 2024

Hi @Bihan!

Functions generate_pod_deployment_mutation and generate_pod_rent_interruptable_mutation are almost the same. Please combine them into one.

@@ -1,4 +1,5 @@
-def generate_pod_deployment_mutation(
+def generate_pod_rent_interruptable_mutation(
+    bid_per_gpu: float,
     name: str,
     image_name: str,
     gpu_type_id: str,
@@ -21,11 +22,12 @@
     allowed_cuda_versions: Optional[List[str]] = None,
 ) -> str:
     """
-    Generates a mutation to deploy a pod on demand.
+    Generates a mutation to deploy a pod spot.
     """
     input_fields = []
 
     # ------------------------------ Required Fields ----------------------------- #
+    input_fields.append(f"bidPerGpu: {bid_per_gpu}")
     input_fields.append(f'name: "{name}"')
     input_fields.append(f'imageName: "{image_name}"')
     input_fields.append(f'gpuTypeId: "{gpu_type_id}"')
@@ -82,19 +84,16 @@
 
     # Format input fields
     input_string = ", ".join(input_fields)
-
     return f"""
         mutation {{
-          podFindAndDeployOnDemand(
+          podRentInterruptable(
             input: {{
               {input_string}
             }}
           ) {{
             id
-            desiredStatus
+            lastStatusChange
             imageName
-            env
-            machineId
             machine {{
               podHostId
             }}

@TheBits I have pushed the changes. Thank you for the review.

@TheBits TheBits merged commit a9bfad1 into dstackai:master May 6, 2024
11 of 15 checks passed
@TheBits
Copy link
Contributor

TheBits commented May 6, 2024

@Bihan Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants