From dd1c19c777b246fa02586351de8379e4b7dac16f Mon Sep 17 00:00:00 2001 From: Justin Brown Date: Tue, 5 Sep 2023 16:51:58 +0000 Subject: [PATCH] chore: generate build artifacts for 0.5.0 release --- build_artifacts/v0/v0.5/v0.5.0/Dockerfile | 64 +++++++++++++++++++ build_artifacts/v0/v0.5/v0.5.0/cpu.env.in | 20 ++++++ .../v0/v0.5/v0.5.0/gpu.arg_based_env.in | 1 + build_artifacts/v0/v0.5/v0.5.0/gpu.env.in | 20 ++++++ 4 files changed, 105 insertions(+) create mode 100644 build_artifacts/v0/v0.5/v0.5.0/Dockerfile create mode 100644 build_artifacts/v0/v0.5/v0.5.0/cpu.env.in create mode 100644 build_artifacts/v0/v0.5/v0.5.0/gpu.arg_based_env.in create mode 100644 build_artifacts/v0/v0.5/v0.5.0/gpu.env.in diff --git a/build_artifacts/v0/v0.5/v0.5.0/Dockerfile b/build_artifacts/v0/v0.5/v0.5.0/Dockerfile new file mode 100644 index 00000000..eb27cf58 --- /dev/null +++ b/build_artifacts/v0/v0.5/v0.5.0/Dockerfile @@ -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 diff --git a/build_artifacts/v0/v0.5/v0.5.0/cpu.env.in b/build_artifacts/v0/v0.5/v0.5.0/cpu.env.in new file mode 100644 index 00000000..208a8599 --- /dev/null +++ b/build_artifacts/v0/v0.5/v0.5.0/cpu.env.in @@ -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'] diff --git a/build_artifacts/v0/v0.5/v0.5.0/gpu.arg_based_env.in b/build_artifacts/v0/v0.5/v0.5.0/gpu.arg_based_env.in new file mode 100644 index 00000000..51cba0a9 --- /dev/null +++ b/build_artifacts/v0/v0.5/v0.5.0/gpu.arg_based_env.in @@ -0,0 +1 @@ +conda-forge::cudatoolkit=$CUDA_MAJOR_MINOR_VERSION diff --git a/build_artifacts/v0/v0.5/v0.5.0/gpu.env.in b/build_artifacts/v0/v0.5/v0.5.0/gpu.env.in new file mode 100644 index 00000000..5d749730 --- /dev/null +++ b/build_artifacts/v0/v0.5/v0.5.0/gpu.env.in @@ -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']