File tree Expand file tree Collapse file tree 9 files changed +113
-120
lines changed
acceptance/bundle/deploy/jobs/check-metadata Expand file tree Collapse file tree 9 files changed +113
-120
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 11resources:
22 jobs:
33 bar:
4- name: test-job-metadata-2-{{.unique_id}}
4+ name: test-job-metadata-2-$UNIQUE_NAME
55 tasks:
66 - task_key: my_notebook_task
77 new_cluster:
88 num_workers: 1
9- spark_version: "{{.spark_version}}"
10- node_type_id: "{{.node_type_id}}"
9+ spark_version: $DEFAULT_SPARK_VERSION
10+ node_type_id: $NODE_TYPE_ID
1111 notebook_task:
1212 notebook_path: "./bar.py"
Original file line number Diff line number Diff line change 11bundle:
2- name: job- metadata
2+ name: deploy-jobs-check- metadata-$UNIQUE_NAME
33
44workspace:
5- root_path: " ~/.bundle/{{.unique_id}}"
5+ root_path: ~/.bundle/$UNIQUE_NAME
66
77include:
88 - "a/b/*.yml"
99
1010resources:
1111 jobs:
1212 foo:
13- name: test-job-metadata-1-{{.unique_id}}
13+ name: test-job-metadata-1-$UNIQUE_NAME
1414 tasks:
1515 - task_key: my_notebook_task
1616 new_cluster:
1717 num_workers: 1
18- spark_version: "{{.spark_version}}"
19- node_type_id: "{{.node_type_id}}"
18+ spark_version: $DEFAULT_SPARK_VERSION
19+ node_type_id: $NODE_TYPE_ID
2020 notebook_task:
2121 notebook_path: "./foo.py"
File renamed without changes.
Original file line number Diff line number Diff line change 1+
2+ >>> [CLI] bundle deploy
3+ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
4+ Deploying resources...
5+ Updating deployment state...
6+ Deployment complete!
7+
8+ === Assert job 1 is created
9+ {
10+ "name": "test-job-metadata-1-[UNIQUE_NAME]"
11+ }
12+
13+ === Assert job 2 is created
14+ {
15+ "name": "test-job-metadata-2-[UNIQUE_NAME]"
16+ }
17+
18+ === Read metadata object from the workspace
19+ >>> [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/state/metadata.json
20+
21+ >>> cat metadata.json
22+ {
23+ "version": 1,
24+ "config": {
25+ "bundle": {
26+ "git": {
27+ "bundle_root_path": "."
28+ }
29+ },
30+ "workspace": {
31+ "file_path": "/Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files"
32+ },
33+ "resources": {
34+ "jobs": {
35+ "bar": {
36+ "id": "[NUMID]",
37+ "relative_path": "a/b/resources.yml"
38+ },
39+ "foo": {
40+ "id": "[NUMID]",
41+ "relative_path": "databricks.yml"
42+ }
43+ }
44+ }
45+ }
46+ }
47+ === Check that metadata contains created job ids
48+ >>> cat metadata.json
49+ "id": "[NUMID]",
50+
51+ >>> cat metadata.json
52+ "id": "[NUMID]",
53+
54+ >>> [CLI] bundle destroy --auto-approve
55+ The following resources will be deleted:
56+ delete job bar
57+ delete job foo
58+
59+ All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
60+
61+ Deleting files...
62+ Destroy complete!
Original file line number Diff line number Diff line change 1+ envsubst < databricks.yml.tmpl > databricks.yml
2+ envsubst < a/b/resources.yml.tmpl > a/b/resources.yml
3+
4+ cleanup() {
5+ trace $CLI bundle destroy --auto-approve
6+ }
7+ trap cleanup EXIT
8+
9+ trace $CLI bundle deploy
10+
11+ title "Assert job 1 is created\n"
12+ JOB_1_ID=$($CLI bundle summary -o json | jq -r '.resources.jobs.foo.id')
13+ $CLI jobs get "${JOB_1_ID}" | jq '{name: .settings.name}'
14+
15+ title "Assert job 2 is created\n"
16+ JOB_2_ID=$($CLI bundle summary -o json | jq -r '.resources.jobs.bar.id')
17+ $CLI jobs get "${JOB_2_ID}" | jq '{name: .settings.name}'
18+
19+ title "Read metadata object from the workspace"
20+ trace $CLI workspace export "/Workspace/Users/${CURRENT_USER_NAME}/.bundle/${UNIQUE_NAME}/state/metadata.json" > metadata.json
21+ trace cat metadata.json
22+
23+ title "Check that metadata contains created job ids"
24+ trace cat metadata.json | grep "${JOB_1_ID}"
25+ trace cat metadata.json | grep "${JOB_2_ID}"
Original file line number Diff line number Diff line change 1+ Local = false
2+ Cloud = true
3+
4+ Ignore = [
5+ " databricks.yml" ,
6+ " a/b/resources.yml" ,
7+ " metadata.json" ,
8+ ]
9+
10+ [Env ]
11+ # MSYS2 automatically converts absolute paths like /Users/$username/$UNIQUE_NAME to
12+ # C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI
13+ # Setting this environment variable prevents that conversion on windows.
14+ MSYS_NO_PATHCONV = " 1"
15+
16+ [[Repls ]]
17+ Old = " [0-9]{12,}"
18+ New = " [NUMID]"
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments