Skip to content

Commit 158fbb3

Browse files
Track artifact path type used during bundle deploy (#2625)
## Why This will help us understand usage patterns of how often do customers explicitly choose to upload their artifacts to a UC Volume vs the workspace filesystem. Note that if `worksapce.artifact_path` is unspecified, then by default DABs uploads artifacts to the workspace file system. ## Tests Acceptance test.
1 parent 6bf403b commit 158fbb3

File tree

10 files changed

+120
-9
lines changed

10 files changed

+120
-9
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
bundle:
2+
name: sheep
3+
4+
workspace:
5+
artifact_path: /Workspace/abc
6+
7+
targets:
8+
one:
9+
default: true
10+
11+
two:
12+
workspace:
13+
artifact_path: /Volumes/main/a/b/c
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
>>> [CLI] bundle deploy -t one
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/sheep/one/files...
4+
Deploying resources...
5+
Deployment complete!
6+
7+
>>> [CLI] bundle deploy -t two
8+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/sheep/two/files...
9+
Deploying resources...
10+
Deployment complete!
11+
12+
>>> cat out.requests.txt
13+
{
14+
"bundle_uuid": "[UUID]",
15+
"resource_count": 0,
16+
"resource_job_count": 0,
17+
"resource_pipeline_count": 0,
18+
"resource_model_count": 0,
19+
"resource_experiment_count": 0,
20+
"resource_model_serving_endpoint_count": 0,
21+
"resource_registered_model_count": 0,
22+
"resource_quality_monitor_count": 0,
23+
"resource_schema_count": 0,
24+
"resource_volume_count": 0,
25+
"resource_cluster_count": 0,
26+
"resource_dashboard_count": 0,
27+
"resource_app_count": 0,
28+
"experimental": {
29+
"configuration_file_count": 1,
30+
"variable_count": 0,
31+
"complex_variable_count": 0,
32+
"lookup_variable_count": 0,
33+
"target_count": 2,
34+
"bundle_mode": "TYPE_UNSPECIFIED",
35+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
36+
}
37+
}
38+
{
39+
"bundle_uuid": "[UUID]",
40+
"resource_count": 0,
41+
"resource_job_count": 0,
42+
"resource_pipeline_count": 0,
43+
"resource_model_count": 0,
44+
"resource_experiment_count": 0,
45+
"resource_model_serving_endpoint_count": 0,
46+
"resource_registered_model_count": 0,
47+
"resource_quality_monitor_count": 0,
48+
"resource_schema_count": 0,
49+
"resource_volume_count": 0,
50+
"resource_cluster_count": 0,
51+
"resource_dashboard_count": 0,
52+
"resource_app_count": 0,
53+
"experimental": {
54+
"configuration_file_count": 1,
55+
"variable_count": 0,
56+
"complex_variable_count": 0,
57+
"lookup_variable_count": 0,
58+
"target_count": 2,
59+
"bundle_mode": "TYPE_UNSPECIFIED",
60+
"workspace_artifact_path_type": "UC_VOLUME"
61+
}
62+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
trace $CLI bundle deploy -t one
2+
3+
trace $CLI bundle deploy -t two
4+
5+
trace cat out.requests.txt | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs.[] | fromjson | .entry.databricks_cli_log.bundle_deploy_event'
6+
7+
rm out.requests.txt
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[Server]]
2+
Pattern = "GET /api/2.1/unity-catalog/volumes/main.a.b"
3+
Response.Body = '''
4+
{
5+
"catalog_name": "main",
6+
"schema_name": "a",
7+
"name": "b",
8+
"volume_type": "MANAGED",
9+
"full_name": "main.a.b"
10+
}
11+
'''
12+
13+
[[Server]]
14+
Pattern = "PUT /api/2.0/fs/directories/Volumes/main/a/b/c/.internal"
15+
Response.StatusCode = 200

acceptance/bundle/telemetry/deploy-config-file-count/output.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Deployment complete!
3838
"complex_variable_count": 0,
3939
"lookup_variable_count": 0,
4040
"target_count": 1,
41-
"bundle_mode": "TYPE_UNSPECIFIED"
41+
"bundle_mode": "TYPE_UNSPECIFIED",
42+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
4243
}
4344
}
4445
}

acceptance/bundle/telemetry/deploy-mode/output.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ A common practice is to use a username or principal name in this path, i.e. use
3737
"complex_variable_count": 0,
3838
"lookup_variable_count": 0,
3939
"target_count": 2,
40-
"bundle_mode": "DEVELOPMENT"
40+
"bundle_mode": "DEVELOPMENT",
41+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
4142
}
4243
}
4344
{
@@ -61,6 +62,7 @@ A common practice is to use a username or principal name in this path, i.e. use
6162
"complex_variable_count": 0,
6263
"lookup_variable_count": 0,
6364
"target_count": 2,
64-
"bundle_mode": "PRODUCTION"
65+
"bundle_mode": "PRODUCTION",
66+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
6567
}
6668
}

acceptance/bundle/telemetry/deploy-no-uuid/output.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Deployment complete!
4242
"complex_variable_count": 0,
4343
"lookup_variable_count": 0,
4444
"target_count": 1,
45-
"bundle_mode": "TYPE_UNSPECIFIED"
45+
"bundle_mode": "TYPE_UNSPECIFIED",
46+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
4647
}
4748
}
4849
}

acceptance/bundle/telemetry/deploy-target-count/output.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Deployment complete!
2626
"complex_variable_count": 0,
2727
"lookup_variable_count": 0,
2828
"target_count": 3,
29-
"bundle_mode": "TYPE_UNSPECIFIED"
29+
"bundle_mode": "TYPE_UNSPECIFIED",
30+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
3031
}
3132
}

acceptance/bundle/telemetry/deploy/output.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Deployment complete!
4848
"complex_variable_count": 0,
4949
"lookup_variable_count": 0,
5050
"target_count": 1,
51-
"bundle_mode": "TYPE_UNSPECIFIED"
51+
"bundle_mode": "TYPE_UNSPECIFIED",
52+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
5253
}
5354
}
5455
}

bundle/phases/deploy.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ func logTelemetry(ctx context.Context, b *bundle.Bundle) {
319319
bundleUuid = b.Config.Bundle.Uuid
320320
}
321321

322+
artifactPathType := protos.BundleDeployArtifactPathTypeUnspecified
323+
if libraries.IsVolumesPath(b.Config.Workspace.ArtifactPath) {
324+
artifactPathType = protos.BundleDeployArtifactPathTypeVolume
325+
} else if libraries.IsWorkspacePath(b.Config.Workspace.ArtifactPath) {
326+
artifactPathType = protos.BundleDeployArtifactPathTypeWorkspace
327+
}
328+
322329
mode := protos.BundleModeUnspecified
323330
if b.Config.Bundle.Mode == config.Development {
324331
mode = protos.BundleModeDevelopment
@@ -350,9 +357,10 @@ func logTelemetry(ctx context.Context, b *bundle.Bundle) {
350357
ResourceDashboardIDs: dashboardIds,
351358

352359
Experimental: &protos.BundleDeployExperimental{
353-
BundleMode: mode,
354-
ConfigurationFileCount: b.Metrics.ConfigurationFileCount,
355-
TargetCount: b.Metrics.TargetCount,
360+
BundleMode: mode,
361+
ConfigurationFileCount: b.Metrics.ConfigurationFileCount,
362+
TargetCount: b.Metrics.TargetCount,
363+
WorkspaceArtifactPathType: artifactPathType,
356364
},
357365
},
358366
})

0 commit comments

Comments
 (0)