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 support for custom containers for workbench instances #9973

Merged
merged 3 commits into from
Feb 20, 2024
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
28 changes: 28 additions & 0 deletions mmv1/products/workbench/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ examples:
region_override: 'us-west1-a'
vars:
instance_name: 'workbench-instance'
- !ruby/object:Provider::Terraform::Examples
name: 'workbench_instance_basic_container'
primary_resource_id: 'instance'
primary_resource_name: "fmt.Sprintf(\"tf-test-workbench-instance%s\",
context[\"\
random_suffix\"])"
region_override: 'us-west1-a'
vars:
instance_name: 'workbench-instance'
- !ruby/object:Provider::Terraform::Examples
name: 'workbench_instance_basic_gpu'
primary_resource_id: 'instance'
Expand Down Expand Up @@ -176,6 +185,8 @@ properties:
name: vmImage
custom_flatten: templates/terraform/custom_flatten/workbench_instance_vm_image_flatten.go.erb
default_from_api: true
conflicts:
- gce_setup.0.container_image
immutable: true
description: |
Definition of a custom Compute Engine virtual machine image for starting
Expand Down Expand Up @@ -203,6 +214,23 @@ properties:
exactly_one_of:
- vm_image.0.name
- vm_image.0.family
- !ruby/object:Api::Type::NestedObject
name: containerImage
conflicts:
- gce_setup.0.vm_image
description: |
Use a container image to start the workbench instance.
properties:
- !ruby/object:Api::Type::String
name: 'repository'
description: |
The path to the container image repository.
For example: gcr.io/{project_id}/{imageName}
required: true
- !ruby/object:Api::Type::String
name: 'tag'
description: |
The tag of the container image. If not specified, this defaults to the latest tag.
- !ruby/object:Api::Type::NestedObject
name: bootDisk
default_from_api: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "google_workbench_instance" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['instance_name'] %>"
location = "us-west1-a"

gce_setup {
container_image {
repository = "us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310"
tag = "latest"
}
}
}
Loading