Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added run_as section for bundle configuration #692

Merged
merged 5 commits into from
Aug 23, 2023
Merged

Added run_as section for bundle configuration #692

merged 5 commits into from
Aug 23, 2023

Conversation

andrewnester
Copy link
Contributor

Changes

Added run_as section for bundle configuration.

This section allows to define an user name or service principal which will be applied as an execution identity for jobs and DLT pipelines. In the case of DLT, identity defined in run_as will be assigned IS_OWNER permission on this pipeline.

Tests

Added unit tests for configuration.

Also ran deploy for the following bundle configuration

bundle:
  name: "run_as"

run_as:
  # service_principal_name: "f7263fcc-56d0-4981-8baf-c2a45296690b"
  user_name: "lennart.kats@databricks.com"

resources:
  pipelines:
    andrew_pipeline:
      name: "Andrew Nester pipeline"
      libraries:
        - notebook:
            path: ./test.py

  jobs:
    job_one:
      name: Job One
      tasks:
        - task_key: "task"
          new_cluster:
            num_workers: 1
            spark_version: 13.2.x-snapshot-scala2.12
            node_type_id: i3.xlarge
            runtime_engine: PHOTON
          notebook_task: 
            notebook_path: "./test.py"

bundle/config/mutator/run_as.go Show resolved Hide resolved
bundle/config/mutator/run_as.go Show resolved Hide resolved
bundle/config/root.go Outdated Show resolved Hide resolved
user_name: "my_user_name"

resources:
pipelines:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually remember there's one more caveat here: Terraform doesn't allow you to list yourself as the OWNER if you're the person deploying the pipeline. Does that case work in your implementation?

Copy link
Contributor Author

@andrewnester andrewnester Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lennartkats-db I added some logic to not add current user as an owner permission in this case

@andrewnester andrewnester added this pull request to the merge queue Aug 23, 2023
Merged via the queue into main with commit 4ee926b Aug 23, 2023
4 checks passed
@andrewnester andrewnester deleted the run-as branch August 23, 2023 16:57
andrewnester added a commit that referenced this pull request Aug 24, 2023
CLI:
 * Added `databricks account o-auth-enrollment enable` command ([#687](#687)).

Bundles:
 * Do not try auto detect Python package if no Python wheel tasks defined ([#674](#674)).
 * Renamed `environments` to `targets` in bundle configuration ([#670](#670)).
 * Rename init project-dir flag to output-dir ([#676](#676)).
 * Added support for sync.include and sync.exclude sections ([#671](#671)).
 * Add template directory flag for bundle templates ([#675](#675)).
 * Never ignore root directory when enumerating files in a repository ([#683](#683)).
 * Improve 'mode' error message ([#681](#681)).
 * Added run_as section for bundle configuration ([#692](#692)).
@andrewnester andrewnester mentioned this pull request Aug 24, 2023
github-merge-queue bot pushed a commit that referenced this pull request Aug 24, 2023
CLI:
* Added `databricks account o-auth-enrollment enable` command
([#687](#687)).

Bundles:
* Do not try auto detect Python package if no Python wheel tasks defined
([#674](#674)).
* Renamed `environments` to `targets` in bundle configuration
([#670](#670)).
* Rename init project-dir flag to output-dir
([#676](#676)).
* Added support for sync.include and sync.exclude sections
([#671](#671)).
* Add template directory flag for bundle templates
([#675](#675)).
* Never ignore root directory when enumerating files in a repository
([#683](#683)).
* Improve 'mode' error message
([#681](#681)).
* Added run_as section for bundle configuration
([#692](#692)).
arpitjasa-db pushed a commit to arpitjasa-db/cli that referenced this pull request Sep 7, 2023
## Changes
Added run_as section for bundle configuration.

This section allows to define an user name or service principal which
will be applied as an execution identity for jobs and DLT pipelines. In
the case of DLT, identity defined in `run_as` will be assigned
`IS_OWNER` permission on this pipeline.

## Tests
Added unit tests for configuration.

Also ran deploy for the following bundle configuration

```
bundle:
  name: "run_as"

run_as:
  # service_principal_name: "f7263fcc-56d0-4981-8baf-c2a45296690b"
  user_name: "lennart.kats@databricks.com"

resources:
  pipelines:
    andrew_pipeline:
      name: "Andrew Nester pipeline"
      libraries:
        - notebook:
            path: ./test.py

  jobs:
    job_one:
      name: Job One
      tasks:
        - task_key: "task"
          new_cluster:
            num_workers: 1
            spark_version: 13.2.x-snapshot-scala2.12
            node_type_id: i3.xlarge
            runtime_engine: PHOTON
          notebook_task:
            notebook_path: "./test.py"
```

Signed-off-by: Arpit Jasapara <arpit.jasapara@databricks.com>
arpitjasa-db pushed a commit to arpitjasa-db/cli that referenced this pull request Sep 7, 2023
CLI:
* Added `databricks account o-auth-enrollment enable` command
([databricks#687](databricks#687)).

Bundles:
* Do not try auto detect Python package if no Python wheel tasks defined
([databricks#674](databricks#674)).
* Renamed `environments` to `targets` in bundle configuration
([databricks#670](databricks#670)).
* Rename init project-dir flag to output-dir
([databricks#676](databricks#676)).
* Added support for sync.include and sync.exclude sections
([databricks#671](databricks#671)).
* Add template directory flag for bundle templates
([databricks#675](databricks#675)).
* Never ignore root directory when enumerating files in a repository
([databricks#683](databricks#683)).
* Improve 'mode' error message
([databricks#681](databricks#681)).
* Added run_as section for bundle configuration
([databricks#692](databricks#692)).

Signed-off-by: Arpit Jasapara <arpit.jasapara@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants