Releases: databrickslabs/ucx
Releases · databrickslabs/ucx
v0.20.0
- Added ACL migration to
migrate-tables
workflow (#1135). - Added AVRO to supported format to be upgraded by SYNC (#1134). In this release, the
hive_metastore
package'stables.py
file has been updated to add AVRO as a supported format for the SYNC upgrade functionality. This change includes AVRO in the list of supported table formats in theis_format_supported_for_sync
method, which checks if the table format is notNone
and if the format's uppercase value is one of the supported formats. The addition of AVRO enables it to be upgraded using the SYNC functionality. Moreover, a new format called BINARYFILE has been introduced, which is not supported for SYNC upgrade. This release is part of the implementation of issue #1134, improving the compatibility of the SYNC upgrade functionality with various data formats. - Added
is_partitioned
column (#1130). A new column,is_partitioned
, has been added to theucx.tables
table in the assessment module, indicating whether the table is partitioned or not with valuesYes
or "No". This change addresses issue #871 and has been manually tested. The commit also includes updated documentation for the modified table. No new methods, CLI commands, workflows, or tests (unit, integration) have been introduced as part of this change. - Added assessment of interactive cluster usage compared to UC compute limitations (#1123).
- Added external location validation when creating catalogs with
create-catalogs-schemas
command (#1110). - Added flag to Job to identify Job submitted by jar (#1088). The open-source library has been updated with several new features aimed at enhancing user functionality and convenience. These updates include the addition of a new sorting algorithm, which provides users with an efficient and customizable method for organizing data. Additionally, a new caching mechanism has been implemented, improving the library's performance and reducing the amount of time required to access frequently used data. Furthermore, the library now supports multi-threading, enabling users to perform multiple operations simultaneously and increase overall productivity. Lastly, a new error handling system has been developed, providing users with more informative and actionable feedback when unexpected issues arise. These changes are a significant step forward in improving the library's performance, functionality, and usability for all users.
- Bump databricks-sdk from 0.22.0 to 0.23.0 (#1121). In this version update,
databricks-sdk
is upgraded from 0.22.0 to 0.23.0, introducing significant changes to the handling of AWS and Azure identities. TheAwsIamRole
class is replaced withAwsIamRoleRequest
in thedatabricks.sdk.service.catalog
module, affecting the creation of AWS storage credentials using IAM roles. Thecreate
function insrc/databricks/labs/ucx/aws/credentials.py
is updated to accommodate this modification. Additionally, theAwsIamRole
argument in thecreate
function offixtures.py
in thedatabricks/labs/ucx/mixins
directory is replaced withAwsIamRoleRequest
. The tests intests/integration/aws/test_access.py
are also updated to utilizeAwsIamRoleRequest
, andStorageCredentialInfo
intests/unit/azure/test_credentials.py
now usesAwsIamRoleResponse
instead ofAwsIamRole
. The new classes,AwsIamRoleRequest
andAwsIamRoleResponse
, likely include new features or bug fixes for AWS IAM roles. These changes require software engineers to thoroughly assess their codebase and adjust any relevant functions accordingly. - Deploy static views needed by #1123 interactive dashboard (#1139). In this update, we have added two new views,
misc_patterns_vw
andcode_patterns_vw
, to theinstall.py
script in thedatabricks/labs/ucx
directory. These views were originally intended to be deployed with a previous update (#1123) but were inadvertently overlooked. The addition of these views addresses issues with queries in theinteractive
dashboard. Thedeploy_schema
function has been updated with two new lines,deployer.deploy_view("misc_patterns", "queries/views/misc_patterns.sql")
anddeployer.deploy_view("code_patterns", "queries/views/code_patterns.sql")
, to deploy the new views using their respective SQL files from thequeries/views
directory. No other modifications have been made to the file. - Fixed Table ACL migration logic (#1149). The open-source library has been updated with several new features, providing enhanced functionality for software engineers. A new utility class has been added to simplify the process of working with collections, offering methods to filter, map, and reduce elements in a performant manner. Additionally, a new configuration system has been implemented, allowing users to easily customize library behavior through a simple JSON format. Finally, we have added support for asynchronous processing, enabling efficient handling of I/O-bound tasks and improving overall application performance. These features have been thoroughly tested and are ready for use in your projects.
- Fixed
AssertionError: assert '14.3.x-scala2.12' == '15.0.x-scala2.12'
from nightly integration tests (#1120). In this release, the open-source library has been updated with several new features to enhance functionality and provide more options to users. The library now supports multi-threading, allowing for more efficient processing of large datasets. Additionally, a new algorithm for data compression has been implemented, resulting in reduced memory usage and faster data transfer. The library API has also been expanded, with new methods for sorting and filtering data, as well as improved error handling. These changes aim to provide a more robust and performant library, making it an even more valuable tool for software engineers. - Increase code coverage by 1 percent (#1125).
- Skip installation if remote and local version is the same, provide prompt to override (#1084). In this release, the
new_installation
workflow in the open-source library has been enhanced to include a new use case for handling identical remote and local versions of UCX. When the remote and local versions are the same, the user is now prompted and if no override is requested, a RuntimeWarning is raised. Additionally, users are now prompted to update the existing installation and if confirmed, the installation proceeds. These modifications include manual testing and new unit tests to ensure functionality. These changes provide users with more control over their installation process and address a specific use case for handling identical UCX versions. - Updated databricks-labs-lsql requirement from ~=0.2.2 to >=0.2.2,<0.4.0 (#1137). The open-source library has been updated with several new features to enhance usability and functionality. Firstly, we have added support for asynchronous processing, allowing for more efficient handling of large data sets and improving overall performance. Additionally, a new configuration system has been implemented, which simplifies the setup process for users and increases customization options. We have also included a new error handling mechanism that provides more detailed and actionable information, making it easier to diagnose and resolve issues. Lastly, we have made significant improvements to the library's documentation, including updated examples, guides, and an expanded API reference. These changes are part of our ongoing commitment to improving the library and providing the best possible user experience.
- [Experimental] Add support for permission migration API (#1080).
Dependency updates:
- Updated databricks-labs-lsql requirement from ~=0.2.2 to >=0.2.2,<0.4.0 (#1137).
Contributors: @nkvuong, @nfx, @ericvergnaud, @pritishpai, @dleiva04, @dmoore247, @dependabot[bot], @qziyuan, @FastLee, @prajin-29
v0.19.0
- Added instance pool id to WorkspaceConfig (#1087). In this release, the
create
method of the_policy_installer
object has been updated to return an additional value,instance_pool_id
, which is then assigned and passed as an argument to theWorkspaceConfig
object in the_configure_new_installation
method. TheClusterPolicyInstaller
class in thev0.15.0_added_cluster_policy.py
file has also been updated to return a fourth value,instance_pool_id
, from thecreate
method, allowing for more flexibility in future enhancements. Additionally, the test functiontest_table_migration_job
in thetest_installation.py
file has been updated to skip when the script is not being run as part of a nightly test job or in debug mode, and the test functions in thetest_policy.py
file have been updated to reflect the new return value in thecreate
method. These changes enable better management and scaling of resources through instance pools, provide more granular control in the WorkspaceConfig, and improve testing efficiency. - Added more cross-linking between CLI commands (#1091). In this release, we have introduced several enhancements to our open-source library's Command Line Interface (CLI) and documentation. Specifically, we have added more cross-linking between CLI commands to improve navigation and usability. The documentation has been updated to include a new step in the UCX installation process, where users are required to run the assessment workflow after installing UCX. This workflow is the first step in the migration process and checks the compatibility of the user's workspace with Unity Catalog. Additionally, we have added new commands for principal-prefix-access, migrate-credentials, and migrate-locations, which are part of the table migration process. These new commands require the assessment workflow and group migration workflow to be completed before they can be executed. Overall, these changes aim to provide a more streamlined and detailed installation and migration process, improving the user experience for software engineers.
- Fixed command references in README.md (#1093). In this release, we have made improvements to the command references in the README.md file to enhance the overall readability and usability of the documentation for software engineers. Specifically, we have updated the links for the
migrate-locations
andvalidate_external_locations
commands to use the correct syntax, enclosing them in backticks to denote code. This change ensures that the links are correctly interpreted as commands and addresses any issues that may have arisen with their previous formatting. It is important to note that no new methods have been added in this release, and the existing functionality of the commands has not been changed in scope or functionality. - Fixing the issue in workspace id flag in create-account-group command (#1094). In this update, we have improved the
create_account_group
command related to theworkspace_ids
flag in our open-source library. Theworkspace_ids
flag's type has been changed fromlist[int] | None
tostr | None
, allowing for easier input of multiple workspace IDs as a string of comma-separated integers. Thecreate_account_level_groups
function in theAccountWorkspaces
class has been updated to accept this string and convert it to a list of integers before proceeding. To ensure proper functioning, we added a new test casetest_create_account_groups_with_id()
to check if the command handles the case when no workspace IDs are provided in the configuration. Thecreate_account_groups()
method now checks for this condition and raises aValueError
. Furthermore, themanual_workspace_info()
method has been updated to handle workspace name input by the user, receiving thews
object, along with prompts that contain the user input for the workspace name and the next workspace ID. - Rely UCX on the latest 14.3 LTS DBR instead of 15.x (#1097). In this release, we have implemented a quick fix to rely on the Long Term Support (LTS) version 14.3 of the Databricks Runtime (DBR) instead of 15.x for UCX, addressing issue #1096. This change affects the
_definition
function, which has been modified to use the latest LTS DBR instead of the latest Spark version. Thelatest_lts_dbr
variable is now assigned the value returned by theselect_spark_version
method with thelatest=True
andlong_term_support=True
parameters. Thespark_version
key in thepolicy_definition
dictionary is set to the value returned by the_policy_config
method withlatest_lts_dbr
as the argument. Additionally, in thetests/unit/installer/test_policy.py
file, theselect_spark_version
method of theclusters
object has been updated to accept any number of arguments and consistently return the string "14.2.x-scala2.12", allowing for greater flexibility. This is a temporary solution, with a more comprehensive fix being tracked in issue #1098. Developers should be aware of how theclusters
object is used in the codebase when adopting this project.
Contributors: @nfx, @qziyuan, @prajin-29
v0.18.0
- Added Legacy Table ACL grants migration (#1054). This commit introduces a legacy table ACL grants migration to the
migrate-tables
workflow, resolving issue #340 and paving the way for follow-up PRs #887 and #907. A newGrantsCrawler
class is added for crawling grants, along with aGroupManager
class to manage groups during migration. TheTablesMigrate
class is updated to accept an instance ofGrantsCrawler
andGroupManager
in its constructor. The migration process has been thoroughly tested with unit tests, integration tests, and manual testing on a staging environment. The changes include the addition of a new Enum classAclMigrationWhat
and updates to theTable
dataclass, and affect the way tables are selected for migration based on rules. The logging and error handling have been improved in theskip_schema
function. - Added
databricks labs ucx cluster-remap
command to remap legacy cluster configurations to UC-compatible (#994). In this open-source library update, we have developed and added thedatabricks labs ucx cluster-remap
command, which facilitates the remapping of legacy cluster configurations to UC-compatible ones. This new CLI command comes with user documentation to guide the cluster remapping process. Additionally, we have expanded the functionality of creating and managing UC external catalogs and schemas with the inclusion ofcreate-catalogs-schemas
andrevert-cluster-remap
commands. This change does not modify existing commands or workflows and does not introduce new tables. Thedatabricks labs ucx cluster-remap
command allows users to re-map and revert the re-mapping of clusters from Unity Catalog (UC) using the CLI, ensuring compatibility and streamlining the migration process. The new command and associated functions have been manually tested for functionality. - Added
migrate-tables
workflow (#1051). Themigrate-tables
workflow has been added, which allows for more fine-grained control over the resources allocated to the workspace. This workflow includes two new instance variablesmin_workers
andmax_workers
in theWorkspaceConfig
class, with default values of 1 and 10 respectively. A newtrigger
function has also been introduced, which initializes a configuration, SQL backend, and WorkspaceClient based on the provided configuration file. Therun_task
function has been added, which looks up the specified task, logs relevant information, and runs the task's function with the provided arguments. TheTask
class'sfn
attribute now includes anInstallation
object as a parameter. Additionally, a newmigrate-tables
workflow has been added for migrating tables from the Hive Metastore to the Unity Catalog, along with new classes and methods for table mapping, migration status refreshing, and migrating tables. Themigrate_dbfs_root_delta_tables
andmigrate_external_tables_sync
methods perform migrations for Delta tables located in the DBFS root and synchronize external tables, respectively. These functions use the workspace client to access the catalogs and ensure proper migration. Integration tests have also been added for these new methods to ensure their correct operation. - Added handling for
SYNC
command failures (#1073). This pull request introduces changes to improve handling ofSYNC
command failures during external table migrations in the Hive metastore. Previously, theSYNC
command's result was not checked, and failures were not logged. Now, the_migrate_external_table
method intable_migrate.py
fetches the result of theSYNC
command execution, logs a warning message for failures, and returnsFalse
if the command fails. A new integration test has been added to simulate a failedSYNC
command due to a non-existent catalog and schema, ensuring the migration tool handles such failures. A new test case has also been added to verify the handling ofSYNC
command failures during external table migrations, using a mock backend to simulate failures and checking for appropriate log messages. These changes enhance the reliability and robustness of the migration process, providing clearer error diagnosis and handling for potentialSYNC
command failures. - Added initial version of
databricks labs ucx migrate-local-code
command (#1067). A newdatabricks labs ucx migrate-local-code
command has been added to facilitate migration of local code to a Databricks environment, specifically targeting Python and SQL files. This initial version is experimental and aims to help users and administrators manage code migration, maintain consistency across workspaces, and enhance compatibility with the Unity Catalog, a component of Databricks' data and AI offerings. The command introduces a newFiles
class for applying migrations to code files, considering their language. It also updates the.gitignore
file and the pyproject.toml file to ensure appropriate version control management. Additionally, new classes and methods have been added to support code analysis, transformation, and linting for various programming languages. These improvements will aid in streamlining the migration process and ensuring compatibility with Databricks' environment. - Added instance pool to cluster policy (#1078). A new field,
instance_pool_id
, has been added to the cluster policy configuration inpolicy.py
, allowing users to specify the ID of an instance pool to be applied to all workflow clusters in the policy. This ID can be manually set or automatically retrieved by the system. A new private method,_get_instance_pool_id()
, has been added to handle the retrieval of the instance pool ID. Additionally, a new test for table migration jobs has been added totest_installation.py
to ensure the migration job is correctly configured with the specified parallelism, minimum and maximum number of workers, and instance pool ID. A new test case for creating a cluster policy with an instance pool has also been added totests/unit/installer/test_policy.py
to ensure the instance pool is added to the cluster policy during creation. These changes provide users with more control over instance pools and cluster policies, and improve the overall functionality of the library. - Fixed
ucx move
logic forMANAGED
&EXTERNAL
tables (#1062). Theucx move
command has been updated to allow for the movement of UC tables/views after the table upgrade process, providing flexibility in managing catalog structure. The command now supports moving multiple tables simultaneously, dropping managed tables/views upon confirmation, and deep-cloning managed tables while dropping and recreating external tables. A refactoring of theTableMove
class has improved code organization and readability, and the associated unit tests have been updated to reflect these changes. This feature is targeted towards developers and administrators seeking to adjust their catalog structure after table upgrades, with the added ability to manage exceptional conditions gracefully. - Fixed integration testing with random product names (#1074). In the recent update, the
trigger
function in thetasks.py
module of theucx
framework has undergone modification to incorporate a new argument,install_folder
, within theInstallation
object. This object is now generated locally within thetrigger
function and subsequently passed to therun_task
function. Theinstall_folder
is determined by obtaining the parent directory of theconfig_path
variable, transforming it into a POSIX-style path, and eliminating the leading "/Workspace" prefix. This enhancement guarantees that therun_task
function acquires the correct installation folder for theucx
framework, thereby improving the overall functionality and precision of the framework. Furthermore, theInstallation.current
method has been supplanted with the newly formedInstallation
object, which now encompasses theinstall_folder
argument. - Refactor installer to separate workflows methods from the installer class (#1055). In this release, the installer in the
cli.py
file has been refactored to improve modularity and maintainability. The installation and workflow functionalities have been separated by importing a new class calledWorkflowsInstallation
fromdatabricks.labs.ucx.installer.workflows
. TheWorkspaceInstallation
class is no longer used in various functions, and the newWorkflowsInstallation
class is used instead. Additionally, a new mixin class calledInstallationMixin
has been introduced, which includes methods for uninstalling UCX, removing jobs, and validating installation steps. TheWorkflowsInstallation
class now inherits from this mixin class. A new file,workflows.py
, has been added to thedatabricks/labs/ucx/installer
directory, which contains methods for managing Databricks jobs. The newWorkflowsInstallation
class is responsible for deploying workflows, uploading wheels to DBFS or WSFS, and creating debug notebooks. The refactoring also includes the addition of new methods for handling specific workflows, such asrun_workflow
,validate_step
, andrepair_run
, which are now contained in theWorkflowsInstallation
class. Thetest_install.py
file in thetests/unit
directory has also been updated to include new imports and test functions to accommodate these changes. - S...
v0.17.0
- Added AWS IAM role support to
databricks labs ucx create-uber-principal
command (#993). Thedatabricks labs ucx create-uber-principal
command now supports AWS Identity and Access Management (IAM) roles for external table migration. This new feature introduces a CLI command to create anuber-IAM
profile, which checks for the UCX migration cluster policy and updates or adds the migration policy to provide access to the relevant table locations. If no IAM instance profile or role is specified in the cluster policy, a new one is created and the new migration policy is added. This change includes new methods and functions to handle AWS IAM roles, instance profiles, and related trust policies. Additionally, new unit and integration tests have been added and verified on the staging environment. The implementation also identifies all S3 buckets used by the Instance Profiles configured in the workspace. - Added Dashboard widget to show the list of cluster policies along with DBR version (#1013). In this code revision, the
assessment
module of the 'databricks/labs/ucx' package has been updated to include a newPoliciesCrawler
class, which fetches, assesses, and snapshots cluster policies. This class extendsCrawlerBase
andCheckClusterMixin
and introduces the '_crawl', '_assess_policies', '_try_fetch', andsnapshot
methods. ThePolicyInfo
dataclass has been added to hold policy information, with a structure similar to theClusterInfo
dataclass. TheClusterInfo
dataclass has been updated to includespark_version
andpolicy_id
attributes. A new table for policies has been added, and cluster policies along with the DBR version are loaded into this table. Relevant user documentation, tests, and a Dashboard widget have been added to support this feature. Thecreate
function in 'fixtures.py' has been updated to enable a Delta preview feature in Spark configurations, and a new SQL file has been included for querying cluster policies. Additionally, a newcrawl_cluster_policies
method has been added to scan and store cluster policies with matching configurations. - Added
migration_status
table to capture a snapshot of migrated tables (#1041). Amigration_status
table has been added to track the status of migrated tables in the database, enabling improved management and tracking of migrations. The newMigrationStatus
class, which is a dataclass that holds the source and destination schema, table, and updated timestamp, is added. TheTablesMigrate
class now has a new_migration_status_refresher
attribute that is an instance of the newMigrationStatusRefresher
class. This class crawls themigration_status
table and returns a snapshot of the migration status, which is used to refresh the migration status and check if the table is upgraded. Additionally, the_init_seen_tables
method is updated to get the seen tables from the_migration_status_refresher
instead of fetching from the table properties. TheMigrationStatusRefresher
class fetches the migration status table and returns a snapshot of the migration status. This change also adds new test functions in the test file for the Hive metastore, which covers various scenarios such as migrating managed tables with and without caching, migrating external tables, and reverting migrated tables. - Added a check for existing inventory database to avoid losing existing, inject installation objects in tests and try fetching existing installation before setting global as default (#1043). In this release, we have added a new method,
_check_inventory_database_exists
, to theWorkspaceInstallation
class, which checks if an inventory database with a given name already exists in the Workspace. This prevents accidental overwriting of existing data and improves the robustness of handling inventory databases. Thevalidate_and_run
method has been updated to callapp.current_installation(workspace_client)
, allowing for a more flexible handling of installations. TheInstallation
class import has been updated to includeSerdeError
, and the test suite has been updated to inject installation objects and check for existing installations before setting the global installation as default. A new argumentinventory_schema_suffix
has been added to thefactory
method for customization of the inventory schema name. We have also added a new methodcheck_inventory_database_exists
to theWorkspaceInstaller
class, which checks if an inventory database already exists for a given installation type and raises anAlreadyExists
error if it does. The behavior of thedownload
method in theWorkspaceClient
class has been mocked, and theget_status
method has been updated to returnNotFound
in certain tests. These changes aim to improve the robustness, flexibility, and safety of the installation process in the Workspace. - Added a check for external metastore in SQL warehouse configuration (#1046). In this release, we have added new functionality to the Unity Catalog (UCX) installation process to enable checking for and connecting to an external Hive metastore configuration. A new method,
_get_warehouse_config_with_external_hive_metastore
, has been introduced to retrieve the workspace warehouse config and identify if it is set up for an external Hive metastore. If so, and the user confirms the prompt, UCX will be configured to connect to the external metastore. Additionally, new methods_extract_external_hive_metastore_sql_conf
andtest_cluster_policy_definition_<cloud_provider>_hms_warehouse()
have been added to handle the external metastore configuration for Azure, AWS, and GCP, and to handle the case when the data_access_config is empty. These changes provide more flexibility and ease of use when installing UCX with external Hive metastore configurations. The new importsEndpointConfPair
,GetWorkspaceWarehouseConfigResponse
from thedatabricks.sdk.service.sql
package are used to handle the endpoint configuration of the SQL warehouse. - Added integration tests for AWS - create locations (#1026). In this release, we have added comprehensive integration tests for AWS resources and their management in the
tests/unit/assessment/test_aws.py
file. TheAWSResources
class has been updated with new methods (AwsIamRole, add_uc_role, add_uc_role_policy, and validate_connection) and the regular expression for matching S3 resource ARN has been modified. Thecreate_external_locations
method now allows for creating external locations without validating them, and the_identify_missing_external_locations
function has been enhanced to match roles with a wildcard pattern. The new tests include validating the integration of AWS services with the system, testing the CLI's behavior when it is missing, and introducing new configuration scenarios with the addition of a Key Management Service (KMS) key during the creation of IAM roles and policies. These changes improve the robustness and reliability of AWS resource integration and handling in our system. - Bump Databricks SDK to v0.22.0 (#1059). In this release, we are bumping the Databricks SDK version to 0.22.0 and upgrading the
databricks-labs-lsql
package to ~0.2.2. The new dependencies for this release includedatabricks-sdk==0.22.0
,databricks-labs-lsql~=0.2.2
,databricks-labs-blueprint~=0.4.3
, andPyYAML>=6.0.0,<7.0.0
. In thefixtures.py
file, we have addedPermissionLevel.CAN_QUERY
to theCAN_VIEW
andCAN_MANAGE
permissions in the_path
function, allowing users to query the endpoint. Additionally, we have updated thetest_endpoints
function in thetest_generic.py
file as part of the integration tests for workspace access. This change updates the permission level for creating a serving endpoint fromCAN_MANAGE
toCAN_QUERY
, meaning that the assigned group can now only query the endpoint. We have also included thetest_feature_tables
function in the commit, which tests the behavior of feature tables in the Databricks workspace. This change only affects thetest_endpoints
function and its assert statements, and does not impact the functionality of thetest_feature_tables
function. - Changed default UCX installation folder to
/Applications/ucx
from/Users/<me>/.ucx
to allow multiple users users utilising the same installation (#854). In this release, we've added a new advanced feature that allows users to force the installation of UCX over an existing installation using theUCX_FORCE_INSTALL
environment variable. This variable can take two valuesglobal
and 'user', providing more control and flexibility in installing UCX. The default UCX installation folder has been changed to /Applications/ucx from /Users//.ucx to enable multiple users to utilize the same installation. A table detailing the expected install location,install_folder
, and mode for each combination of global and user values has been added to the README file. We've also added user prompts to confirm the installation if UCX is already installed and theUCX_FORCE_INSTALL
variable is set to 'user'. This feature is useful when users want to install UCX in a specific location or force the installation over an existing installation. However, it is recommended to use this feature with caution, as it can potentially break existing installations if not used correctly. Additionally, several changes to the implementation of the UCX installation process have been made, as well as new tests to ensure that the installation process works correctly in various scenarios. - Fix: Rec...
v0.16.0
- Added AWS IAM roles support to
databricks labs ucx migrate-credentials
command (#973). This commit adds AWS Identity and Access Management (IAM) roles support to thedatabricks labs ucx migrate-credentials
command, resolving issue #862 and being related to pull request #874. It includes the addition of aload
function toAWSResourcePermissions
to return identified instance profiles and the creation of anIamRoleMigration
class underaws/credentials.py
to migrate identified AWS instance profiles. Additionally, user documentation and a new CLI commanddatabricks labs ucx migrate-credentials
have been added, and the changes have been thoroughly tested with manual, unit, and integration tests. The functionality additions include new methods such asadd_uc_role_policy
andupdate_uc_trust_role
, among others, designed to facilitate the migration process for AWS IAM roles. - Added
create-catalogs-schemas
command to prepare destination catalogs and schemas before table migration (#1028). The Databricks Labs Unity Catalog (UCX) tool has been updated with a newcreate-catalogs-schemas
command to facilitate the creation of destination catalogs and schemas prior to table migration. This command should be executed after thecreate-table-mapping
command and is designed to prepare the workspace for migrating tables to UC. Additionally, a newCatalogSchema
class has been added to thehive_metastore
package to manage the creation of catalogs and schemas in the Hive metastore. This new functionality simplifies the process of preparing the destination Hive metastore for table migration, reducing the likelihood of user errors and ensuring that the metastore is properly configured. Unit tests have been added to thetests/unit/hive_metastore
directory to verify the behavior of theCatalogSchema
class and the newcreate-catalogs-schemas
command. This command is intended for use in contexts where GCP is not supported. - Added automated upgrade option to set up cluster policy (#1024). This commit introduces an automated upgrade option for setting up a cluster policy for older versions of UCX, separating the cluster creation policy from install.py to installer.policy.py and adding an upgrade script for older UCX versions. A new class,
ClusterPolicyInstaller
, is added to thepolicy.py
file in theinstaller
package to manage the creation and update of a Databricks cluster policy for Unity Catalog Migration. This class handles creating a new cluster policy with specific configurations, extracting external Hive Metastore configurations, and updating job policies. Additionally, the commit includes refactoring, removal of library references, and a new script, v0.15.0_added_cluster_policy.py, which contains the upgrade function. The changes are tested through manual and automated testing with unit tests and integration tests. This feature is intended for software engineers working with the project. - Added crawling for init scripts on local files to assessment workflow (#960). This commit introduces the ability to crawl init scripts stored on local files and S3 as part of the assessment workflow, resolving issue #9
- Added database filter for the
assessment
workflow (#989). In this release, we have added a new configuration option,include_databases
, to the assessment workflow which allows users to specify a list of databases to include for migration, rather than crawling all the databases in the Hive Metastore. This feature is implemented in theTablesCrawler
,UdfsCrawler
,GrantsCrawler
classes and the associated functions such as_all_databases
,getIncludeDatabases
,_select_databases
. These changes aim to improve efficiency and reduce unnecessary crawling, and are accompanied by modifications to existing functionality, as well as the addition of unit and integration tests. The changes have been manually tested and verified on a staging environment. - Estimate migration effort based on assessment database (#1008). In this release, a new functionality has been added to estimate the migration effort for each asset in the assessment database. The estimation is presented in days and is displayed on a new estimates dashboard with a summary widget for a global estimate per object type, along with assumptions and scope for each object type. A new
query
parameter has been added to theSimpleQuery
class to support this feature. Additional changes include the update of the_install_viz
and_install_query
methods, the inclusion of thedata_source_id
in the query metadata, and the addition of tests to ensure the proper functioning of the new feature. A new fixture,mock_installation_with_jobs
, has been added to support testing of the assessment estimates dashboard. - Explicitly write to
hive_metastore
fromcrawl_tables
task (#1021). In this release, we have improved the clarity and specificity of our handling of thehive_metastore
in thecrawl_tables
task. Previously, thedf.write.saveAsTable
method was used without explicitly specifying thehive_metastore
database, which could result in ambiguity. To address this issue, we have updated thesaveAsTable
method to include thehive_metastore
database, ensuring that tables are written to the correct location in the Hive metastore. These changes are confined to thesrc/databricks/labs/ucx/hive_metastore/tables.scala
file and affect thecrawl_tables
task. While no new methods have been added, the existingsaveAsTable
method has been modified to enhance the accuracy and predictability of our interaction with the Hive metastore. - Improved documentation for
databricks labs ucx move
command (#1025). Thedatabricks labs ucx move
command has been updated with new improvements to its documentation, providing enhanced clarity and ease of use for developers and administrators. This command facilitates the movement of UC tables/table(s) from one schema to another, either in the same or different catalog, during the table upgrade process. A significant enhancement is the preservation of the source table's permissions when moving to a new schema or catalog, maintaining the original table's access controls, simplifying the management of table permissions, and streamlining the migration process. These improvements aim to facilitate a more efficient table migration experience, ensuring that developers and administrators can effectively manage their UC tables while maintaining the desired level of access control and security. - Updated databricks-sdk requirement from ~=0.20.0 to ~=0.21.0 (#1030). In this update, the
databricks-sdk
package requirement has been updated to version~=0.21.0
from~=0.20.0
. This new version addresses several bugs and provides enhancements, including the fix for theget_workspace_client
method in GCP, the use of theall-apis
scope with the external browser, and an attempt to initialize all Databricks globals. Moreover, the API's settings nesting approach has changed, which may cause compatibility issues with previous versions. Several new services and dataclasses have been added to the API, and documentation and examples have been updated accordingly. There are no updates to thedatabricks-labs-blueprint
andPyYAML
dependencies in this commit.
Contributors: @nfx, @HariGS-DB, @william-conti, @dependabot[bot], @prajin-29, @FastLee, @qziyuan, @nkvuong, @mohanbaabu1996
v0.15.0
- Added AWS S3 support for
migrate-locations
command (#1009). In this release, the open-source library has been enhanced with AWS S3 support for themigrate-locations
command, enabling efficient and secure management of S3 data. The new functionality includes the identification of missing S3 prefixes and the creation of corresponding roles and policies through the addition of methods_identify_missing_paths
,_get_existing_credentials_dict
, andcreate_external_locations
. The library now also includes new classesAwsIamRole
,ExternalLocationInfo
, andStorageCredentialInfo
for better handling of AWS-related functionality. Additionally, two new tests,test_create_external_locations
andtest_create_external_locations_skip_existing
, have been added to ensure the correct behavior of the new AWS-related functionality. The new test functiontest_migrate_locations_aws
checks the AWS-specific implementation of themigrate-locations
command, whiletest_missing_aws_cli
verifies the correct error message is displayed when the AWS CLI is not found in the system path. These changes enhance the library's capabilities, improving data security, privacy, and overall performance for users working with AWS S3. - Added
databricks labs ucx create-uber-principal
command to create Azure Service Principal for migration (#976). The new CLI command,databricks labs ucx create-uber-principal
, has been introduced to create an Azure Service Principal (SPN) and grant it STORAGE BLOB READER access on all the storage accounts used by the tables in the workspace. The SPN information is then stored in the UCX cluster policy. A new class, AzureApiClient, has been added to isolate Azure API calls, and unit and integration tests have been included to verify the functionality. This development enhances migration capabilities for Azure workspaces, providing a more streamlined and automated way to create and manage Service Principals, and improves the functionality and usability of the UCX tool. The changes are well-documented and follow the project's coding standards. - Added
migrate-locations
command (#1016). In this release, we've added a new CLI command,migrate_locations
, to create Unity Catalog (UC) external locations. This command extracts candidates for location creation from theguess_external_locations
assessment task and checks if corresponding UC Storage Credentials exist before creating the locations. Currently, the command only supports Azure, with plans to add support for AWS and GCP in the future. Themigrate_locations
function is marked with theucx.command
decorator and is available as a command-line interface (CLI) command. The pull request also includes unit tests for this new command, which check the environment (Azure, AWS, or GCP) before executing the migration and log a message if the environment is AWS or GCP, indicating that the migration is not yet supported on those platforms. No changes have been made to existing workflows, commands, or tables. - Added handling for widget delete on upgrade platform bug (#1011). In this release, the
_install_dashboard
method indashboards.py
has been updated to handle a platform bug that occurred during the deletion of dashboard widgets during an upgrade process (issue #1011). Previously, the method attempted to delete each widget using theself._ws.dashboard_widgets.delete(widget.id)
command, which resulted in aTypeError
when attempting to delete a widget. The updated method now includes a try/except block that catches thisTypeError
and logs a warning message, while also tracking the issue under bug ES-1061370. The rest of the method remains unchanged, creating a dashboard with the given name, role, and parent folder ID if no widgets are present. This enhancement improves the robustness of the_install_dashboard
method by adding error handling for the SDK API response when deleting dashboard widgets, ensuring a smoother upgrade process. - Create UC external locations in Azure based on migrated storage credentials (#992). The
locations.py
file in thedatabricks.labs.ucx.azure
package has been updated to include a new classExternalLocationsMigration
, which creates UC external locations in Azure based on migrated storage credentials. This class takes various arguments, includingWorkspaceClient
,HiveMetastoreLocations
,AzureResourcePermissions
, andAzureResources
. It has arun()
method that lists any missing external locations in UC, extracts their location URLs, and attempts to create a UC external location with a mapped storage credential name if the missing external location is in the mapping. The class also includes helper methods for generating credential name mappings. Additionally, theresources.py
file in the same package has been modified to include a new methodmanaged_identity_client_id
, which retrieves the client ID of a managed identity associated with a given access connector. Test functions for theExternalLocationsMigration
class and Azure external locations functionality have been added in the new filetest_locations.py
. Thetest_resources.py
file has been updated to include tests for themanaged_identity_client_id
method. A newmappings.json
file has also been added for tests related to Azure external location mappings based on migrated storage credentials. - Deprecate legacy installer (#1014). In this release, we have deprecated the legacy installer for the UCX project, which was previously implemented as a bash script. A warning message has been added to inform users about the deprecation and direct them to the UCX installation instructions. The functionality of the script remains unchanged, and it still performs tasks such as installing Python dependencies and building Python bindings. The script will eventually be replaced with the
databricks labs install ucx
command. This change is part of issue #1014 and is intended to streamline the installation process and improve the overall user experience. We recommend that users update their installation process to the new recommended method as soon as possible to avoid any issues with the legacy installer in the future. - Prompt user if Terraform utilised for deploying infrastructure (#1004). In this update, the
config.py
file has been modified to include a new attribute,is_terraform_used
, in theWorkspaceConfig
class. This boolean flag indicates whether Terraform has been used for deploying certain entities in the workspace. Issue #393 has been addressed with this change. TheWorkspaceInstaller
configuration has also been updated to take advantage of this new attribute, allowing developers to determine if Terraform was used for infrastructure deployment, thereby increasing visibility into the deployment process. Additionally, a new prompt has been added to thewarehouse_type
function to ascertain if Terraform is being utilized for infrastructure deployment, setting theis_terraform_used
variable to True if it is. This improvement is intended for software engineers adopting this open-source library. - Updated CONTRIBUTING.md (#1005). In this contribution to the open-source library, the CONTRIBUTING.md file has been significantly updated with clearer instructions on how to effectively contibute to the project. The previous command to print the Python path has been removed, as the IDE is now advised to be configured to use the Python interpreter from the virtual environment. A new step has been added, recommending the use of a consistent styleguide and formatting of the code before every commit. Moreover, it is now encouraged to run tests before committing to minimize potential issues during the review process. The steps on how to make a Fork from the ucx repo and create a PR have been updated with links to official documentation. Lastly, the commit now includes information on handling dependency errors that may occur after
git pull
. - Updated databricks-labs-blueprint requirement from ~=0.2.4 to ~=0.3.0 (#1001). In this pull request update, the requirements file, pyproject.toml, has been modified to upgrade the databricks-labs-blueprint package from version ~0.2.4 to ~0.3.0. This update integrates the latest features and bug fixes of the package, including an automated upgrade framework, a brute-forcing approach for handling SerdeError, and enhancements for running nightly integration tests with service principals. These improvements increase the testability and functionality of the software, ensuring its stable operation with service principals during nightly integration tests. Furthermore, the reliability of the test for detecting existing installations has been reinforced by adding a new test function that checks for the correct detection of existing installations and retries the test for up to 15 seconds if they are not.
Dependency updates:
- Updated databricks-labs-blueprint requirement from ~=0.2.4 to ~=0.3.0 (#1001).
Contributors: @nfx, @qziyuan, @pritishpai, @FastLee, @dependabot[bot], @william-conti, @prajin-29, @HariGS-DB
v0.14.0
- Added
upgraded_from_workspace_id
property to migrated tables to indicated the source workspace (#987). In this release, updates have been made to the_migrate_external_table
,_migrate_dbfs_root_table
, and_migrate_view
methods in thetable_migrate.py
file to include a new parameterupgraded_from_ws
in the SQL commands used to alter tables, views, or managed tables. This parameter is used to store the source workspace ID in the migrated tables, indicating the migration origin. A new utility methodsql_alter_from
has been added to theTable
class intables.py
to generate the SQL command with the new parameter. Additionally, a new class-level attributeUPGRADED_FROM_WS_PARAM
has been added to theTable
class intables.py
to indicate the source workspace. A new propertyupgraded_from_workspace_id
has been added to migrated tables to store the source workspace ID. These changes resolve issue #899 and are tested through manual testing, unit tests, and integration tests. No new CLI commands, workflows, or tables have been added or modified, and there are no changes to user documentation. - Added a command to create account level groups if they do not exist (#763). This commit introduces a new feature that enables the creation of account-level groups if they do not already exist in the account. A new command,
create-account-groups
, has been added to thedatabricks labs ucx
tool, which crawls all workspaces in the account and creates account-level groups if a corresponding workspace-local group is not found. The feature supports various scenarios, including creating account-level groups that exist in some workspaces but not in others, and creating multiple account-level groups with the same name but different members. Several new methods have been added to theaccount.py
file to support the new feature, and thetest_account.py
file has been updated with new tests to ensure the correct behavior of thecreate_account_level_groups
method. Additionally, thecli.py
file has been updated to include the newcreate-account-groups
command. With these changes, users can easily manage account-level groups and ensure that they are consistent across all workspaces in the account, improving the overall user experience. - Added assessment for the incompatible
RunSubmit
API usages (#849). In this release, the assessment functionality for incompatibleRunSubmit
API usages has been significantly enhanced through various changes. The 'clusters.py' file has seen improvements in clarity and consistency with the renaming of private methodscheck_spark_conf
to_check_spark_conf
andcheck_cluster_failures
to_check_cluster_failures
. The_assess_clusters
method has been updated to call the renamed_check_cluster_failures
method for thorough checks of cluster configurations, resulting in better assessment functionality. A newSubmitRunsCrawler
class has been added to thedatabricks.labs.ucx.assessment.jobs
module, implementingCrawlerBase
,JobsMixin
, andCheckClusterMixin
classes. This class crawls and assesses job runs based on their submitted runs, ensuring compatibility and identifying failure issues. Additionally, a new configuration attribute,num_days_submit_runs_history
, has been introduced in theWorkspaceConfig
class of theconfig.py
module, controlling the number of days for which submission history ofRunSubmit
API calls is retained. Lastly, various new JSON files have been added for unit testing, assessing theRunSubmit
API usages related to different scenarios like dbt task runs, Git source-based job runs, JAR file runs, and more. These tests will aid in identifying and addressing potential compatibility issues with theRunSubmit
API. - Added group members difference to the output of
validate-groups-membership
cli command (#995). Thevalidate-groups-membership
command has been updated to include a comparison of group memberships at both the account and workspace levels. This enhancement is implemented through thevalidate_group_membership
function, which has been updated to calculate the difference in members between the two levels and display it in a newgroup_members_difference
column. This allows for a more detailed analysis of group memberships and easily identifies any discrepancies between the account and workspace levels. The corresponding unit test file, "test_groups.py," has been updated to include a new test case that verifies the calculation of thegroup_members_difference
value. The functionality of the other commands remains unchanged. The newgroup_members_difference
value is calculated as the difference in the number of members in the workspace group and the account group, with a positive value indicating more members in the workspace group and a negative value indicating more members in the account group. The table template in the labs.yml file has also been updated to include the new column for the group membership difference. - Added handling for empty
directory_id
if managed identity encountered during the crawling of StoragePermissionMapping (#986). This PR adds atype
field to theStoragePermissionMapping
andPrincipal
dataclasses to differentiate between service principals and managed identities, allowingNone
for thedirectory_id
field if the principal is not a service principal. During the migration to UC storage credentials, managed identities are currently ignored. These changes improve handling of managed identities during the crawling ofStoragePermissionMapping
, prevent errors when creating storage credentials with managed identities, and address issue #339. The changes are tested through unit tests, manual testing, and integration tests, and only affect theStoragePermissionMapping
class and related methods, without introducing new commands, workflows, or tables. - Added migration for Azure Service Principals with secrets stored in Databricks Secret to UC Storage Credentials (#874). In this release, we have made significant updates to migrate Azure Service Principals with their secrets stored in Databricks Secret to UC Storage Credentials, enhancing security and management of storage access. The changes include: Addition of a new
migrate_credentials
command in thelabs.yml
file to migrate credentials for storage access to UC storage credential. Modification ofsecrets.py
to handle the case where a secret has been removed from the backend and to log warning messages for secrets with invalid Base64 bytes. Introduction of theStorageCredentialManager
andServicePrincipalMigration
classes incredentials.py
to manage Azure Service Principals and their associated client secrets, and to migrate them to UC Storage Credentials. Addition of a newdirectory_id
attribute in thePrincipal
class and its associated dataclass inresources.py
to store the directory ID for creating UC storage credentials using a service principal. Creation of a new pytest fixture,make_storage_credential_spn
, infixtures.py
to simplify writing tests requiring Databricks Storage Credentials with Azure Service Principal auth. Addition of a new test file for the Azure integration of the project, including new classes, methods, and test cases for testing the migration of Azure Service Principals to UC Storage Credentials. These improvements will ensure better security and management of storage access using Azure Service Principals, while providing more efficient and robust testing capabilities. - Added permission migration support for feature tables and the root permissions for models and feature tables (#997). This commit introduces support for migration of permissions related to feature tables and sets root permissions for models and feature tables. New functions such as
feature_store_listing
,feature_tables_root_page
,models_root_page
, andtokens_and_passwords
have been added to facilitate population of a workspace access page with necessary permissions information. Thefactory
function inmanager.py
has been updated to include new listings for models' root page, feature tables' root page, and the feature store for enhanced management and access control of models and feature tables. New classes and methods have been implemented to handle permissions for these resources, utilizingGenericPermissionsSupport
,AccessControlRequest
, andMigratedGroup
classes. Additionally, new test methods have been included to verify feature tables listing functionality and root page listing functionality for feature tables and registered models. The test manager method has been updated to includefeature-tables
in the list of items to be checked for permissions, ensuring comprehensive testing of permission functionality related to these new feature tables. - Added support for serving endpoints (#990). In this release, we have made significant enhancements to support serving endpoints in our open-source library. The
fixtures.py
file in thedatabricks.labs.ucx.mixins
module has been updated with new classes and functions to create and manage serving endpoints, accompanied by integration tests to verify their functionality. We have added a new listing for serving endpoints in the assessment's permissions crawling, using thews.serving_endpoints.list
function and theserving-endpoints
category. A new integration test, "test_endpoints," has been added to verify that assessments now crawl perm...
v0.13.2
- Fixed
AnalysisException
incrawl_tables
task by ignoring the database that is not found (#970). - Fixed
Unknown: org.apache.hadoop.hive.ql.metadata.HiveException: NoSuchObjectException
incrawl_grants
task by ignoring the database that is not found (#967). - Fixed ruff config for ruff==2.0 (#969).
- Made groups integration tests less flaky (#965).
v0.13.1
- Added secret detection logic to Azure service principal crawler (#950).
- Create storage credentials based on instance profiles and existing roles (#869).
- Enforced
protected-access
pylint rule (#956). - Enforced
pylint
on unit and integration test code (#953). - Enforcing
invalid-name
pylint rule (#957). - Fixed AzureResourcePermissions.load to call Installation.load (#962).
- Fixed installer script to reuse an existing UCX Cluster policy if present (#964).
- More
pylint
tuning (#958). - Refactor
workspace_client_mock
to have combine fixtures stored in separate JSON files (#955).
Dependency updates:
- Updated databricks-sdk requirement from ~=0.19.0 to ~=0.20.0 (#961).
Contributors: @nfx, @dependabot[bot], @qziyuan, @HariGS-DB, @FastLee, @nkvuong
v0.13.0
- Added CLI Command
databricks labs ucx principal-prefix-access
(#949). - Added a widget with all jobs to track migration progress (#940).
- Added legacy cluster types to the assessment result (#932).
- Cleanup of install documentation (#951, #947).
- Fixed
WorkspaceConfig
initialization forDEBUG
notebook (#934). - Fixed installer not opening config file during the installation (#945).
- Fixed groups in config file not considered for group migration job (#943).
- Fixed bug where
tenant_id
inside secret scope is not detected (#942).
Contributors: @HariGS-DB, @william-conti, @nkvuong, @nfx, @prajin-29, @FastLee, @larsgeorge-db