Skip to content

Commit c6a5da7

Browse files
authored
Support Post sart up script on runtime templates (#15934)
1 parent e19a833 commit c6a5da7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

mmv1/products/colab/RuntimeTemplate.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,20 @@ properties:
209209
If a variable cannot be resolved, the reference in the input string will be unchanged.
210210
The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
211211
references will never be expanded, regardless of whether the variable exists or not.'
212+
- name: 'postStartupScriptConfig'
213+
type: NestedObject
214+
description: 'Post startup script config.'
215+
properties:
216+
- name: 'postStartupScript'
217+
type: String
218+
description: 'Post startup script to run after runtime is started.'
219+
- name: 'postStartupScriptUrl'
220+
type: String
221+
description: 'Post startup script url to download. Example: https://bucket/script.sh.'
222+
- name: 'postStartupScriptBehavior'
223+
type: Enum
224+
description: 'Post startup script behavior that defines download and execution behavior.'
225+
enum_values:
226+
- 'RUN_ONCE'
227+
- 'RUN_EVERY_START'
228+
- 'DOWNLOAD_AND_RUN_EVERY_START'

mmv1/templates/terraform/examples/colab_runtime_template_full.tf.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,17 @@ resource "google_colab_runtime_template" "{{$.PrimaryResourceId}}" {
5353
encryption_spec {
5454
kms_key_name = "{{index $.Vars "key_name"}}"
5555
}
56+
57+
software_config {
58+
env {
59+
name = "TEST"
60+
value = 1
61+
}
62+
63+
post_startup_script_config {
64+
post_startup_script = "echo 'hello world'"
65+
post_startup_script_url = "gs://colab-enterprise-pss-secure/secure_pss.sh"
66+
post_startup_script_behavior = "RUN_ONCE"
67+
}
68+
}
5669
}

0 commit comments

Comments
 (0)