-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for variables with double underscores
- Loading branch information
1 parent
f0e8b7e
commit 3116d64
Showing
10 changed files
with
129 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
|
||
>>> $CLI bundle validate | ||
Error: incorrect variable name: [${var.double__underscore}] | ||
|
||
Name: double_underscore | ||
Target: default | ||
Workspace: | ||
User: $USERNAME | ||
Path: /Workspace/Users/$USERNAME/.bundle/double_underscore/default | ||
|
||
Found 1 error | ||
|
||
Exit code: 1 | ||
Validation OK! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
integration/bundle/bundles/basic_with_variables/databricks_template_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"properties": { | ||
"unique_id": { | ||
"type": "string", | ||
"description": "Unique ID for job name" | ||
}, | ||
"spark_version": { | ||
"type": "string", | ||
"description": "Spark version used for job cluster" | ||
}, | ||
"node_type_id": { | ||
"type": "string", | ||
"description": "Node type id for job cluster" | ||
}, | ||
"root_path": { | ||
"type": "string", | ||
"description": "Root path to deploy bundle to", | ||
"default": "" | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
integration/bundle/bundles/basic_with_variables/template/databricks.yml.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
bundle: | ||
name: basic | ||
|
||
workspace: | ||
{{ if .root_path }} | ||
root_path: "{{.root_path}}/.bundle/{{.unique_id}}" | ||
{{ else }} | ||
root_path: "~/.bundle/{{.unique_id}}" | ||
{{ end }} | ||
|
||
variables: | ||
task__key: # Note: the variable has double underscore | ||
default: my_notebook_task | ||
|
||
resources: | ||
jobs: | ||
foo__bar: # Note: the resource has double underscore to check that TF provider can use such names | ||
name: test-job-basic-{{.unique_id}} | ||
tasks: | ||
- task_key: ${var.task__key} | ||
new_cluster: | ||
num_workers: 1 | ||
spark_version: "{{.spark_version}}" | ||
node_type_id: "{{.node_type_id}}" | ||
spark_python_task: | ||
python_file: ./hello_world.py | ||
foo: | ||
name: test-job-basic-ref-{{.unique_id}} | ||
tasks: | ||
- task_key: job_task | ||
run_job_task: | ||
job_id: ${resources.jobs.foo__bar.id} |
1 change: 1 addition & 0 deletions
1
integration/bundle/bundles/basic_with_variables/template/hello_world.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("Hello World!") |
4 changes: 4 additions & 0 deletions
4
integration/bundle/testdata/basic_with_variables/bundle_deploy.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Uploading bundle files to /Workspace/Users/5e3ea482-cb45-4da7-b139-b9eef101910e/.bundle/$UNIQUE_PRJ/files... | ||
Deploying resources... | ||
Updating deployment state... | ||
Deployment complete! |
7 changes: 7 additions & 0 deletions
7
integration/bundle/testdata/basic_with_variables/bundle_validate.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Name: basic | ||
Target: default | ||
Workspace: | ||
User: 5e3ea482-cb45-4da7-b139-b9eef101910e | ||
Path: /Workspace/Users/5e3ea482-cb45-4da7-b139-b9eef101910e/.bundle/$UNIQUE_PRJ | ||
|
||
Validation OK! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters