Skip to content

Commit

Permalink
[Jupyter] [Shell] conda install block fix (#1022)
Browse files Browse the repository at this point in the history
Co-authored-by: Dany Kaufman <[email protected]>
  • Loading branch information
danykaufman and Dany Kaufman authored Feb 28, 2024
1 parent f0c6e8f commit 4f7599c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion stable/jupyter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.14.38
version: 0.14.39
apiVersion: v1
appVersion: 3.4.8
name: jupyter
Expand Down
15 changes: 7 additions & 8 deletions stable/jupyter/templates/jupyter-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "\$@"
Expand Down
2 changes: 1 addition & 1 deletion stable/shell/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.17.12
version: 0.17.13
apiVersion: v1
appVersion: ">=2.0.0"
description: Shell access to data services
Expand Down
15 changes: 7 additions & 8 deletions stable/shell/templates/shell-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "\$@"
Expand Down

0 comments on commit 4f7599c

Please sign in to comment.