Skip to content

Commit

Permalink
remove test worspace parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
valx committed Nov 17, 2024
1 parent e92b217 commit 4908ad3
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 60 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ This will prompt for parameters for initialization. Some of these parameters are

Others must be correctly specified for CI/CD to work:
* ``input_cicd_platform`` : CI/CD platform of choice. Currently we support GitHub Actions, GitHub Actions for GitHub Enterprise Servers, Azure DevOps and GitLab.
* ``input_databricks_test_workspace_host``: URL of staging Databricks workspace, used to run CI tests on PRs before they're deployed to staging.
* ``input_databricks_staging_workspace_host``: URL of staging Databricks workspace, used to preview config changes before they're deployed to production.
We encourage granting data scientists working on the current ML project non-admin (read) access to this workspace,
to enable them to view and debug CI test results
Expand Down Expand Up @@ -116,8 +115,7 @@ using separate workspaces can help prevent high load in staging from DOSing your
production model serving endpoints.

However, you can create a single workspace stack, by supplying the same workspace URL for
`input_databricks_test_workspace_host` , `input_databricks_staging_workspace_host`
and `input_databricks_prod_workspace_host`.
`input_databricks_staging_workspace_host` and `input_databricks_prod_workspace_host`.
If you go this route, we
recommend using different service principals to manage staging vs prod resources,
to ensure that CI workloads run in staging cannot interfere with production resources.
Expand Down
15 changes: 0 additions & 15 deletions databricks_template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,6 @@
}
}
},
"input_databricks_test_workspace_host": {
"order": 21,
"type": "string",
"default": "{{if eq .input_cloud `azure`}}https://adb-xxxx.xx.azuredatabricks.net{{else if eq .input_cloud `aws`}}https://your-test-workspace.cloud.databricks.com{{else if eq .input_cloud `gcp`}}https://your-test-workspace.gcp.databricks.com{{end}}",
"description": "\nURL of integration test Databricks workspace,\nIt will run PR CI and preview changes before they're deployed to staging.\nDefault",
"pattern": "^(https.*)?$",
"pattern_match_failure_message": "Databricks integration test workspace host URLs must start with https. Got invalid workspace host.",
"skip_prompt_if": {
"properties": {
"input_setup_cicd_and_project": {
"const": "Project_Only"
}
}
}
},
"input_databricks_staging_workspace_host": {
"order": 6,
"type": "string",
Expand Down
16 changes: 0 additions & 16 deletions library/template_variables.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@
{{- end -}}
{{- end }}

{{ define `databricks_test_workspace_host` -}}
{{- if not (eq (print .input_databricks_test_workspace_host) "") -}}
{{- with url (print .input_databricks_test_workspace_host) -}}
{{- print .Scheme `://` .Host -}}
{{- end -}}
{{- else -}}
{{- if eq .input_cloud `azure` -}}
https://adb-xxxx.xx.azuredatabricks.net
{{- else if eq .input_cloud `aws` -}}
https://your-staging-workspace.cloud.databricks.com
{{- else if eq .input_cloud `gcp` -}}
https://your-staging-workspace.gcp.databricks.com
{{- end -}}
{{- end -}}
{{- end }}

{{ define `databricks_staging_workspace_host` -}}
{{- if not (eq (print .input_databricks_staging_workspace_host) "") -}}
{{- with url (print .input_databricks_staging_workspace_host) -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ integration-test:
environment: dev
#need: unit-test
variables:
DATABRICKS_HOST: {{template `databricks_test_workspace_host` .}}
DATABRICKS_HOST: {{template `databricks_staging_workspace_host` .}}
DATABRICKS_CLIENT_ID: "${SP_CLIENT_ID}"
DATABRICKS_CLIENT_SECRET: "${SP_CLIENT_SECRET}"
script:
Expand Down
2 changes: 0 additions & 2 deletions template/{{.input_root_dir}}/_params_testing_only.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ input_root_dir={{.input_root_dir}}
input_project_name={{.input_project_name}}
input_cloud={{.input_cloud}}
input_cicd_platform={{.input_cicd_platform}}
input_databricks_test_workspace_host={{.input_databricks_test_workspace_host}}
input_databricks_staging_workspace_host={{.input_databricks_staging_workspace_host}}
input_databricks_prod_workspace_host={{.input_databricks_prod_workspace_host}}
input_default_branch={{.input_default_branch}}
Expand All @@ -15,7 +14,6 @@ input_schema_name={{.input_schema_name}}
input_unity_catalog_read_user_group={{.input_unity_catalog_read_user_group}}
input_inference_table_name={{.input_inference_table_name}}

databricks_test_workspace_host={{ template `databricks_test_workspace_host` . }}
databricks_staging_workspace_host={{ template `databricks_staging_workspace_host` . }}
databricks_prod_workspace_host={{ template `databricks_prod_workspace_host` . }}
cloud_specific_node_type_id={{ template `cloud_specific_node_type_id` . }}
Expand Down
13 changes: 6 additions & 7 deletions template/{{.input_root_dir}}/docs/mlops-setup.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ git push upstream {{ .input_default_branch }}

### Prerequisites
* You must be an account admin to add service principals to the account.
* You must be a Databricks workspace admin in the staging and prod workspaces. Verify that you're an admin by viewing the
[test workspace admin console]({{template `databricks_test_workspace_host` .}}#setting/accounts) and
* You must be a Databricks workspace admin in the staging and prod workspaces.
Verify that you're an admin by viewing the
[staging workspace admin console]({{template `databricks_staging_workspace_host` .}}#setting/accounts) and
[prod workspace admin console]({{template `databricks_prod_workspace_host` .}}#setting/accounts). If
the admin console UI loads instead of the Databricks workspace homepage, you are an admin.
[prod workspace admin console]({{template `databricks_prod_workspace_host` .}}#setting/accounts).
If the admin console UI loads instead of the Databricks workspace homepage, you are an admin.

### Set up authentication for CI/CD
#### Set up Service Principal
Expand Down Expand Up @@ -275,8 +275,7 @@ These workflows will be defined under `.azure/devops-pipelines`. After generatin

### Prerequisites
* You must be an account admin to add service principals to the account.
* You must be a Databricks workspace admin in the test, staging and prod workspaces. Verify that you're an admin by viewing the
[test workspace admin console]({{template `databricks_test_workspace_host` .}}#setting/accounts) and
* You must be a Databricks workspace admin in the staging and prod workspaces. Verify that you're an admin by viewing the
[staging workspace admin console]({{template `databricks_staging_workspace_host` .}}#setting/accounts) and
[prod workspace admin console]({{template `databricks_prod_workspace_host` .}}#setting/accounts). If
the admin console UI loads instead of the Databricks workspace homepage, you are an admin.
Expand All @@ -302,7 +301,7 @@ For example, if the deployment target is dev, we expect a catalog named dev to e
If you want to use different catalog names, please update the target names declared in the
{{- if (eq .input_setup_cicd_and_project `CICD_and_Project`)}}[{{ .input_project_name }}/databricks.yml](../{{template `project_name_alphanumeric_underscore` .}}/databricks.yml)
{{- else }} `databricks.yml` {{ end }} file.
If changing the staging, prod, or test deployment targets, you'll also need to update the workflows located in the .github/workflows directory.
If changing the staging, prod, or test deployment targets, you'll also need to update the workflows located in the .gitlab/pipelines directory.

The SP must have proper permission in each respective environment and the catalog for the environments.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ targets:

{{ if (eq .input_setup_cicd_and_project `CICD_and_Project`)}}

{{ .input_test_catalog_name }}:
workspace:
host: {{template `databricks_test_workspace_host` .}}

{{ .input_staging_catalog_name }}:
workspace:
host: {{template `databricks_staging_workspace_host` .}}
Expand All @@ -47,4 +43,7 @@ targets:
workspace:
host: {{template `databricks_prod_workspace_host` .}}

{{ end }}
{{ .input_test_catalog_name }}:
workspace:
host: {{template `databricks_staging_workspace_host` .}}
{{ end }}
1 change: 0 additions & 1 deletion tests/example-project-configs/aws/aws-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"input_project_name": "example-aws-github-project",
"input_cloud": "aws",
"input_cicd_platform": "github_actions",
"input_databricks_test_workspace_host": "https://your-test-workspace.cloud.databricks.com",
"input_databricks_staging_workspace_host": "https://your-staging-workspace.cloud.databricks.com",
"input_databricks_prod_workspace_host": "https://your-prod-workspace.cloud.databricks.com",
"input_default_branch": "main",
Expand Down
1 change: 0 additions & 1 deletion tests/example-project-configs/azure/azure-devops.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"input_project_name": "test-azure-devops-project",
"input_cloud": "azure",
"input_cicd_platform": "azure_devops",
"input_databricks_test_workspace_host": "https://adb-your-test-workspace.azuredatabricks.net",
"input_databricks_staging_workspace_host": "https://adb-your-staging-workspace.azuredatabricks.net",
"input_databricks_prod_workspace_host": "https://adb-your-prod-workspace.azuredatabricks.net",
"input_default_branch": "main",
Expand Down
1 change: 0 additions & 1 deletion tests/example-project-configs/azure/azure-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"input_project_name": "example-azure-github-project",
"input_cloud": "azure",
"input_cicd_platform": "github_actions",
"input_databricks_test_workspace_host": "https://adb-your-test-workspace.azuredatabricks.net",
"input_databricks_staging_workspace_host": "https://adb-your-staging-workspace.azuredatabricks.net",
"input_databricks_prod_workspace_host": "https://adb-your-prod-workspace.azuredatabricks.net",
"input_default_branch": "main",
Expand Down
1 change: 0 additions & 1 deletion tests/example-project-configs/azure/azure-gitlab.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"input_project_name": "example-azure-gitlab-project",
"input_cloud": "azure",
"input_cicd_platform": "gitlab",
"input_databricks_test_workspace_host": "https://adb-your-test-workspace.azuredatabricks.net",
"input_databricks_staging_workspace_host": "https://adb-your-staging-workspace.azuredatabricks.net",
"input_databricks_prod_workspace_host": "https://adb-your-prod-workspace.azuredatabricks.net",
"input_default_branch": "main",
Expand Down
1 change: 0 additions & 1 deletion tests/example-project-configs/gcp/gcp-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"input_project_name": "example-gcp-github-project",
"input_cloud": "gcp",
"input_cicd_platform": "github_actions",
"input_databricks_test_workspace_host": "https://your-test-workspace.gcp.databricks.com",
"input_databricks_staging_workspace_host": "https://your-staging-workspace.gcp.databricks.com",
"input_databricks_prod_workspace_host": "https://your-prod-workspace.gcp.databricks.com",
"input_default_branch": "main",
Expand Down
3 changes: 0 additions & 3 deletions tests/test_create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,16 @@
}
DEFAULT_PARAMS_AZURE = {
"input_cloud": "azure",
"input_databricks_test_workspace_host": "https://adb-xxxx.xx.azuredatabricks.net",
"input_databricks_staging_workspace_host": "https://adb-xxxx.xx.azuredatabricks.net",
"input_databricks_prod_workspace_host": "https://adb-xxxx.xx.azuredatabricks.net",
}
DEFAULT_PARAMS_AWS = {
"input_cloud": "aws",
"input_databricks_test_workspace_host": "https://your-test-workspace.cloud.databricks.com",
"input_databricks_staging_workspace_host": "https://your-staging-workspace.cloud.databricks.com",
"input_databricks_prod_workspace_host": "https://your-prod-workspace.cloud.databricks.com",
}
DEFAULT_PARAMS_GCP = {
"input_cloud": "gcp",
"input_databricks_test_workspace_host": "https://your-test-workspace.gcp.databricks.com",
"input_databricks_staging_workspace_host": "https://your-staging-workspace.gcp.databricks.com",
"input_databricks_prod_workspace_host": "https://your-prod-workspace.gcp.databricks.com",
}
Expand Down
3 changes: 0 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"input_project_name": "my-mlops-project",
"input_cloud": "azure",
"input_cicd_platform": "github_actions",
"input_databricks_test_workspace_host": "https://adb-xxxx.xx.azuredatabricks.net",
"input_databricks_staging_workspace_host": "https://adb-xxxx.xx.azuredatabricks.net",
"input_databricks_prod_workspace_host": "https://adb-xxxx.xx.azuredatabricks.net",
"input_default_branch": "main",
Expand All @@ -30,15 +29,13 @@
AWS_DEFAULT_PARAMS = {
**AZURE_DEFAULT_PARAMS,
"input_cloud": "aws",
"input_databricks_test_workspace_host": "https://your-test-workspace.cloud.databricks.com",
"input_databricks_staging_workspace_host": "https://your-staging-workspace.cloud.databricks.com",
"input_databricks_prod_workspace_host": "https://your-prod-workspace.cloud.databricks.com",
}

GCP_DEFAULT_PARAMS = {
**AZURE_DEFAULT_PARAMS,
"input_cloud": "gcp",
"input_databricks_test_workspace_host": "https://your-test-workspace.gcp.databricks.com",
"input_databricks_staging_workspace_host": "https://your-staging-workspace.gcp.databricks.com",
"input_databricks_prod_workspace_host": "https://your-prod-workspace.gcp.databricks.com",
}
Expand Down

0 comments on commit 4908ad3

Please sign in to comment.