Skip to content

Commit

Permalink
Adding UCX_FORCE_DEPENDENCIES flag to include the download of the whe…
Browse files Browse the repository at this point in the history
…el dependencies.
  • Loading branch information
aminmovahed-db committed May 5, 2024
1 parent 43e3d08 commit 36d41ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/databricks/labs/ucx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def __init__(
if not environ:
environ = dict(os.environ.items())
self._force_install = environ.get("UCX_FORCE_INSTALL")
# TODO: add a similar env parameter for force_dependecies_download
self._force_dependencies = environ.get("UCX_FORCE_DEPENDENCIES") == "True"
if "DATABRICKS_RUNTIME_VERSION" in environ:
msg = "WorkspaceInstaller is not supposed to be executed in Databricks Runtime"
raise SystemExit(msg)
Expand Down Expand Up @@ -174,6 +176,7 @@ def run(
self.product_info,
verify_timeout,
self._tasks,
self._force_dependencies,
)
workspace_installation = WorkspaceInstallation(
config,
Expand Down
6 changes: 4 additions & 2 deletions src/databricks/labs/ucx/installer/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def __init__( # pylint: disable=too-many-arguments
product_info: ProductInfo,
verify_timeout: timedelta,
tasks: list[Task],
force_dependencies=False,
skip_dashboards=False,
):
self._config = config
Expand All @@ -394,11 +395,12 @@ def __init__( # pylint: disable=too-many-arguments
self._verify_timeout = verify_timeout
self._tasks = tasks
self._this_file = Path(__file__)
self._force_dependencies = force_dependencies
self._skip_dashboards = skip_dashboards
super().__init__(config, installation, ws)

def create_jobs(self):
remote_wheel = self._upload_wheel()
remote_wheel = self._upload_wheel(self._force_dependencies)
desired_workflows = {t.workflow for t in self._tasks if t.cloud_compatible(self._ws.config)}
wheel_runner = None

Expand Down Expand Up @@ -520,7 +522,7 @@ def _deploy_workflow(self, step_name: str, settings):
self._install_state.jobs[step_name] = str(new_job.job_id)
return None

def _upload_wheel(self):
def _upload_wheel(self, force_dependencies: bool = False):
with self._wheels:
return self._wheels.upload_to_wsfs()

Expand Down

0 comments on commit 36d41ee

Please sign in to comment.