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

Support Post sart up script on runtime templates #12929

Merged
merged 18 commits into from
Feb 1, 2025
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
37 changes: 37 additions & 0 deletions mmv1/products/colab/RuntimeTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,40 @@ properties:
- name: 'kmsKeyName'
type: String
description: 'The Cloud KMS encryption key (customer-managed encryption key) used to protect the runtime.'
- name: softwareConfig
type: NestedObject
description: 'The notebook software configuration of the notebook runtime.'
properties:
- name: 'env'
type: Array
description: 'Environment variables to be passed to the container.'
item_type:
type: NestedObject
properties:
- name: 'name'
type: String
description: 'Name of the environment variable. Must be a valid C identifier.'
- name: 'value'
type: String
description: 'Variables that reference a $(VAR_NAME) are expanded using the previous defined
environment variables in the container and any service environment variables.
If a variable cannot be resolved, the reference in the input string will be unchanged.
The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
references will never be expanded, regardless of whether the variable exists or not.'
- name: 'postStartupScriptConfig'
type: NestedObject
description: 'Post startup script config.'
properties:
- name: 'postStartupScript'
type: String
description: 'Post startup script to run after runtime is started.'
- name: 'postStartupScriptUrl'
type: String
description: 'Post startup script url to download. Example: https://bucket/script.sh.'
- name: 'postStartupScriptBehavior'
type: Enum
description: 'Post startup script behavior that defines download and execution behavior.'
enum_values:
- 'RUN_ONCE'
- 'RUN_EVERY_START'
- 'DOWNLOAD_AND_RUN_EVERY_START'
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,17 @@ resource "google_colab_runtime_template" "{{$.PrimaryResourceId}}" {
encryption_spec {
kms_key_name = "{{index $.Vars "key_name"}}"
}

software_config {
env {
name = "TEST"
value = 1
}

post_startup_script_config {
post_startup_script = "echo 'hello world'"
post_startup_script_url = "gs://colab-enterprise-pss-secure/secure_pss.sh"
post_startup_script_behavior = "RUN_ONCE"
}
}
}
Loading