diff --git a/template/v2/Dockerfile b/template/v2/Dockerfile index 4b4b7d3c..d9213c9b 100644 --- a/template/v2/Dockerfile +++ b/template/v2/Dockerfile @@ -94,11 +94,12 @@ RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \ micromamba install -y --name base --file /tmp/$ENV_IN_FILENAME && \ mkdir -p $SAGEMAKER_RECOVERY_MODE_HOME && \ chown $MAMBA_USER:$MAMBA_USER $SAGEMAKER_RECOVERY_MODE_HOME && \ + SUPERVISOR_VERSION=$(grep "^conda-forge::supervisor\[" /tmp/$ENV_IN_FILENAME) && \ JUPYTERLAB_VERSION=$(grep "^conda-forge::jupyterlab\[" /tmp/$ENV_IN_FILENAME) && \ SAGEMAKER_JUPYTERLAB_VERSION=$(grep "^conda-forge::sagemaker-jupyterlab-extension" /tmp/$ENV_IN_FILENAME) && \ echo "Installing in sagemaker-recovery-mode micromamba environment: $JUPYTERLAB_VERSION $SAGEMAKER_JUPYTERLAB_VERSION" && \ micromamba create -n sagemaker-recovery-mode && \ - micromamba install -n sagemaker-recovery-mode -y $JUPYTERLAB_VERSION $SAGEMAKER_JUPYTERLAB_VERSION && \ + micromamba install -n sagemaker-recovery-mode -y $JUPYTERLAB_VERSION $SAGEMAKER_JUPYTERLAB_VERSION $SUPERVISOR_VERSION && \ micromamba clean --all --yes --force-pkgs-dirs && \ rm -rf /tmp/*.in && \ sudo ln -s $(which python3) /usr/bin/python && \ diff --git a/template/v2/dirs/usr/local/bin/entrypoint-jupyter-server b/template/v2/dirs/usr/local/bin/entrypoint-jupyter-server index 92fe0a01..5b8c3ad4 100755 --- a/template/v2/dirs/usr/local/bin/entrypoint-jupyter-server +++ b/template/v2/dirs/usr/local/bin/entrypoint-jupyter-server @@ -7,7 +7,7 @@ set -e eval "$(micromamba shell hook --shell=bash)" if [ -n "$SAGEMAKER_RECOVERY_MODE" ]; then - export HOME=$SAGEMAKER_RECOVERY_MODE + export HOME=$SAGEMAKER_RECOVERY_MODE_HOME # Activate conda environment `sagemaker-recovery-mode` micromamba activate sagemaker-recovery-mode else diff --git a/template/v2/dirs/usr/local/bin/start-jupyter-server b/template/v2/dirs/usr/local/bin/start-jupyter-server index 689dfbb2..c2e3acec 100755 --- a/template/v2/dirs/usr/local/bin/start-jupyter-server +++ b/template/v2/dirs/usr/local/bin/start-jupyter-server @@ -4,7 +4,7 @@ set -e eval "$(micromamba shell hook --shell=bash)" if [ -n "$SAGEMAKER_RECOVERY_MODE" ]; then - export HOME=$SAGEMAKER_RECOVERY_MODE + export HOME=$SAGEMAKER_RECOVERY_MODE_HOME # Activate conda environment `sagemaker-recovery-mode` micromamba activate sagemaker-recovery-mode else diff --git a/test/test_dockerfile_based_harness.py b/test/test_dockerfile_based_harness.py index 9f416038..832063a5 100644 --- a/test/test_dockerfile_based_harness.py +++ b/test/test_dockerfile_based_harness.py @@ -225,7 +225,7 @@ def _validate_docker_images( # A consequence of this design decision is that any test assertions should go inside the container's entry-point. # Special handling for JupyterLab entrypoint testing - if dockerfile_path in ["recovery-mode.test.Dockerfile"]: + if dockerfile_path in ["sagemaker-recovery-mode.test.Dockerfile"]: _test_jupyterlab_entrypoint(image) else: container = _docker_client.containers.run(