diff --git a/template/v1/Dockerfile b/template/v1/Dockerfile index f0c5e4c2..2178e544 100644 --- a/template/v1/Dockerfile +++ b/template/v1/Dockerfile @@ -101,7 +101,8 @@ RUN \ sagemaker-code-editor --install-extension "${ext}" --extensions-dir "${extensionloc}" --server-data-dir /opt/amazon/sagemaker/sagemaker-code-editor-server-data --user-data-dir /opt/amazon/sagemaker/sagemaker-code-editor-user-data; \ done \ # Copy the settings - && cp /etc/code-editor/code_editor_machine_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/Machine/settings.json + && cp /etc/code-editor/code_editor_machine_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/Machine/settings.json \ + && cp /etc/code-editor/code_editor_user_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/User/settings.json # Install glue kernels, and move to shared directory # Also patching base kernel so Studio background code doesn't start session silently diff --git a/template/v1/dirs/etc/code-editor/code_editor_user_settings.json b/template/v1/dirs/etc/code-editor/code_editor_user_settings.json new file mode 100644 index 00000000..ed3ef56a --- /dev/null +++ b/template/v1/dirs/etc/code-editor/code_editor_user_settings.json @@ -0,0 +1,3 @@ +{ + "extensions.autoUpdate": false +} diff --git a/template/v2/Dockerfile b/template/v2/Dockerfile index e628c2e2..7d5306ae 100644 --- a/template/v2/Dockerfile +++ b/template/v2/Dockerfile @@ -96,6 +96,7 @@ RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \ done \ # Copy the settings && cp /etc/code-editor/code_editor_machine_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/Machine/settings.json && \ + && cp /etc/code-editor/code_editor_user_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/User/settings.json && \ # Install glue kernels, and move to shared directory # Also patching base kernel so Studio background code doesn't start session silently install-glue-kernels && \ diff --git a/template/v2/dirs/etc/code-editor/code_editor_user_settings.json b/template/v2/dirs/etc/code-editor/code_editor_user_settings.json new file mode 100644 index 00000000..ed3ef56a --- /dev/null +++ b/template/v2/dirs/etc/code-editor/code_editor_user_settings.json @@ -0,0 +1,3 @@ +{ + "extensions.autoUpdate": false +} diff --git a/test/test_artifacts/v1/scripts/run_sagemaker_code_editor_tests.sh b/test/test_artifacts/v1/scripts/run_sagemaker_code_editor_tests.sh index 0b7dda58..430fe3a6 100644 --- a/test/test_artifacts/v1/scripts/run_sagemaker_code_editor_tests.sh +++ b/test/test_artifacts/v1/scripts/run_sagemaker_code_editor_tests.sh @@ -51,14 +51,23 @@ for extension in "${installed_extensions[@]}"; do done echo "Verified that all extension folders are present in $extensions_base_dir." -# Check that settings file is copied +# Check that machine settings file is copied MACHINE_SETTINGS_FILE_PATH="/opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/Machine/settings.json" if [ ! -f "$MACHINE_SETTINGS_FILE_PATH" ]; then echo "Error: Settings file does not exist at $MACHINE_SETTINGS_FILE_PATH." exit 1 fi -echo "Settings file exists at $FILE_PATH." +echo "Machine Settings file exists at $MACHINE_SETTINGS_FILE_PATH." + +# Check that user settings file is copied +USER_SETTINGS_FILE_PATH="/opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/User/settings.json" +if [ ! -f "$USER_SETTINGS_FILE_PATH" ]; then + echo "Error: Settings file does not exist at $USER_SETTINGS_FILE_PATH." + exit 1 +fi + +echo "User Settings file exists at $USER_SETTINGS_FILE_PATH." # Check that code-editor artifacts folder is deleted ARTIFACTS_DIR="/etc/code-editor" diff --git a/test/test_artifacts/v2/scripts/run_sagemaker_code_editor_tests.sh b/test/test_artifacts/v2/scripts/run_sagemaker_code_editor_tests.sh index 0b7dda58..430fe3a6 100644 --- a/test/test_artifacts/v2/scripts/run_sagemaker_code_editor_tests.sh +++ b/test/test_artifacts/v2/scripts/run_sagemaker_code_editor_tests.sh @@ -51,14 +51,23 @@ for extension in "${installed_extensions[@]}"; do done echo "Verified that all extension folders are present in $extensions_base_dir." -# Check that settings file is copied +# Check that machine settings file is copied MACHINE_SETTINGS_FILE_PATH="/opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/Machine/settings.json" if [ ! -f "$MACHINE_SETTINGS_FILE_PATH" ]; then echo "Error: Settings file does not exist at $MACHINE_SETTINGS_FILE_PATH." exit 1 fi -echo "Settings file exists at $FILE_PATH." +echo "Machine Settings file exists at $MACHINE_SETTINGS_FILE_PATH." + +# Check that user settings file is copied +USER_SETTINGS_FILE_PATH="/opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/User/settings.json" +if [ ! -f "$USER_SETTINGS_FILE_PATH" ]; then + echo "Error: Settings file does not exist at $USER_SETTINGS_FILE_PATH." + exit 1 +fi + +echo "User Settings file exists at $USER_SETTINGS_FILE_PATH." # Check that code-editor artifacts folder is deleted ARTIFACTS_DIR="/etc/code-editor"