Skip to content

Commit

Permalink
[Runtimes] Fix skipped deployment to set the right image (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedingber committed Apr 29, 2021
1 parent e272b16 commit 51a02f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions mlrun/builder.py
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion mlrun/config.py
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mlrun/runtimes/kubejob.py
Expand Up @@ -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
Expand Down

0 comments on commit 51a02f4

Please sign in to comment.