File tree Expand file tree Collapse file tree
variable_reference_parent
config-remote-sync-recreate Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22"""
3- Print the cmd-exec-id from the first recorded request that has one in its User-Agent, and update
4- ACC_REPLS to replace it with [CMD_EXEC_ID_HASH]. The telemetry cmd_exec_id field is then only
3+ Update ACC_REPLS to replace the cmd-exec-id from the first recorded request that has one in its
4+ User-Agent with [CMD_EXEC_ID_HASH]. The telemetry cmd_exec_id field is then only
55replaced if it matches the id the CLI actually sent.
66
77Requires IncludeRequestHeaders = ["User-Agent"].
@@ -48,6 +48,4 @@ def extract_cmd_exec_id():
4848
4949
5050if __name__ == "__main__" :
51- exec_id = extract_cmd_exec_id ()
52- add_repl (exec_id , "CMD_EXEC_ID_HASH" )
53- print (exec_id )
51+ add_repl (extract_cmd_exec_id (), "CMD_EXEC_ID_HASH" )
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22"""
3- Print the lineage hash of the state, as the CLI reports it in the user agent (lineage/...)
4- and telemetry (state_lineage). Update ACC_REPLS to replace it with [LINEAGE_HASH].
3+ Update ACC_REPLS to replace the lineage hash of the state, as the CLI reports it in the user
4+ agent (lineage/...) and telemetry (state_lineage), with [LINEAGE_HASH].
55
66Use it after the deploy that mints a fresh lineage; fixture lineages hash to stable values
77and need no replacement.
@@ -39,9 +39,7 @@ def main():
3939
4040 filename = get_state_file (args .target , backup = False )
4141 lineage = json .loads (open (filename ).read ())["lineage" ]
42- value = shortid_hash (lineage )
43- add_repl (value , "LINEAGE_HASH" )
44- print (value )
42+ add_repl (shortid_hash (lineage ), "LINEAGE_HASH" )
4543
4644
4745if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ trap cleanup EXIT
1313
1414touch dummy.whl
1515$CLI bundle deploy
16- read_lineage.py > /dev/null
16+ read_lineage.py
1717job_id=" $( read_id.py my_job) "
1818
1919
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ cleanup() {
1010trap cleanup EXIT
1111
1212$CLI bundle deploy
13- read_lineage.py > /dev/null
13+ read_lineage.py
1414job_id=" $( read_id.py my_job) "
1515pipeline_id=" $( read_id.py my_pipeline) "
1616
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ cleanup() {
1010trap cleanup EXIT
1111
1212$CLI bundle deploy
13- read_lineage.py > /dev/null
13+ read_lineage.py
1414job_id=" $( read_id.py my_job) "
1515
1616title " Inject a spark_conf key under a field defined as a complex variable"
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ rm "$OUT_REQUESTS"
4040# resurrect. So this deploy starts fresh on the direct engine: there is nothing to migrate, it just
4141# recreates the resource.
4242trace DATABRICKS_BUNDLE_ENGINE=direct $CLI bundle deploy
43- read_lineage.py > /dev/null
43+ read_lineage.py
4444trace print_requests.py //api/2.1/unity-catalog/schemas | jq '.headers["User-Agent"][0]' | contains.py 'engine/direct' '!tf-provider'
4545trace print_state.py | jq .serial | contains.py "1"
4646
Original file line number Diff line number Diff line change 11trace $CLI bundle deploy
2- read_lineage.py > /dev/null
2+ read_lineage.py
33
44pipeline_id="$(read_id.py foo)"
55
Original file line number Diff line number Diff line change 11trace $CLI bundle deploy
2- read_lineage.py > /dev/null
2+ read_lineage.py
33
44# Edit the job name locally (not deployed) so the local config diverges from the
55# deployed state. config-remote-sync --save then overwrites that pending edit,
Original file line number Diff line number Diff line change 11trace $CLI bundle deploy
2- read_lineage.py > /dev/null
2+ read_lineage.py
33
44job_id="$(read_id.py foo)"
55edit_resource.py jobs $job_id <<EOF
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ errcode trace $CLI bundle deploy
22
33trace cat "$OUT_REQUESTS" | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs[] | fromjson | .entry.databricks_cli_log | {execution_context}' > out.telemetry.txt
44
5- extract_command_exec_id.py > /dev/null
5+ extract_command_exec_id.py
66rm "$OUT_REQUESTS"
You can’t perform that action at this time.
0 commit comments