Skip to content

Commit

Permalink
chore: generate build artifacts for 0.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
just4brown committed Sep 5, 2023
1 parent 41e88bb commit dd1c19c
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
64 changes: 64 additions & 0 deletions build_artifacts/v0/v0.5/v0.5.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
ARG TAG_FOR_BASE_MICROMAMBA_IMAGE
FROM mambaorg/micromamba:$TAG_FOR_BASE_MICROMAMBA_IMAGE

ARG CUDA_MAJOR_MINOR_VERSION=''
ARG ENV_IN_FILENAME
ARG ARG_BASED_ENV_IN_FILENAME

ARG NB_USER="sagemaker-user"
ARG NB_UID=1000
ARG NB_GID=100

USER root
RUN usermod "--login=${NB_USER}" "--home=/home/${NB_USER}" --move-home "-u ${NB_UID}" "${MAMBA_USER}" && \
groupmod "--new-name=${NB_USER}" --non-unique "-g ${NB_GID}" "${MAMBA_USER}" && \
# Update the expected value of MAMBA_USER for the
# _entrypoint.sh consistency check.
echo "${NB_USER}" > "/etc/arg_mamba_user" && \
:
ENV MAMBA_USER=$NB_USER

RUN apt-get update && \
apt-get install -y --no-install-recommends sudo gettext-base wget curl unzip git && \
# We just install tzdata below but leave default time zone as UTC. This helps packages like Pandas to function correctly.
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata awscli && \
chmod g+w /etc/passwd && \
echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
# Note that we do NOT run `rm -rf /var/lib/apt/lists/*` here. If we did, anyone building on top of our images will
# not be able to run any `apt-get install` commands and that would hamper customizability of the images.
:
RUN echo "source /usr/local/bin/_activate_current_env.sh" | tee --append /etc/profile

USER $MAMBA_USER
COPY --chown=$MAMBA_USER:$MAMBA_USER *.in /tmp/

# Make sure that $ENV_IN_FILENAME has a newline at the end before the `tee` command runs. Otherwise, nasty things
# will happen.
RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \
then echo 'No ARG_BASED_ENV_IN_FILENAME passed' ; \
else envsubst < /tmp/$ARG_BASED_ENV_IN_FILENAME | tee --append /tmp/$ENV_IN_FILENAME ; \
fi

ARG CONDA_OVERRIDE_CUDA=$CUDA_MAJOR_MINOR_VERSION
RUN micromamba install -y --name base --file /tmp/$ENV_IN_FILENAME && \
micromamba clean --all --yes --force-pkgs-dirs && \
rm -rf /tmp/*.in

ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN sudo ln -s $(which python3) /usr/bin/python

USER root
RUN HOME_DIR="/home/${NB_USER}/licenses" \
&& mkdir -p ${HOME_DIR} \
&& curl -o ${HOME_DIR}/oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \
&& unzip ${HOME_DIR}/oss_compliance.zip -d ${HOME_DIR}/ \
&& cp ${HOME_DIR}/oss_compliance/test/testOSSCompliance /usr/local/bin/testOSSCompliance \
&& chmod +x /usr/local/bin/testOSSCompliance \
&& chmod +x ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh \
&& ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh ${HOME_DIR} python \
&& rm -rf ${HOME_DIR}/oss_compliance*

USER $MAMBA_USER
ENV PATH="/opt/conda/bin:/opt/conda/condabin:$PATH"
WORKDIR "/home/${NB_USER}"
ENV SHELL=/bin/bash
20 changes: 20 additions & 0 deletions build_artifacts/v0/v0.5/v0.5.0/cpu.env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is auto-generated.
conda-forge::pytorch[version='>=2.0.0,<3.0.0']
conda-forge::tensorflow[version='>=2.12.1,<3.0.0']
conda-forge::python[version='>=3.8.17,<3.9.0']
conda-forge::pip[version='>=23.2.1,<24.0.0']
conda-forge::torchvision[version='>=0.15.2,<1.0.0']
conda-forge::numpy[version='>=1.24.4,<2.0.0']
conda-forge::pandas[version='>=2.0.3,<3.0.0']
conda-forge::scikit-learn[version='>=1.3.0,<2.0.0']
conda-forge::jinja2[version='>=3.1.2,<4.0.0']
conda-forge::matplotlib[version='>=3.7.2,<4.0.0']
conda-forge::ipython[version='>=8.12.2,<9.0.0']
conda-forge::scipy[version='>=1.10.1,<2.0.0']
conda-forge::keras[version='>=2.12.0,<3.0.0']
conda-forge::py-xgboost-cpu[version='>=1.7.6,<2.0.0']
conda-forge::jupyterlab[version='>=3.6.5,<4.0.0']
conda-forge::ipywidgets[version='>=8.1.0,<9.0.0']
conda-forge::conda[version='>=23.7.3,<24.0.0']
conda-forge::boto3[version='>=1.28.35,<2.0.0']
conda-forge::sagemaker-python-sdk[version='>=2.173.0,<3.0.0']
1 change: 1 addition & 0 deletions build_artifacts/v0/v0.5/v0.5.0/gpu.arg_based_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
conda-forge::cudatoolkit=$CUDA_MAJOR_MINOR_VERSION
20 changes: 20 additions & 0 deletions build_artifacts/v0/v0.5/v0.5.0/gpu.env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is auto-generated.
conda-forge::pytorch-gpu[version='>=2.0.0,<3.0.0']
conda-forge::tensorflow[version='>=2.12.1,<3.0.0']
conda-forge::python[version='>=3.8.17,<3.9.0']
conda-forge::pip[version='>=23.2.1,<24.0.0']
conda-forge::torchvision[version='>=0.15.2,<1.0.0']
conda-forge::numpy[version='>=1.24.4,<2.0.0']
conda-forge::pandas[version='>=2.0.3,<3.0.0']
conda-forge::scikit-learn[version='>=1.3.0,<2.0.0']
conda-forge::jinja2[version='>=3.1.2,<4.0.0']
conda-forge::matplotlib[version='>=3.7.2,<4.0.0']
conda-forge::ipython[version='>=8.12.2,<9.0.0']
conda-forge::scipy[version='>=1.10.1,<2.0.0']
conda-forge::keras[version='>=2.12.0,<3.0.0']
conda-forge::py-xgboost-gpu[version='>=1.7.6,<2.0.0']
conda-forge::jupyterlab[version='>=3.6.5,<4.0.0']
conda-forge::ipywidgets[version='>=8.1.0,<9.0.0']
conda-forge::conda[version='>=23.7.3,<24.0.0']
conda-forge::boto3[version='>=1.28.35,<2.0.0']
conda-forge::sagemaker-python-sdk[version='>=2.173.0,<3.0.0']

0 comments on commit dd1c19c

Please sign in to comment.