From 51a02f459fc62caddefeb2133f97c05b8f56ed99 Mon Sep 17 00:00:00 2001 From: Hedingber Date: Thu, 29 Apr 2021 18:11:06 +0300 Subject: [PATCH] [Runtimes] Fix skipped deployment to set the right image (#904) --- mlrun/builder.py | 5 ++--- mlrun/config.py | 2 +- mlrun/runtimes/kubejob.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mlrun/builder.py b/mlrun/builder.py index 068411bee1f..65c5df23fa5 100644 --- a/mlrun/builder.py +++ b/mlrun/builder.py @@ -171,7 +171,6 @@ def build_image( requirements_list = None requirements_path = requirements - base_image = base_image or config.default_image if with_mlrun: commands = commands or [] commands.append(_resolve_mlrun_install_command(mlrun_version_specifier)) @@ -266,7 +265,7 @@ def build_runtime(runtime, with_mlrun, mlrun_version_specifier, interactive=Fals logger.info(f"building image ({build.image})") name = normalize_name(f"mlrun-build-{runtime.metadata.name}") - base_image = enrich_image_url(build.base_image or "mlrun/mlrun") + base_image = enrich_image_url(build.base_image or config.default_base_image) if not build.base_image: with_mlrun = False @@ -287,7 +286,7 @@ def build_runtime(runtime, with_mlrun, mlrun_version_specifier, interactive=Fals ) runtime.status.build_pod = None if status == "skipped": - runtime.spec.image = build.base_image + runtime.spec.image = base_image runtime.status.state = "ready" return True diff --git a/mlrun/config.py b/mlrun/config.py index 499849cc768..5803393651a 100644 --- a/mlrun/config.py +++ b/mlrun/config.py @@ -63,7 +63,7 @@ "spark_app_image_tag": "", # image tag to use for spark opeartor app runtime "builder_alpine_image": "alpine:3.13.1", # builder alpine image (as kaniko's initContainer) "package_path": "mlrun", # mlrun pip package - "default_image": "python:3.6-jessie", + "default_base_image": "mlrun/mlrun", # default base image when doing .deploy() "default_project": "default", # default project name "default_archive": "", # default remote archive URL (for build tar.gz) "mpijob_crd_version": "", # mpijob crd version (e.g: "v1alpha1". must be in: mlrun.runtime.MPIJobCRDVersions) diff --git a/mlrun/runtimes/kubejob.py b/mlrun/runtimes/kubejob.py index 93661e0f511..a5401e3a657 100644 --- a/mlrun/runtimes/kubejob.py +++ b/mlrun/runtimes/kubejob.py @@ -135,7 +135,7 @@ def deploy( self.status = data["data"].get("status", None) self.spec.image = get_in(data, "data.spec.image") ready = data.get("ready", False) - if watch: + if watch and not ready: state = self._build_watch(watch) ready = state == "ready" self.status.state = state