Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions acceptance/bundle/paths/fallback_metric/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Deployment complete!

>>> cat out.requests.txt
[
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": false
Expand All @@ -40,6 +44,10 @@ Deployment complete!
}
]
[
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": false
Expand Down
8 changes: 8 additions & 0 deletions acceptance/bundle/telemetry/deploy-compute-type/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Deployment complete!

>>> cat out.requests.txt
[
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": false
Expand All @@ -39,6 +43,10 @@ Deployment complete!
}
]
[
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": false
Expand Down
14 changes: 14 additions & 0 deletions acceptance/bundle/telemetry/deploy-experimental/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
experimental:
use_legacy_run_as: true

run_as:
user_name: abcd

resources:
jobs:
foo:
tasks:
- task_key: task1
spark_python_task:
python_file: /Workspace/test.py
existing_cluster_id: hjkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Local = true
Cloud = false

[EnvMatrix]
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
44 changes: 44 additions & 0 deletions acceptance/bundle/telemetry/deploy-experimental/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

>>> [CLI] bundle deploy
Warning: You are using the legacy mode of run_as. The support for this mode is experimental and might be removed in a future release of the CLI. In order to run the DLT pipelines in your DAB as the run_as user this mode changes the owners of the pipelines to the run_as identity, which requires the user deploying the bundle to be a workspace admin, and also a Metastore admin if the pipeline target is in UC.
at experimental.use_legacy_run_as
in databricks.yml:4:22

Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> cat out.requests.txt
{
"bool_values": [
{
"key": "experimental.use_legacy_run_as",
"value": true
},
{
"key": "presets_name_prefix_is_set",
"value": false
},
{
"key": "skip_artifact_cleanup",
"value": false
},
{
"key": "python_wheel_wrapper_is_set",
"value": false
},
{
"key": "has_serverless_compute",
"value": false
},
{
"key": "has_classic_job_compute",
"value": false
},
{
"key": "has_classic_interactive_compute",
"value": true
}
]
}
5 changes: 5 additions & 0 deletions acceptance/bundle/telemetry/deploy-experimental/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
trace $CLI bundle deploy

trace cat out.requests.txt | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs[] | fromjson | .entry.databricks_cli_log.bundle_deploy_event.experimental | {bool_values}'

rm out.requests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Deployment complete!
>>> cat out.requests.txt
{
"bool_values": [
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Deployment complete!
>>> cat out.requests.txt
{
"bool_values": [
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": true
Expand Down
4 changes: 4 additions & 0 deletions acceptance/bundle/telemetry/deploy/out.telemetry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
"lookup_variable_count": 0,
"target_count": 1,
"bool_values": [
{
"key": "experimental.use_legacy_run_as",
"value": false
},
{
"key": "presets_name_prefix_is_set",
"value": false
Expand Down
3 changes: 3 additions & 0 deletions bundle/config/mutator/resourcemutator/run_as.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ func setPipelineOwnersToRunAsIdentity(b *bundle.Bundle) {
}

func (m *setRunAs) Apply(_ context.Context, b *bundle.Bundle) diag.Diagnostics {
// Track the use of the legacy run_as mode.
b.Metrics.AddBoolValue("experimental.use_legacy_run_as", b.Config.Experimental != nil && b.Config.Experimental.UseLegacyRunAs)

// Mutator is a no-op if run_as is not specified in the bundle
if b.Config.Value().Get("run_as").Kind() == dyn.KindInvalid {
return nil
Expand Down
Loading