From 4f7599c7b5dcbbdd18c2a0075645ee90a03f183c Mon Sep 17 00:00:00 2001 From: danykaufman Date: Wed, 28 Feb 2024 12:26:36 +0200 Subject: [PATCH] [Jupyter] [Shell] conda install block fix (#1022) Co-authored-by: Dany Kaufman --- stable/jupyter/Chart.yaml | 2 +- stable/jupyter/templates/jupyter-configmap.yaml | 15 +++++++-------- stable/shell/Chart.yaml | 2 +- stable/shell/templates/shell-configmap.yaml | 15 +++++++-------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/stable/jupyter/Chart.yaml b/stable/jupyter/Chart.yaml index 4713eb729..38118f154 100755 --- a/stable/jupyter/Chart.yaml +++ b/stable/jupyter/Chart.yaml @@ -1,4 +1,4 @@ -version: 0.14.38 +version: 0.14.39 apiVersion: v1 appVersion: 3.4.8 name: jupyter diff --git a/stable/jupyter/templates/jupyter-configmap.yaml b/stable/jupyter/templates/jupyter-configmap.yaml index 030c16905..8063cf944 100644 --- a/stable/jupyter/templates/jupyter-configmap.yaml +++ b/stable/jupyter/templates/jupyter-configmap.yaml @@ -45,7 +45,7 @@ data: {{ include "v3io-configs.script.lookupService" . | indent 4 }} ## Reset .bashrc on revision update - BASHRC_REV=1 + BASHRC_REV=2 if ! $(grep -q IGZ_BASHRC_REV_${BASHRC_REV} ${HOME}/.bashrc 2>/dev/null); then log 'Reset .bashrc on revision update' echo "#IGZ_BASHRC_REV_${BASHRC_REV}" > ${HOME}/.bashrc @@ -315,14 +315,13 @@ data: } function extended_conda(){ - if [ "\${CONDA_DEFAULT_ENV-}" = "base" ] && [ "\$1" = "install" ]; then - echo "Error: Conda installations to the (base) environment are not persistent." - echo " Please activate a different conda environment or create a new one." - return 1 - fi - if [[ \${CONDA_DEFAULT_ENV-} =~ jupyter|mlrun-base|mlrun-extended ]] && [ "\$1" = "install" ]; then + if [[ \${CONDA_DEFAULT_ENV-} = "base" || \${CONDA_DEFAULT_ENV-} = "jupyter" || \${CONDA_DEFAULT_ENV-} = "mlrun-base" || \${CONDA_DEFAULT_ENV-} = "mlrun-extended" ]] && [ "\$1" = "install" ]; then echo "Error: Conda installations to the (\${CONDA_DEFAULT_ENV}) environment are not persistent." - echo " Please use PIP for persistent installations or create/activate another conda environment." + if [ "\${CONDA_DEFAULT_ENV-}" = "base" ]; then + echo " Please activate a different conda environment or create a new one." + else + echo " Please use PIP for persistent installations or create/activate another conda environment." + fi return 1 fi conda "\$@" diff --git a/stable/shell/Chart.yaml b/stable/shell/Chart.yaml index f166ef5b7..ecd1801b8 100644 --- a/stable/shell/Chart.yaml +++ b/stable/shell/Chart.yaml @@ -1,4 +1,4 @@ -version: 0.17.12 +version: 0.17.13 apiVersion: v1 appVersion: ">=2.0.0" description: Shell access to data services diff --git a/stable/shell/templates/shell-configmap.yaml b/stable/shell/templates/shell-configmap.yaml index cf97f739c..8ae615304 100644 --- a/stable/shell/templates/shell-configmap.yaml +++ b/stable/shell/templates/shell-configmap.yaml @@ -41,7 +41,7 @@ data: {{ include "v3io-configs.script.lookupService" . | indent 4 }} ## Reset .bashrc on revision update - BASHRC_REV=1 + BASHRC_REV=2 if ! $(grep -q IGZ_BASHRC_REV_${BASHRC_REV} ${HOME}/.bashrc 2>/dev/null); then log 'Reset .bashrc on revision update' echo "#IGZ_BASHRC_REV_${BASHRC_REV}" > ${HOME}/.bashrc @@ -297,14 +297,13 @@ data: } function extended_conda(){ - if [ "\${CONDA_DEFAULT_ENV-}" = "base" ] && [ "\$1" = "install" ]; then - echo "Error: Conda installations to the (base) environment are not persistent." - echo " Please activate a different conda environment or create a new one." - return 1 - fi - if [[ \${CONDA_DEFAULT_ENV-} =~ jupyter|mlrun-base|mlrun-extended ]] && [ "\$1" = "install" ]; then + if [[ \${CONDA_DEFAULT_ENV-} = "base" || \${CONDA_DEFAULT_ENV-} = "jupyter" || \${CONDA_DEFAULT_ENV-} = "mlrun-base" || \${CONDA_DEFAULT_ENV-} = "mlrun-extended" ]] && [ "\$1" = "install" ]; then echo "Error: Conda installations to the (\${CONDA_DEFAULT_ENV}) environment are not persistent." - echo " Please use PIP for persistent installations or create/activate another conda environment." + if [ "\${CONDA_DEFAULT_ENV-}" = "base" ]; then + echo " Please activate a different conda environment or create a new one." + else + echo " Please use PIP for persistent installations or create/activate another conda environment." + fi return 1 fi conda "\$@"