Repository navigation
Expand file tree
/
Copy pathscript
More file actions
35 lines (29 loc) · 1.57 KB
/
Copy pathscript
File metadata and controls
35 lines (29 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export DATA_SECURITY_MODE=USER_ISOLATION
envsubst < databricks.yml.tmpl > databricks.yml
trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT
# Show the cluster's pypi library plan entries; build/plan noise and the noisy wheel path go to LOG.
plan_pypi_libs() {
$CLI bundle plan -o json 2>>LOG.plan | jq '.plan["resources.clusters.test_cluster"].changes | with_entries(select(.key | startswith("libraries[pypi")))'
}
title "Deploy the cluster (declares requests and urllib3) and the wheel job that targets it"
$CLI bundle deploy &> LOG.deploy
cat LOG.deploy | contains.py "clusters.test_cluster" > /dev/null
printf '\n%s\n' "OK: deployed"
# Normalize server-generated resource IDs before we read requests/plans.
replace_ids.py
title "Run the job: its task installs the wheel and pypi 'six' on the shared cluster, out of band"
$CLI bundle run some_other_job &> LOG.run
printf '\n%s\n' "OK: job ran"
# Flush the install requests the run recorded so they do not leak into the redeploy assertions.
print_requests.py //libraries/install > /dev/null
title "Plan: the job's out-of-band 'six' shows as a removal, the declared libraries are unchanged"
trace plan_pypi_libs
title "Remove the declared 'urllib3' and redeploy: uninstalls urllib3 and the job's libraries, keeps requests"
update_file.py databricks.yml "
- pypi:
package: urllib3" ""
trace plan_pypi_libs
$CLI bundle deploy &> LOG.deploy2
cat LOG.deploy2 | contains.py "Updated clusters.test_cluster" > /dev/null
printf '\n%s\n' "OK: redeployed"
trace print_requests.py //libraries/uninstall //libraries/install