-
Notifications
You must be signed in to change notification settings - Fork 82
feat: add recovery mode setup #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
f440b0f
12a621c
dab9154
4107613
7b88633
9e9b5ac
46c270e
7c1e694
504816c
0a115e0
d58235b
6489fa9
97d2f43
602fd3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ ENV STUDIO_LOGGING_DIR="/var/log/studio/" | |
ENV EDITOR="nano" | ||
ENV IMAGE_VERSION=$IMAGE_VERSION | ||
ENV PINNED_MICROMAMBA_MINOR_VERSION="1.5.*" | ||
ENV RECOVERY_MODE_HOME=/tmp/recovery-mode-home | ||
|
||
USER root | ||
# Upgrade micromamba to the latest patch version in the pinned minor version range, if applicable | ||
|
@@ -91,6 +92,11 @@ RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \ | |
fi && \ | ||
# Enforce dependencies are all installed from conda-forge | ||
micromamba install -y --name base --file /tmp/$ENV_IN_FILENAME && \ | ||
JUPYTERLAB_VERSION=$(grep "^conda-forge::jupyterlab" /tmp/$ENV_IN_FILENAME) && \ | ||
SAGEMAKER_EXTENSION_VERSION=$(grep "^conda-forge::sagemaker-jupyterlab-extension" /tmp/$ENV_IN_FILENAME) && \ | ||
echo "Installing in recovery-mode micromamba environment: $JUPYTERLAB_SPEC $SAGEMAKER_EXTENSION_SPEC" && \ | ||
micromamba create -n recovery-mode -y &&\ | ||
micromamba install -n recovery-mode -y $JUPYTERLAB_VERSION $SAGEMAKER_EXTENSION_VERSION && \ | ||
micromamba clean --all --yes --force-pkgs-dirs && \ | ||
rm -rf /tmp/*.in && \ | ||
sudo ln -s $(which python3) /usr/bin/python && \ | ||
|
@@ -159,7 +165,12 @@ RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \ | |
sed -i 's="Spark"="SparkMagic Spark"=g' /opt/conda/share/jupyter/kernels/sparkkernel/kernel.json && \ | ||
sed -i 's="PySpark"="SparkMagic PySpark"=g' /opt/conda/share/jupyter/kernels/pysparkkernel/kernel.json && \ | ||
# Configure RTC - disable jupyter_collaboration by default | ||
jupyter labextension disable @jupyter/collaboration-extension | ||
jupyter labextension disable @jupyter/collaboration-extension && \ | ||
# Setup the Recovery Mode home directory and micromamba environment | ||
mkdir -p $RECOVERY_MODE_HOME && \ | ||
chown $MAMBA_USER:$MAMBA_USER $RECOVERY_MODE_HOME && \ | ||
micromamba create -n recovery-mode && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you verified image size changes with these lines? I'm concerning if setting up a separate python venv will significantly increase the image size There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think image size will be reduced even more in the latest commit, since I move the install part before micromamba clean statement so that some file will be cleaned after that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, can you verify the latest size increase with your latest DockerFile once? |
||
micromamba install -n recovery-mode jupyterlab sagemaker-jupyterlab-extension -y | ||
aws-tianquaw marked this conversation as resolved.
Show resolved
Hide resolved
ChaonengQuan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Patch glue kernels to use kernel wrapper | ||
COPY patch_glue_pyspark.json /opt/conda/share/jupyter/kernels/glue_pyspark/kernel.json | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG SAGEMAKER_DISTRIBUTION_IMAGE | ||
FROM $SAGEMAKER_DISTRIBUTION_IMAGE | ||
|
||
ARG MAMBA_DOCKERFILE_ACTIVATE=1 | ||
|
||
ENV RECOVERY_MODE=true | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint-jupyter-server"] |
Uh oh!
There was an error while loading. Please reload this page.