Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dstack/_internal/core/backends/runpod/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def create_pod(
name: str,
image_name: str,
gpu_type_id: str,
cloud_type: str = "ALL",
cloud_type: str,
support_public_ip: bool = True,
start_ssh: bool = True,
data_center_id: Optional[str] = None,
Expand Down Expand Up @@ -323,7 +323,7 @@ def generate_pod_deployment_mutation(
name: str,
image_name: str,
gpu_type_id: str,
cloud_type: str = "ALL",
cloud_type: str,
support_public_ip: bool = True,
start_ssh: bool = True,
data_center_id=None,
Expand Down
11 changes: 8 additions & 3 deletions src/dstack/_internal/core/backends/runpod/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,25 @@ def run_job(
container_registry_auth_id = self._generate_container_registry_auth_id(
job.job_spec.registry_auth
)
gpu_count = len(instance_offer.instance.resources.gpus)
bid_per_gpu = None
if instance_offer.instance.resources.spot and gpu_count:
bid_per_gpu = instance_offer.price / gpu_count

resp = self.api_client.create_pod(
name=instance_config.instance_name,
image_name=job.job_spec.image_name,
gpu_type_id=instance_offer.instance.name,
cloud_type="ALL", # ["ALL", "COMMUNITY", "SECURE"]:
cloud_type="SECURE", # ["ALL", "COMMUNITY", "SECURE"]:
data_center_id=instance_offer.region,
gpu_count=len(instance_offer.instance.resources.gpus),
gpu_count=gpu_count,
container_disk_in_gb=disk_size,
min_vcpu_count=instance_offer.instance.resources.cpus,
min_memory_in_gb=memory_size,
support_public_ip=True,
docker_args=_get_docker_args(authorized_keys),
ports="10022/tcp",
bid_per_gpu=instance_offer.price if instance_offer.instance.resources.spot else None,
bid_per_gpu=bid_per_gpu,
network_volume_id=network_volume_id,
volume_mount_path=volume_mount_path,
)
Expand Down