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

Automatically assign a UC Metastore to a workspace #341

Closed
6 tasks
nfx opened this issue Sep 29, 2023 · 3 comments · Fixed by #1489
Closed
6 tasks

Automatically assign a UC Metastore to a workspace #341

nfx opened this issue Sep 29, 2023 · 3 comments · Fixed by #1489
Assignees
Labels
feat/account-level cross-workspace installations feat/migration-index mapping of databases to catalog or potentially other databases good first issue Good for newcomers step/assign metastore go/uc/upgrade Assign Metastore

Comments

@nfx
Copy link
Collaborator

nfx commented Sep 29, 2023

Background

Assign metastore to a workspace automatically.

Operational Considerations

If more than one metastore exists in a region, which is uncommon but exists for certain preview customers or for customers who were granted exceptions due to legal entity differences, specific legislative or regulation oversight, etc, we need to provide a way for the user to default their metastore choice.

Add default_catalog to configuration

TODO:

  • Attach UC Metastore to Workspace
  • Create CATALOG for Workspace with workspace ID in name
  • Bind Workspace to new CATALOG
  • Create Workspace Admin group at Account Level
  • Add Workspace Admins as members to the group
  • Set Workspace Admin group as the CATALOG owner

Process flow

The user opts to assign a workspace by making a selective action in the CLI.
Before they continue, there is an optional step to list the metastores available in their region.

e.g.
databricks labs ucx show_all_metastores <workspace_id>

Resulting action
Metastore information for the given region, specifically name and ID.

e.g
databricks labs ucx assign_metastore <workspace_id>

Resulting action
Metastore is assigned to this workspace, default catalog is the workspace catalog

e.g
databricks labs ucx assign_metastore <workspace_id> --default_catalog=main

Resulting action
Metastore is assigned to this workspace and the default catalog is set to main

For customers that have multiple metastores in a region:

e.g.
databricks labs ucx assign_metastore <workspace_id> --default_catalog=main --use_metastore_id=<metastore_id

Resulting action
The specific metastore is assigned to this workspace.

@nfx nfx added enhancement New feature or request feat/account-level cross-workspace installations step/assign metastore go/uc/upgrade Assign Metastore labels Sep 29, 2023
@renardeinside
Copy link
Contributor

Please note that quite often there might be several metastores in one region. It's not a recommended setup but it exists in some particular cases.

@nfx
Copy link
Collaborator Author

nfx commented Sep 29, 2023

@renardeinside can you elaborate on the reasoning behind that?

@nfx
Copy link
Collaborator Author

nfx commented Sep 29, 2023

@zpappa the CLI naming convention will be databricks labs ucx assign-metastore, as we'll have it as an installable extension for Databricks CLI.

@nfx nfx added the feat/migration-index mapping of databases to catalog or potentially other databases label Oct 2, 2023
@nfx nfx added this to UCX Oct 3, 2023
@nfx nfx moved this to Refined in UCX Oct 3, 2023
@zpappa zpappa moved this from Refined to Active Backlog in UCX Oct 16, 2023
@nfx nfx moved this from Active Backlog to Month Backlog in UCX Dec 6, 2023
@nfx nfx added good first issue Good for newcomers and removed enhancement New feature or request labels Apr 15, 2024
@nfx nfx closed this as completed in #1489 Apr 22, 2024
nfx pushed a commit that referenced this issue Apr 22, 2024
## Changes
- Add commands related to metastores handling

### Linked issues
<!-- DOC: Link issue with a keyword: close, closes, closed, fix, fixes,
fixed, resolve, resolves, resolved. See
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

Resolves #341 

### Functionality 

- [x] added relevant user documentation
- [x] added new CLI command
- [x] `databricks labs ucx assign-metastore` automatically assigns a
metastore when possible to a specified workspace
- [x] `databricks labs ucx show-all-metastores` shows all possible
metastores to be assigned to a workspace

### Tests
<!-- How is this tested? Please see the checklist below and also
describe any other relevant tests -->

- [x] manually tested
- [x] added unit tests
- [ ] verified on staging environment (screenshot attached)
@github-project-automation github-project-automation bot moved this from Month Backlog to Archive in UCX Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/account-level cross-workspace installations feat/migration-index mapping of databases to catalog or potentially other databases good first issue Good for newcomers step/assign metastore go/uc/upgrade Assign Metastore
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants