Skip to content

Commit

Permalink
Support for referrencing image name on gcp backend
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Jul 22, 2024
1 parent 5ff35da commit 9da7326
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runner_manager/backend/gcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def wait_for_operation(

@property
def image(self) -> Image:
if self.instance_config.image is not None:
return self.image_client.get(
project=self.instance_config.image_project,
image=self.instance_config.image,
)
return self.image_client.get_from_family(
project=self.instance_config.image_project,
family=self.instance_config.image_family,
Expand Down
1 change: 1 addition & 0 deletions runner_manager/models/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class GCPConfig(BackendConfig):
class GCPInstanceConfig(InstanceConfig):
image_family: str = "ubuntu-2004-lts"
image_project: str = "ubuntu-os-cloud"
image: Optional[str] = None
machine_type: str = "e2-small"
subnetwork: str = "default"
enable_nested_virtualization: bool = True
Expand Down

0 comments on commit 9da7326

Please sign in to comment.