From ae511d0e0c47d549a970d52fd4f7820d1cfe542a Mon Sep 17 00:00:00 2001 From: Clayton Parnell Date: Mon, 13 Jan 2025 15:23:00 +0000 Subject: [PATCH] update scripts for recovery mode --- .../dirs/usr/local/bin/entrypoint-jupyter-server | 10 ++++++++-- .../v2.3.0/dirs/usr/local/bin/start-jupyter-server | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/entrypoint-jupyter-server b/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/entrypoint-jupyter-server index ceda89d0..92fe0a01 100755 --- a/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/entrypoint-jupyter-server +++ b/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/entrypoint-jupyter-server @@ -6,8 +6,14 @@ set -e # micromamba commands (e.g. using `micromamba activate` to activate environments) eval "$(micromamba shell hook --shell=bash)" -# Activate conda environment 'base', where supervisord is installed -micromamba activate base +if [ -n "$SAGEMAKER_RECOVERY_MODE" ]; then + export HOME=$SAGEMAKER_RECOVERY_MODE + # Activate conda environment `sagemaker-recovery-mode` + micromamba activate sagemaker-recovery-mode +else + # Activate conda environment 'base' + micromamba activate base +fi # Set up SAGEMAKER_APP_TYPE_LOWERCASE based on SAGEMAKER_APP_TYPE export SAGEMAKER_APP_TYPE_LOWERCASE=$(echo $SAGEMAKER_APP_TYPE | tr '[:upper:]' '[:lower:]') diff --git a/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/start-jupyter-server b/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/start-jupyter-server index 6ff4eac3..689dfbb2 100755 --- a/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/start-jupyter-server +++ b/build_artifacts/v2/v2.3/v2.3.0/dirs/usr/local/bin/start-jupyter-server @@ -3,8 +3,14 @@ set -e eval "$(micromamba shell hook --shell=bash)" -# Activate conda environment 'base', which is the default environment for Cosmos -micromamba activate base +if [ -n "$SAGEMAKER_RECOVERY_MODE" ]; then + export HOME=$SAGEMAKER_RECOVERY_MODE + # Activate conda environment `sagemaker-recovery-mode` + micromamba activate sagemaker-recovery-mode +else + # Activate conda environment 'base' + micromamba activate base +fi # Start Jupyter server in rtc mode for shared spaces if [ -n "$SAGEMAKER_APP_TYPE_LOWERCASE" ] && [ "$SAGEMAKER_SPACE_TYPE_LOWERCASE" == "shared" ]; then