Skip to content

Commit 4bfea03

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents cdc99b2 + 60212f4 commit 4bfea03

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

.github/workflows/mlops_demo-bundle-cd-staging.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- name: Validate Bundle For Staging
2929
id: validate
3030
run: |
31-
databricks bundle validate -t qa
31+
databricks bundle validate -t staging
3232
- name: Deploy Bundle to Staging
3333
id: deploy
3434
run: |
35-
databricks bundle deploy -t qa
35+
databricks bundle deploy -t staging

.github/workflows/mlops_demo-bundle-validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
env:
3232
DATABRICKS_TOKEN: ${{ env.STAGING_WORKSPACE_TOKEN }}
3333
run: |
34-
databricks bundle validate -t qa > ../validate_output.txt
34+
databricks bundle validate -t staging > ../validate_output.txt
3535
- name: Create Comment with Bundle Configuration
3636
uses: actions/github-script@v7
3737
id: comment

.github/workflows/mlops_demo-run-lint-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ jobs:
5353
- name: Validate Bundle For Test Deployment Target in Staging Workspace
5454
id: validate
5555
run: |
56-
databricks bundle validate -t qa
56+
databricks bundle validate -t ci
5757
- name: Deploy Bundle to Test Deployment Target in Staging Workspace
5858
id: deploy
5959
run: |
60-
databricks bundle deploy -t qa
60+
databricks bundle deploy -t ci
6161
- name: Run Feature Engineering Workflow for Test Deployment Target in Staging Workspace
6262
id: feature_engineering
6363
run: |
64-
databricks bundle run write_feature_table_job -t qa
64+
databricks bundle run write_feature_table_job -t ci
6565
- name: Run Training Workflow for Test Deployment Target in Staging Workspace
6666
id: training
6767
run: |
68-
databricks bundle run model_training_job -t qa
68+
databricks bundle run model_training_job -t ci

mlops_demo/databricks.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ include:
1818
- ./resources/ml-artifacts-resource.yml
1919
- ./resources/model-workflow-resource.yml
2020
- ./resources/feature-engineering-workflow-resource.yml
21-
- ./resources/monitoring-resource.yml
21+
# TODO can only be done once batch inference is run (predictions table exists).
22+
#- ./resources/monitoring-resource.yml
2223

2324
# Deployment Target specific values for workspace
2425
targets:
@@ -28,7 +29,11 @@ targets:
2829
workspace:
2930
host: https://e2-demo-field-eng.cloud.databricks.com
3031

31-
qa:
32+
ci:
33+
workspace:
34+
host: https://e2-demo-field-eng.cloud.databricks.com
35+
36+
staging:
3237
workspace:
3338
host: https://e2-demo-field-eng.cloud.databricks.com
3439

mlops_demo/deployment/batch_inference/notebooks/PrepareBatchInferenceInput.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def rounded_unix_timestamp(dt, num_minutes=15):
1717
delta = math.ceil(nsecs / (60 * num_minutes)) * (60 * num_minutes) - nsecs
1818
return int((dt + timedelta(seconds=delta)).replace(tzinfo=timezone.utc).timestamp())
1919

20+
2021
rounded_unix_timestamp_udf = F.udf(rounded_unix_timestamp, IntegerType())
2122

2223

@@ -38,16 +39,22 @@ def rounded_taxi_data(taxi_data_df):
3839
taxi_data_df.createOrReplaceTempView("taxi_data")
3940
return taxi_data_df
4041

41-
4242
data = rounded_taxi_data(df)
4343

4444
# COMMAND ----------
4545

46-
data.write.format("delta").mode("overwrite").saveAsTable("qa_mlops_demo.marcin_wojtyczka.feature_store_inference_input")
46+
# MAGIC %sql
47+
# MAGIC create schema if not exists staging_mlops_demo.marcin_wojtyczka;
48+
# MAGIC create schema if not exists prod_mlops_demo.marcin_wojtyczka;
49+
# MAGIC create schema if not exists ci_mlops_demo.marcin_wojtyczka;
4750

4851
# COMMAND ----------
4952

50-
# MAGIC %sql
51-
# MAGIC select * from qa_mlops_demo.marcin_wojtyczka.feature_store_inference_input
53+
data.write.format("delta").mode("overwrite").saveAsTable("staging_mlops_demo.marcin_wojtyczka.feature_store_inference_input")
54+
data.write.format("delta").mode("overwrite").saveAsTable("prod_mlops_demo.marcin_wojtyczka.feature_store_inference_input")
55+
data.write.format("delta").mode("overwrite").saveAsTable("ci_mlops_demo.marcin_wojtyczka.feature_store_inference_input")
5256

5357
# COMMAND ----------
58+
59+
# MAGIC %sql
60+
# MAGIC select * from staging_mlops_demo.marcin_wojtyczka.feature_store_inference_input

0 commit comments

Comments
 (0)