Skip to content

Commit bf61438

Browse files
chore: Generate build artifacts for 2.4.0 release
1 parent 61e0068 commit bf61438

22 files changed

+663
-0
lines changed
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
ARG TAG_FOR_BASE_MICROMAMBA_IMAGE
2+
FROM mambaorg/micromamba:$TAG_FOR_BASE_MICROMAMBA_IMAGE
3+
4+
ARG CUDA_MAJOR_MINOR_VERSION=''
5+
ARG ENV_IN_FILENAME
6+
ARG ARG_BASED_ENV_IN_FILENAME
7+
ARG IMAGE_VERSION
8+
LABEL "org.amazon.sagemaker-distribution.image.version"=$IMAGE_VERSION
9+
10+
ARG AMZN_BASE="/opt/amazon/sagemaker"
11+
ARG DB_ROOT_DIR="/opt/db"
12+
ARG DIRECTORY_TREE_STAGE_DIR="${AMZN_BASE}/dir-staging"
13+
14+
ARG NB_USER="sagemaker-user"
15+
ARG NB_UID=1000
16+
ARG NB_GID=100
17+
18+
# https://www.openssl.org/source/
19+
ARG FIPS_VALIDATED_SSL=3.0.8
20+
ARG MIN_REQUIRED_MICROMAMBA_VERSION=1.5.11
21+
22+
ENV SAGEMAKER_LOGGING_DIR="/var/log/sagemaker/"
23+
ENV STUDIO_LOGGING_DIR="/var/log/studio/"
24+
ENV EDITOR="nano"
25+
ENV IMAGE_VERSION=$IMAGE_VERSION
26+
ENV PINNED_MICROMAMBA_MINOR_VERSION="1.5.*"
27+
ENV SAGEMAKER_RECOVERY_MODE_HOME=/tmp/sagemaker-recovery-mode-home
28+
29+
USER root
30+
# Upgrade micromamba to the latest patch version in the pinned minor version range, if applicable
31+
RUN CURRENT_MICROMAMBA_VERSION=$(micromamba --version) && \
32+
echo "Current micromamba version: $CURRENT_MICROMAMBA_VERSION" && \
33+
if [[ "$CURRENT_MICROMAMBA_VERSION" == $PINNED_MICROMAMBA_MINOR_VERSION ]]; then \
34+
echo "Upgrading micromamba to the latest $PINNED_MICROMAMBA_MINOR_VERSION version..." && \
35+
micromamba self-update -c conda-forge --version "$MIN_REQUIRED_MICROMAMBA_VERSION" && \
36+
micromamba clean --all --yes --force-pkgs-dirs; \
37+
else \
38+
echo "Micromamba is already at version $CURRENT_MICROMAMBA_VERSION (outside $PINNED_MICROMAMBA_MINOR_VERSION). No upgrade performed."; \
39+
fi
40+
41+
RUN usermod "--login=${NB_USER}" "--home=/home/${NB_USER}" --move-home "-u ${NB_UID}" "${MAMBA_USER}" && \
42+
groupmod "--new-name=${NB_USER}" --non-unique "-g ${NB_GID}" "${MAMBA_USER}" && \
43+
# Update the expected value of MAMBA_USER for the
44+
# _entrypoint.sh consistency check.
45+
echo "${NB_USER}" > "/etc/arg_mamba_user" && \
46+
:
47+
ENV MAMBA_USER=$NB_USER
48+
ENV USER=$NB_USER
49+
50+
RUN apt-get update && apt-get upgrade -y && \
51+
apt-get install -y --no-install-recommends sudo gettext-base wget curl unzip git rsync build-essential openssh-client nano cron less mandoc && \
52+
# We just install tzdata below but leave default time zone as UTC. This helps packages like Pandas to function correctly.
53+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata krb5-user libkrb5-dev libsasl2-dev libsasl2-modules && \
54+
chmod g+w /etc/passwd && \
55+
echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
56+
touch /etc/krb5.conf.lock && chown ${NB_USER}:${MAMBA_USER} /etc/krb5.conf* && \
57+
# Note that we do NOT run `rm -rf /var/lib/apt/lists/*` here. If we did, anyone building on top of our images will
58+
# not be able to run any `apt-get install` commands and that would hamper customizability of the images.
59+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
60+
unzip awscliv2.zip && \
61+
sudo ./aws/install && \
62+
rm -rf aws awscliv2.zip && \
63+
: && \
64+
echo "source /usr/local/bin/_activate_current_env.sh" | tee --append /etc/profile && \
65+
# CodeEditor - create server, user data dirs
66+
mkdir -p /opt/amazon/sagemaker/sagemaker-code-editor-server-data /opt/amazon/sagemaker/sagemaker-code-editor-user-data \
67+
&& chown $MAMBA_USER:$MAMBA_USER /opt/amazon/sagemaker/sagemaker-code-editor-server-data /opt/amazon/sagemaker/sagemaker-code-editor-user-data && \
68+
# create dir to store user data files
69+
mkdir -p /opt/amazon/sagemaker/user-data \
70+
&& chown $MAMBA_USER:$MAMBA_USER /opt/amazon/sagemaker/user-data && \
71+
# Merge in OS directory tree contents.
72+
mkdir -p ${DIRECTORY_TREE_STAGE_DIR}
73+
COPY dirs/ ${DIRECTORY_TREE_STAGE_DIR}/
74+
RUN rsync -a ${DIRECTORY_TREE_STAGE_DIR}/ / && \
75+
rm -rf ${DIRECTORY_TREE_STAGE_DIR} && \
76+
# CodeEditor - download the extensions
77+
mkdir -p /etc/code-editor/extensions && \
78+
while IFS= read -r url || [ -n "$url" ]; do \
79+
echo "Downloading extension from ${url}..." && \
80+
wget --no-check-certificate -P /etc/code-editor/extensions "${url}"; \
81+
done < /etc/code-editor/extensions.txt
82+
83+
USER $MAMBA_USER
84+
COPY --chown=$MAMBA_USER:$MAMBA_USER $ENV_IN_FILENAME *.in /tmp/
85+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
86+
ARG CONDA_OVERRIDE_CUDA=$CUDA_MAJOR_MINOR_VERSION
87+
88+
# Make sure that $ENV_IN_FILENAME has a newline at the end before the `tee` command runs. Otherwise, nasty things
89+
# will happen.
90+
RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \
91+
then echo 'No ARG_BASED_ENV_IN_FILENAME passed' ; \
92+
else envsubst < /tmp/$ARG_BASED_ENV_IN_FILENAME | tee --append /tmp/$ENV_IN_FILENAME ; \
93+
fi && \
94+
# Enforce dependencies are all installed from conda-forge
95+
micromamba install -y --name base --file /tmp/$ENV_IN_FILENAME && \
96+
mkdir -p $SAGEMAKER_RECOVERY_MODE_HOME && \
97+
chown $MAMBA_USER:$MAMBA_USER $SAGEMAKER_RECOVERY_MODE_HOME && \
98+
SUPERVISOR_VERSION=$(grep "^conda-forge::supervisor\[" /tmp/$ENV_IN_FILENAME) && \
99+
JUPYTERLAB_VERSION=$(grep "^conda-forge::jupyterlab\[" /tmp/$ENV_IN_FILENAME) && \
100+
SAGEMAKER_JUPYTERLAB_VERSION=$(grep "^conda-forge::sagemaker-jupyterlab-extension" /tmp/$ENV_IN_FILENAME) && \
101+
echo "Installing in sagemaker-recovery-mode micromamba environment: $JUPYTERLAB_VERSION $SAGEMAKER_JUPYTERLAB_VERSION" && \
102+
micromamba create -n sagemaker-recovery-mode && \
103+
micromamba install -n sagemaker-recovery-mode -y $JUPYTERLAB_VERSION $SAGEMAKER_JUPYTERLAB_VERSION $SUPERVISOR_VERSION && \
104+
micromamba clean --all --yes --force-pkgs-dirs && \
105+
rm -rf /tmp/*.in && \
106+
sudo ln -s $(which python3) /usr/bin/python && \
107+
# Update npm version
108+
npm i -g npm && \
109+
# Enforce to use `conda-forge` as only channel, by removing `defaults`
110+
conda config --remove channels defaults && \
111+
micromamba config append channels conda-forge --env && \
112+
# Configure CodeEditor - Install extensions and set preferences
113+
extensionloc=/opt/amazon/sagemaker/sagemaker-code-editor-server-data/extensions && mkdir -p "${extensionloc}" \
114+
# Loop through all vsix files in /etc/code-editor/extensions and install them
115+
&& for ext in /etc/code-editor/extensions/*.vsix; do \
116+
echo "Installing extension ${ext}..."; \
117+
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; \
118+
done \
119+
# Copy the settings
120+
&& cp /etc/code-editor/code_editor_machine_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/Machine/settings.json && \
121+
cp /etc/code-editor/code_editor_user_settings.json /opt/amazon/sagemaker/sagemaker-code-editor-server-data/data/User/settings.json && \
122+
# Install glue kernels, and move to shared directory
123+
# Also patching base kernel so Studio background code doesn't start session silently
124+
install-glue-kernels && \
125+
SITE_PACKAGES=$(pip show aws-glue-sessions | grep Location | awk '{print $2}') && \
126+
jupyter-kernelspec install $SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_pyspark --user && \
127+
jupyter-kernelspec install $SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_spark --user && \
128+
mv /home/sagemaker-user/.local/share/jupyter/kernels/glue_pyspark /opt/conda/share/jupyter/kernels && \
129+
mv /home/sagemaker-user/.local/share/jupyter/kernels/glue_spark /opt/conda/share/jupyter/kernels && \
130+
sed -i '/if not store_history and (/i\ if "sm_analytics_runtime_check" in code:\n return await self._complete_cell()\n' \
131+
"$SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_kernel_base/BaseKernel.py" && \
132+
# Install FIPS Provider for OpenSSL, on top of existing OpenSSL installation
133+
# v3.0.8 is latest FIPS validated provider, so this is the one we install
134+
# But we need to run tests against the installed version.
135+
# see https://github.com/openssl/openssl/blob/master/README-FIPS.md https://www.openssl.org/source/
136+
INSTALLED_SSL=$(micromamba list | grep openssl | tr -s ' ' | cut -d ' ' -f 3 | head -n 1) && \
137+
# download source code for installed, and FIPS validated openssl versions
138+
curl -L https://github.com/openssl/openssl/releases/download/openssl-$FIPS_VALIDATED_SSL/openssl-$FIPS_VALIDATED_SSL.tar.gz > openssl-$FIPS_VALIDATED_SSL.tar.gz && \
139+
curl -L https://github.com/openssl/openssl/releases/download/openssl-$INSTALLED_SSL/openssl-$INSTALLED_SSL.tar.gz > openssl-$INSTALLED_SSL.tar.gz && \
140+
tar -xf openssl-$FIPS_VALIDATED_SSL.tar.gz && tar -xf openssl-$INSTALLED_SSL.tar.gz && cd openssl-$FIPS_VALIDATED_SSL && \
141+
# Configure both versions to enable FIPS and build
142+
./Configure enable-fips --prefix=/opt/conda --openssldir=/opt/conda/ssl && make && \
143+
cd ../openssl-$INSTALLED_SSL && \
144+
./Configure enable-fips --prefix=/opt/conda --openssldir=/opt/conda/ssl && make && \
145+
# Copy validated provider to installed version for testing
146+
cp ../openssl-$FIPS_VALIDATED_SSL/providers/fips.so providers/. && \
147+
cp ../openssl-$FIPS_VALIDATED_SSL/providers/fipsmodule.cnf providers/. && \
148+
make tests && cd ../openssl-$FIPS_VALIDATED_SSL && \
149+
# After tests pass, install FIPS provider and remove source code
150+
make install_fips && cd .. && rm -rf ./openssl-* && \
151+
# Create new config file with fips-enabled. Then user can override OPENSSL_CONF to enable FIPS
152+
# e.g. export OPENSSL_CONF=/opt/conda/ssl/openssl-fips.cnf
153+
cp /opt/conda/ssl/openssl.cnf /opt/conda/ssl/openssl-fips.cnf && \
154+
sed -i "s:# .include fipsmodule.cnf:.include /opt/conda/ssl/fipsmodule.cnf:" /opt/conda/ssl/openssl-fips.cnf && \
155+
sed -i 's:# fips = fips_sect:fips = fips_sect:' /opt/conda/ssl/openssl-fips.cnf && \
156+
# Install Kerberos.
157+
# Make sure no dependency is added/updated
158+
pip install "krb5>=0.5.1,<0.6" && \
159+
pip show krb5 | grep Require | xargs -i sh -c '[ $(echo {} | cut -d: -f2 | wc -w) -eq 0 ] ' && \
160+
# https://stackoverflow.com/questions/122327
161+
SYSTEM_PYTHON_PATH=$(python3 -c "from __future__ import print_function;import sysconfig; print(sysconfig.get_paths().get('purelib'))") && \
162+
# Remove SparkRKernel as it's not supported \
163+
jupyter-kernelspec remove -f -y sparkrkernel && \
164+
# Patch Sparkmagic lib to support Custom Certificates \
165+
# https://github.com/jupyter-incubator/sparkmagic/pull/435/files \
166+
cp -a ${SYSTEM_PYTHON_PATH}/sagemaker_studio_analytics_extension/patches/configuration.py ${SYSTEM_PYTHON_PATH}/sparkmagic/utils/ && \
167+
cp -a ${SYSTEM_PYTHON_PATH}/sagemaker_studio_analytics_extension/patches/reliablehttpclient.py ${SYSTEM_PYTHON_PATH}/sparkmagic/livyclientlib/reliablehttpclient.py && \
168+
sed -i 's= "python"= "/opt/conda/bin/python"=g' /opt/conda/share/jupyter/kernels/pysparkkernel/kernel.json /opt/conda/share/jupyter/kernels/sparkkernel/kernel.json && \
169+
sed -i 's="Spark"="SparkMagic Spark"=g' /opt/conda/share/jupyter/kernels/sparkkernel/kernel.json && \
170+
sed -i 's="PySpark"="SparkMagic PySpark"=g' /opt/conda/share/jupyter/kernels/pysparkkernel/kernel.json && \
171+
# Configure RTC - disable jupyter_collaboration by default
172+
jupyter labextension disable @jupyter/collaboration-extension
173+
174+
# Patch glue kernels to use kernel wrapper
175+
COPY patch_glue_pyspark.json /opt/conda/share/jupyter/kernels/glue_pyspark/kernel.json
176+
COPY patch_glue_spark.json /opt/conda/share/jupyter/kernels/glue_spark/kernel.json
177+
178+
USER root
179+
180+
# Create logging directories for supervisor
181+
RUN mkdir -p $SAGEMAKER_LOGGING_DIR && \
182+
chmod a+rw $SAGEMAKER_LOGGING_DIR && \
183+
mkdir -p ${STUDIO_LOGGING_DIR} && \
184+
chown ${NB_USER}:${MAMBA_USER} ${STUDIO_LOGGING_DIR} && \
185+
186+
# Clean up CodeEditor artifacts
187+
rm -rf /etc/code-editor && \
188+
# Create supervisord runtime directory
189+
mkdir -p /var/run/supervisord && \
190+
chmod a+rw /var/run/supervisord && \
191+
# Create root directory for DB
192+
# Create logging directories for supervisor
193+
mkdir -p $DB_ROOT_DIR && \
194+
chmod a+rw $DB_ROOT_DIR && \
195+
HOME_DIR="/home/${NB_USER}/licenses" \
196+
&& mkdir -p ${HOME_DIR} \
197+
&& curl -o ${HOME_DIR}/oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \
198+
&& unzip ${HOME_DIR}/oss_compliance.zip -d ${HOME_DIR}/ \
199+
&& cp ${HOME_DIR}/oss_compliance/test/testOSSCompliance /usr/local/bin/testOSSCompliance \
200+
&& chmod +x /usr/local/bin/testOSSCompliance \
201+
&& chmod +x ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh \
202+
&& ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh ${HOME_DIR} python \
203+
&& rm -rf ${HOME_DIR}/oss_compliance*
204+
205+
# Explicitly disable BuildKit for SM Studio Docker functionality
206+
ENV DOCKER_BUILDKIT=0
207+
ENV PATH="/opt/conda/bin:/opt/conda/condabin:$PATH"
208+
WORKDIR "/home/${NB_USER}"
209+
ENV SHELL=/bin/bash
210+
ENV OPENSSL_MODULES=/opt/conda/lib64/ossl-modules/
211+
USER $MAMBA_USER
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This file is auto-generated.
2+
conda-forge::s3fs[version='>=2024.10.0,<2025.0.0']
3+
conda-forge::seaborn[version='>=0.13.2,<1.0.0']
4+
conda-forge::jupyter-activity-monitor-extension[version='>=0.3.1,<1.0.0']
5+
conda-forge::mlflow[version='>=2.20.0,<3.0.0']
6+
conda-forge::sagemaker-mlflow[version='>=0.1.0,<1.0.0']
7+
conda-forge::langchain-aws[version='>=0.2.10,<1.0.0']
8+
conda-forge::jupyter-collaboration[version='>=2.1.5,<3.0.0']
9+
conda-forge::sagemaker-code-editor[version='>=1.4.2,<2.0.0']
10+
conda-forge::amazon_sagemaker_sql_editor[version='>=0.1.14,<1.0.0']
11+
conda-forge::amazon-sagemaker-sql-magic[version='>=0.1.3,<1.0.0']
12+
conda-forge::amazon-sagemaker-jupyter-ai-q-developer[version='>=1.0.16,<2.0.0']
13+
conda-forge::amazon-q-developer-jupyterlab-ext[version='>=3.4.5,<4.0.0']
14+
conda-forge::langchain[version='>=0.3.15,<1.0.0']
15+
conda-forge::fastapi[version='>=0.115.7,<1.0.0']
16+
conda-forge::uvicorn[version='>=0.34.0,<1.0.0']
17+
conda-forge::pytorch[version='>=2.4.1,<3.0.0']
18+
conda-forge::tensorflow[version='>=2.17.0,<3.0.0']
19+
conda-forge::python[version='>=3.11.11,<3.12.0']
20+
conda-forge::pip[version='>=24.3.1,<25.0.0']
21+
conda-forge::torchvision[version='>=0.19.1,<1.0.0']
22+
conda-forge::numpy[version='>=1.26.4,<2.0.0']
23+
conda-forge::pandas[version='>=2.2.3,<3.0.0']
24+
conda-forge::scikit-learn[version='>=1.5.2,<2.0.0']
25+
conda-forge::jinja2[version='>=3.1.5,<4.0.0']
26+
conda-forge::matplotlib-base[version='>=3.10.0,<4.0.0']
27+
conda-forge::sagemaker-headless-execution-driver[version='>=0.0.13,<1.0.0']
28+
conda-forge::ipython[version='>=8.31.0,<9.0.0']
29+
conda-forge::scipy[version='>=1.15.1,<2.0.0']
30+
conda-forge::keras[version='>=3.8.0,<4.0.0']
31+
conda-forge::py-xgboost-cpu[version='>=2.1.3,<3.0.0']
32+
conda-forge::jupyterlab[version='>=4.2.6,<5.0.0']
33+
conda-forge::ipywidgets[version='>=8.1.5,<9.0.0']
34+
conda-forge::conda[version='>=24.11.3,<25.0.0']
35+
conda-forge::boto3[version='>=1.36.3,<2.0.0']
36+
conda-forge::sagemaker-python-sdk[version='>=2.228.0,<3.0.0']
37+
conda-forge::supervisor[version='>=4.2.5,<5.0.0']
38+
conda-forge::autogluon[version='>=1.2.0,<2.0.0']
39+
conda-forge::aws-glue-sessions[version='>=1.0.8,<2.0.0']
40+
conda-forge::sagemaker-kernel-wrapper[version='>=0.0.4,<1.0.0']
41+
conda-forge::jupyter-ai[version='>=2.29.0,<3.0.0']
42+
conda-forge::jupyter-scheduler[version='>=2.10.0,<3.0.0']
43+
conda-forge::jupyter-lsp[version='>=2.2.5,<3.0.0']
44+
conda-forge::jupyterlab-lsp[version='>=5.0.3,<6.0.0']
45+
conda-forge::python-lsp-server[version='>=1.12.0,<2.0.0']
46+
conda-forge::notebook[version='>=7.2.2,<8.0.0']
47+
conda-forge::altair[version='>=5.5.0,<6.0.0']
48+
conda-forge::sagemaker-studio-analytics-extension[version='>=0.1.4,<1.0.0']
49+
conda-forge::jupyter-dash[version='>=0.4.2,<1.0.0']
50+
conda-forge::sagemaker-jupyterlab-extension[version='>=0.3.3,<1.0.0']
51+
conda-forge::sagemaker-jupyterlab-emr-extension[version='>=0.3.7,<1.0.0']
52+
conda-forge::amazon-sagemaker-jupyter-scheduler[version='>=3.1.8,<4.0.0']
53+
conda-forge::jupyter-server-proxy[version='>=4.4.0,<5.0.0']
54+
conda-forge::jupyterlab-git[version='>=0.50.2,<1.0.0']
55+
conda-forge::pyhive[version='>=0.7.0,<1.0.0']
56+
conda-forge::python-gssapi[version='>=1.9.0,<2.0.0']
57+
conda-forge::tf-keras[version='>=2.17.0,<3.0.0']
58+
conda-forge::git-remote-codecommit[version='>=1.16,<2.0.0']
59+
conda-forge::sentencepiece[version='>=0.1.99,<1.0.0']
60+
conda-forge::docker-cli[version='>=27.5.1,<28.0.0']
61+
conda-forge::libmamba[version='>=1.5.12,<2.0.0']
62+
conda-forge::dash[version='>=2.18.1,<3.0.0']
63+
conda-forge::evaluate[version='>=0.4.1,<1.0.0']
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"python.terminal.activateEnvironment": false,
3+
"python.defaultInterpreterPath": "/opt/conda/bin/python"
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extensions.autoUpdate": false
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
https://open-vsx.org/api/ms-toolsai/jupyter/2023.9.100/file/ms-toolsai.jupyter-2023.9.100.vsix
2+
https://open-vsx.org/api/ms-python/python/2023.20.0/file/ms-python.python-2023.20.0.vsix
3+
https://open-vsx.org/api/amazonwebservices/aws-toolkit-vscode/3.30.0/file/amazonwebservices.aws-toolkit-vscode-3.30.0.vsix
4+
https://open-vsx.org/api/amazonwebservices/amazon-q-vscode/1.32.0/file/amazonwebservices.amazon-q-vscode-1.32.0.vsix
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
envs_dirs:
2+
- ~/.conda/envs
3+
- /opt/conda/envs
4+
pkgs_dirs:
5+
- ~/.conda/pkgs
6+
- /opt/conda/pkgs
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Default Jupyter server config
2+
# Note: those config can be overridden by user-level configs.
3+
4+
c.ServerApp.terminado_settings = {"shell_command": ["/bin/bash"]}
5+
c.ServerApp.tornado_settings = {"compress_response": True}
6+
7+
# Do not delete files to trash. Instead, permanently delete files.
8+
c.FileContentsManager.delete_to_trash = False
9+
10+
# Allow deleting non-empty directory via file browser. Related documentation:
11+
# https://github.com/jupyter-server/jupyter_server/blob/main/jupyter_server/services/contents/filemanager.py#L125-L129
12+
c.FileContentsManager.always_delete_dir = True
13+
14+
# Enable `allow_hidden` by default, so hidden files are accessible via Jupyter server
15+
# Related documentation: https://jupyterlab.readthedocs.io/en/stable/user/files.html#displaying-hidden-files
16+
c.ContentsManager.allow_hidden = True
17+
18+
# This will set the LanguageServerManager.extra_node_roots setting if amazon_sagemaker_sql_editor exists in the
19+
# environment. Ignore otherwise, don't fail the JL server start
20+
# Related documentation: https://jupyterlab-lsp.readthedocs.io/en/v3.4.0/Configuring.html
21+
try:
22+
import os
23+
24+
module = __import__("amazon_sagemaker_sql_editor")
25+
module_location = os.path.dirname(module.__file__)
26+
c.LanguageServerManager.extra_node_roots = [f"{module_location}/sql-language-server"]
27+
except:
28+
pass
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[include]
2+
files = supervisord-common.conf
3+
4+
[program:codeeditorserver]
5+
directory=%(ENV_HOME)s
6+
command=start-code-editor
7+
autostart=true
8+
autorestart=true
9+
stdout_logfile=/dev/fd/1 ; Redirect web server logs to stdout
10+
stderr_logfile=/dev/fd/1
11+
stdout_logfile_maxbytes = 0 ; Fix: https://github.com/Supervisor/supervisor/issues/935
12+
stderr_logfile_maxbytes = 0 ; Fix: https://github.com/Supervisor/supervisor/issues/935
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
pidfile=/var/run/supervisord/supervisord.pid
5+
logfile=%(ENV_STUDIO_LOGGING_DIR)s/%(ENV_SAGEMAKER_APP_TYPE_LOWERCASE)s/supervisord/supervisord.log
6+
logfile_maxbytes=5MB
7+
logfile_backups=10
8+
redirect_stderr=true
9+
10+
[unix_http_server]
11+
file=/var/run/supervisord/supervisor.sock
12+
chmod=0700
13+
14+
[supervisorctl]
15+
serverurl=unix:///var/run/supervisord/supervisor.sock
16+
17+
[rpcinterface:supervisor]
18+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[include]
2+
files = supervisord-common.conf
3+
4+
[program:jupyterlabserver]
5+
directory=%(ENV_HOME)s
6+
command=start-jupyter-server
7+
stopasgroup=true
8+
stdout_logfile=/dev/stdout
9+
stdout_logfile_maxbytes=0
10+
stderr_logfile=/dev/stderr
11+
stderr_logfile_maxbytes=0

0 commit comments

Comments
 (0)