From dd67dff7bc16fd4b9557fff679a540385fdc109c Mon Sep 17 00:00:00 2001 From: Shicheng Zhou <142252423+shichengzhou-db@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:23:57 -0800 Subject: [PATCH] explicitly set SINGLE_USER field. fix broken tests (#179) --- .github/workflows/generate-cicd-zip.yaml | 2 +- .github/workflows/run-checks.yaml | 2 +- .../.github/workflows/deploy-cicd.yml.tmpl | 2 +- .../.github/workflows/lint-cicd-workflow-files.yml.tmpl | 2 +- .../{{.input_project_name}}-bundle-cd-prod.yml.tmpl | 2 +- .../{{.input_project_name}}-bundle-cd-staging.yml.tmpl | 2 +- .../workflows/{{.input_project_name}}-bundle-ci.yml.tmpl | 8 ++++---- .../workflows/{{.input_project_name}}-run-tests.yml.tmpl | 4 ++-- .../resources/batch-inference-workflow-resource.yml.tmpl | 1 + .../feature-engineering-workflow-resource.yml.tmpl | 1 + .../resources/model-workflow-resource.yml.tmpl | 1 + .../resources/monitoring-resource.yml.tmpl | 1 + 12 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generate-cicd-zip.yaml b/.github/workflows/generate-cicd-zip.yaml index 4c744ad3..ddee710d 100644 --- a/.github/workflows/generate-cicd-zip.yaml +++ b/.github/workflows/generate-cicd-zip.yaml @@ -16,7 +16,7 @@ jobs: generate-zip: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Generate CICD Zip diff --git a/.github/workflows/run-checks.yaml b/.github/workflows/run-checks.yaml index 1fc14900..ed882388 100644 --- a/.github/workflows/run-checks.yaml +++ b/.github/workflows/run-checks.yaml @@ -5,7 +5,7 @@ jobs: run-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: 3.9 diff --git a/template/{{.input_root_dir}}/.github/workflows/deploy-cicd.yml.tmpl b/template/{{.input_root_dir}}/.github/workflows/deploy-cicd.yml.tmpl index a8efc6dc..1dba276b 100644 --- a/template/{{.input_root_dir}}/.github/workflows/deploy-cicd.yml.tmpl +++ b/template/{{.input_root_dir}}/.github/workflows/deploy-cicd.yml.tmpl @@ -27,7 +27,7 @@ jobs: id: timestamp run: | echo "timestamp=$(date +'%s')" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: {{`${{ github.event.pull_request.head.sha || github.sha }}`}} token: {{`${{ secrets.WORKFLOW_TOKEN }}`}} diff --git a/template/{{.input_root_dir}}/.github/workflows/lint-cicd-workflow-files.yml.tmpl b/template/{{.input_root_dir}}/.github/workflows/lint-cicd-workflow-files.yml.tmpl index 45435519..1e6ebd4b 100644 --- a/template/{{.input_root_dir}}/.github/workflows/lint-cicd-workflow-files.yml.tmpl +++ b/template/{{.input_root_dir}}/.github/workflows/lint-cicd-workflow-files.yml.tmpl @@ -9,7 +9,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download actionlint id: get_actionlint run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) diff --git a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-prod.yml.tmpl b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-prod.yml.tmpl index 6201b0e2..7be50f03 100644 --- a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-prod.yml.tmpl +++ b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-prod.yml.tmpl @@ -28,7 +28,7 @@ jobs: concurrency: {{ .input_project_name }}-prod-bundle-job runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: databricks/setup-cli@{{template `cli_version` .}} - name: Validate Bundle For Prod id: validate diff --git a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-staging.yml.tmpl b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-staging.yml.tmpl index d3451442..d1c5590f 100644 --- a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-staging.yml.tmpl +++ b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-staging.yml.tmpl @@ -28,7 +28,7 @@ jobs: concurrency: {{ .input_project_name }}-staging-bundle-job runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: databricks/setup-cli@{{template `cli_version` .}} - name: Validate Bundle For Staging id: validate diff --git a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-ci.yml.tmpl b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-ci.yml.tmpl index cdddcf61..25dbf457 100644 --- a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-ci.yml.tmpl +++ b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-ci.yml.tmpl @@ -31,7 +31,7 @@ jobs: concurrency: {{ .input_project_name }}-staging-bundle-job runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: {{`${{ github.event.pull_request.head.sha || github.sha }}`}} - uses: databricks/setup-cli@{{template `cli_version` .}} @@ -48,7 +48,7 @@ jobs: run: | databricks bundle validate -t {{ .input_staging_catalog_name }} > ../validate_output.txt - name: Create Comment with Bundle Configuration - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: comment with: github-token: {{`${{ secrets.GITHUB_TOKEN }}`}} @@ -75,7 +75,7 @@ jobs: concurrency: {{ .input_project_name }}-prod-bundle-job runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: {{`${{ github.event.pull_request.head.sha || github.sha }}`}} - uses: databricks/setup-cli@{{template `cli_version` .}} @@ -92,7 +92,7 @@ jobs: run: | databricks bundle validate -t {{ .input_prod_catalog_name }} > ../validate_output.txt - name: Create Comment with Bundle Configuration - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: comment with: github-token: {{`${{ secrets.GITHUB_TOKEN }}`}} diff --git a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-run-tests.yml.tmpl b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-run-tests.yml.tmpl index 549d2465..05ddac2c 100644 --- a/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-run-tests.yml.tmpl +++ b/template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-run-tests.yml.tmpl @@ -25,7 +25,7 @@ jobs: unit_tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: 3.8 @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: databricks/setup-cli@{{template `cli_version` .}} - name: Validate Bundle For Test Deployment Target in Staging Workspace id: validate diff --git a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/batch-inference-workflow-resource.yml.tmpl b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/batch-inference-workflow-resource.yml.tmpl index 14f03395..e82f35c7 100644 --- a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/batch-inference-workflow-resource.yml.tmpl +++ b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/batch-inference-workflow-resource.yml.tmpl @@ -3,6 +3,7 @@ new_cluster: &new_cluster num_workers: 3 spark_version: 15.3.x-cpu-ml-scala2.12 node_type_id: {{template `cloud_specific_node_type_id` .}} + data_security_mode: "SINGLE_USER" custom_tags: clusterSource: mlops-stacks_{{template `stacks_version` .}} diff --git a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/feature-engineering-workflow-resource.yml.tmpl b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/feature-engineering-workflow-resource.yml.tmpl index fd33a542..40555df4 100644 --- a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/feature-engineering-workflow-resource.yml.tmpl +++ b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/feature-engineering-workflow-resource.yml.tmpl @@ -3,6 +3,7 @@ new_cluster: &new_cluster num_workers: 3 spark_version: 15.3.x-cpu-ml-scala2.12 node_type_id: {{template `cloud_specific_node_type_id` .}} + data_security_mode: "SINGLE_USER" custom_tags: clusterSource: mlops-stacks_{{template `stacks_version` .}} diff --git a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/model-workflow-resource.yml.tmpl b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/model-workflow-resource.yml.tmpl index 91636bea..ca10e52b 100644 --- a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/model-workflow-resource.yml.tmpl +++ b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/model-workflow-resource.yml.tmpl @@ -3,6 +3,7 @@ new_cluster: &new_cluster num_workers: 3 spark_version: 15.3.x-cpu-ml-scala2.12 node_type_id: {{template `cloud_specific_node_type_id` .}} + data_security_mode: "SINGLE_USER" custom_tags: clusterSource: mlops-stacks_{{template `stacks_version` .}} diff --git a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/monitoring-resource.yml.tmpl b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/monitoring-resource.yml.tmpl index 1f90fad5..c68d64c7 100644 --- a/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/monitoring-resource.yml.tmpl +++ b/template/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/resources/monitoring-resource.yml.tmpl @@ -7,6 +7,7 @@ new_cluster: &new_cluster num_workers: 3 spark_version: 15.3.x-cpu-ml-scala2.12 node_type_id: {{template `cloud_specific_node_type_id` .}} + data_security_mode: "SINGLE_USER" custom_tags: clusterSource: mlops-stacks_{{template `stacks_version` .}}