Skip to content

Commit 376a29b

Browse files
committed
try placeholder policy
1 parent 2a7493f commit 376a29b

4 files changed

Lines changed: 32 additions & 15 deletions

File tree

databricks.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,19 @@ bundle:
2929
name: DatabricksPOC
3030
uuid: ba682f8a-5d14-4ae7-a770-d6a359c0e835
3131

32+
exclude:
33+
- exclude-me-poc-test/*.yml
3234
include:
33-
# - 'variables/*.yml' if execute in order might be able to put vars in folders based off headings, may affect running in personal area before deploy?
34-
# - resources/variables/serverless_usage_policy_constants.yml
35-
# - resources/variables/env_serverless_usage_policy_constants.yml
3635
- resources/variables/*.yml
3736
- resources/environments/*.yml
3837
- resources/**/*.yml
3938
- resources/**/**/*.yml
39+
4040
# ** double astrix doesnt seem to do sub directories
4141
# poc should show ods ingest, reporting, and tests jobs and pipeline
4242

4343
# When this list get unmanageable we may want to consider a constants file but for similicity here is best for now
4444
variables:
45-
# qqqq redeclaring so it loads them?
46-
# serverless_usage_policies:
47-
# type: complex
48-
# env_serverless_usage_policies:
49-
# type: complex
50-
5145

5246
# ============================================================
5347
# Environment Configuration
@@ -128,7 +122,6 @@ targets:
128122
############## DBX UI and from local machine deploys
129123

130124
personal:
131-
132125
mode: development
133126
# Deploy under own user not service principle
134127
default: true
@@ -257,12 +250,14 @@ targets:
257250
env_serverless_usage_policies:
258251
env_analysis_batch_id: ${var.serverless_usage_policies.prod_analysis_batch_id}
259252
env_lh_live_id: ${var.serverless_usage_policies.prod_lh_live_id}
253+
260254
# Note: You can leave test IDs blank here or map them to a default
261255
# since Prod doesn't have test policies. However frustratingly despite excluding resource/test the bundle validation check it anyway
262-
env_test_all_id: "NA"
263-
env_test_dq_id: "NA"
264-
env_test_int_id: "NA"
265-
env_test_unit_id: "NA"
256+
257+
env_test_all_id: ${var.serverless_usage_policies.DUMMY_POLICY_FOR_BUNDLE_ID}
258+
env_test_dq_id: ${var.serverless_usage_policies.DUMMY_POLICY_FOR_BUNDLE_ID}
259+
env_test_int_id: ${var.serverless_usage_policies.DUMMY_POLICY_FOR_BUNDLE_ID}
260+
env_test_unit_id: ${var.serverless_usage_policies.DUMMY_POLICY_FOR_BUNDLE_ID}
266261
permissions:
267262
- group_name: prod_env_users
268263
level: CAN_VIEW

docs/But why is it like that.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ from teamname_functions import core_func as core
1515

1616
> this nice clean approach won't work for us because github wont have the same path and won't work for username paths. Which is why the approach in the project is to determine the existing path, and then path to the needed libraries based on it. Using the approach above will work until used in github or deployed to usernamed paths. Putting libraries outside of username workspaces would mean the libraries can't be easily changed with the work depending on them because they are outside of source control. Another option would have been through the ui but has similar issues [adding local library dependencys microsoft learn dbx](https://learn.microsoft.com/en-gb/azure/databricks/compute/serverless/dependencies#create-common-utilities-to-share-across-your-workspace)
1717
18+
## DUMMY_POLICY_FOR_BUNDLE_ID
19+
20+
Without having databricks.yml per target the bundle validate validates all yml included files at the top level, even if they are sync excluded e.g. prod excluding test files. So this policy should not show up in usage. It also mean we need to declare IDs for policys we are not using
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resources:
2+
jobs:
3+
fake_excluded_job:
4+
name: "[${bundle.target}] fake exclude job"
5+
6+
usage_policy_id: ${var.env_serverless_usage_policies.fake_policy_id}
7+
8+
tasks:
9+
- task_key: medallion_refresher
10+
run_job_task:
11+
job_id: ${resources.jobs.medallion_refresh.id}
12+
timeout_seconds: 1800 # fail after 30 min instead of hanging

resources/variables/serverless_usage_policy_constants.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ variables:
55
description: "Map of Databricks Serverless Usage Policy IDs for cost attribution"
66
type: complex
77
default:
8-
8+
#----------------------------------------------------------
9+
#-------# Ugly Bundle Validate Handling #--------
10+
#---------------------------------------------------------
11+
# Without having a databricks.yml per environment we need
12+
# a dummy id because despite sync/exclude bundle validate will check
13+
# for the value
14+
#---------------------------------------------------------------
15+
DUMMY_POLICY_FOR_BUNDLE_ID : "dd654d53-01e4-4fcf-b480-a17642b75fa4"
916
# ---------------------------------------------------------------------------
1017
# Default / Cross-Environment Policies
1118
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)