Skip to content

Commit

Permalink
cli: fix cluster-deploy
Browse files Browse the repository at this point in the history
* Updates and installs modules whenever the cluster is redeployed
  in debug mode as new code might come in.

* Removes python-install-eggs from cluster-build as the build only
  needs the submodule sources.
  • Loading branch information
Diego Rodriguez committed Sep 21, 2020
1 parent affd423 commit 5b95d56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions reana/reana_dev/cluster.py
Expand Up @@ -192,8 +192,6 @@ def cluster_build(
# initalise common submodules
if mode in ("latest", "debug"):
cmds.append("reana-dev git-submodule --update")
if mode in ("debug"):
cmds.append("reana-dev python-install-eggs")
# build Docker images
cmd = "reana-dev docker-build"
if exclude_components:
Expand Down Expand Up @@ -319,15 +317,21 @@ def job_mounts_to_config(job_mounts):
helm_install = "cat <<EOF | helm install reana helm/reana -n {namespace} --create-namespace --wait -f -\n{values}\nEOF".format(
namespace=namespace, values=values_dict and yaml.dump(values_dict) or "",
)
cmds = [
"helm dep update helm/reana",
helm_install,
"kubectl config set-context --current --namespace={}".format(namespace),
os.path.join(
get_srcdir("reana"),
f"scripts/create-admin-user.sh {instance_name} {admin_email} {admin_password}",
),
]
cmds = []
if mode in ("debug"):
cmds.append("reana-dev git-submodule --update")
cmds.append("reana-dev python-install-eggs")
cmds.extend(
[
"helm dep update helm/reana",
helm_install,
"kubectl config set-context --current --namespace={}".format(namespace),
os.path.join(
get_srcdir("reana"),
f"scripts/create-admin-user.sh {instance_name} {admin_email} {admin_password}",
),
]
)
for cmd in cmds:
run_command(cmd, "reana")

Expand Down
2 changes: 1 addition & 1 deletion scripts/create-admin-user.sh
Expand Up @@ -27,7 +27,7 @@ fi
while [ "0" -ne "$(kubectl exec deployment/reana-db -- pg_isready -U reana -h 127.0.0.1 -p 5432 &> /dev/null && echo $? || echo 1)" ]
do
echo "Waiting for deployment/reana-db to be ready..."
sleep 5
sleep 10
done

# Initialise database
Expand Down

0 comments on commit 5b95d56

Please sign in to comment.