Skip to content

Instantly share code, notes, and snippets.

@cloudbow
Created April 22, 2020 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudbow/4e39907e0814032cb4537afba6678599 to your computer and use it in GitHub Desktop.
Save cloudbow/4e39907e0814032cb4537afba6678599 to your computer and use it in GitHub Desktop.
kubeflow_mlflow_jupyter_s3_version_control_kale_all_in_one
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
USER root
ARG MLFLOW_PORT
ARG AWS_REGION
ARG DATA_SCIENCE_GROUP
ARG CLUSTER_NAME
ENV MLFLOW_PORT="${MLFLOW_PORT}"
ENV AWS_REGION="${AWS_REGION}"
ENV DATA_SCIENCE_GROUP="${DATA_SCIENCE_GROUP}"
ENV CLUSTER_NAME="${CLUSTER_NAME}"
ENV NB_PREFIX /
# Install jq
ENV JQ_VERSION='1.5'
RUN wget --no-check-certificate https://raw.githubusercontent.com/stedolan/jq/master/sig/jq-release.key -O /tmp/jq-release.key && \
wget --no-check-certificate https://raw.githubusercontent.com/stedolan/jq/master/sig/v${JQ_VERSION}/jq-linux64.asc -O /tmp/jq-linux64.asc && \
wget --no-check-certificate https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 -O /tmp/jq-linux64 && \
gpg --import /tmp/jq-release.key && \
gpg --verify /tmp/jq-linux64.asc /tmp/jq-linux64 && \
cp /tmp/jq-linux64 /usr/bin/jq && \
chmod +x /usr/bin/jq && \
rm -f /tmp/jq-release.key && \
rm -f /tmp/jq-linux64.asc && \
rm -f /tmp/jq-linux64
# Install extension and enable
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager --minimize=False && \
pip3 install ipywidgets
RUN jupyter serverextension enable --py jupyterlab
# Install git extension on jupyterlab
RUN jupyter labextension install @jupyterlab/git --minimize=False && \
pip3 install --upgrade jupyterlab-git && \
jupyter serverextension enable --py jupyterlab_git --py nbdime
# Install jupytext
RUN pip3 install jupytext==1.3.0
RUN jupyter lab build --minimize=False
RUN jupyter lab --generate-config
# Install s3 browser and cell tags
RUN pip3 install jupyterlab-s3-browser
RUN jupyter labextension install jupyterlab-s3-browser --minimize=False && \
jupyter serverextension enable --py jupyterlab_s3_browser
RUN jupyter labextension install @jupyterlab/celltags@0.2.0 --minimize=False
# Expose port & cmd
EXPOSE 8888
COPY requirements.txt /tmp
RUN pip3 install --ignore-installed -r /tmp/requirements.txt
COPY ./scripts/start.sh /scripts/start.sh
COPY ./scripts/bootstrap.sh /scripts/bootstrap.sh
COPY ./scripts/profile_init.py /scripts/profile_init.py
COPY ./scripts/extmlflow.py /scripts/extmlflow.py
ENTRYPOINT ["sh", "/scripts/start.sh"]
# CMD jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --notebook-dir=/home/jovyan --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_origin='*' --NotebookApp.base_url=${NB_PREFIX} --allow-root
--- requirements
# Dev/Development
boto3
mlflow
git-remote-codecommit
--- start.sh
bash /scripts/bootstrap.sh
. /root/.bashrc
echo "$WORKING_DIR"
cd ${WORKING_DIR} && \
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_origin='*' --NotebookApp.base_url=${NB_PREFIX} --allow-root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment