Skip to content

Commit

Permalink
cli: remove dangling images before deploy
Browse files Browse the repository at this point in the history
* Avoids having dangling docker images on the Kubernetes nodes
  because the Kubernetes Python library fails to list nodes (required
  by REANA-Commons and REANA-Server scheduler to determine if more
  workflows can be submitted) because of a validation error of data
  coming from the Kubernetes API. More information [here](kubernetes-client/python#895 (comment)).

* Tags the kindest/node image to latest because after installation
  it has `none` tag, which makes it count as a dangling image.
  • Loading branch information
Diego Rodriguez committed Jun 30, 2020
1 parent 71ff099 commit e77f754
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reana/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,7 @@ def job_mounts_to_config(job_mounts):
namespace=namespace, values=yaml.dump(values_dict),
)
deploy_cmds = [
"docker images -f 'dangling=true' -q | xargs docker rmi -f",
"helm dep update helm/reana",
helm_install,
"kubectl config set-context --current --namespace={}".format(namespace),
Expand Down Expand Up @@ -2200,6 +2201,8 @@ def add_volume_mounts(node):
cluster_create,
"reana-dev docker-pull -c reana",
"reana-dev kind-load-docker-image -c reana",
"docker tag $(docker images -f 'dangling=true' 'kindest/node' -q) kindest/node:latest",
# avoid having kindest/node as a dangling image (no tag)
]:
run_command(cmd, "reana")

Expand Down

0 comments on commit e77f754

Please sign in to comment.