Skip to content

Commit b2802e8

Browse files
Release 2.0.0-beta (#219)
2 parents 8fe28c6 + 17ad561 commit b2802e8

File tree

61 files changed

+2744
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2744
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build New Image Version
2+
on:
3+
# Manually call
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
required: true
8+
type: choice
9+
description: Type of release
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
base-version:
15+
required: true
16+
description: Base version=
17+
# Call from other workflow
18+
workflow_call:
19+
inputs:
20+
release-type:
21+
type: string
22+
required: true
23+
base-version:
24+
type: string
25+
required: true
26+
defaults:
27+
run:
28+
shell: bash -l {0}
29+
jobs:
30+
open-pr:
31+
name: Open Pull Request
32+
runs-on: ubuntu-latest
33+
if: github.repository == 'aws/sagemaker-distribution'
34+
permissions:
35+
pull-requests: write
36+
contents: write
37+
outputs:
38+
pr_id: ${{ steps.get_pr_id.outputs.pr_id }}
39+
target_version: ${{ steps.calc_target.outputs.target_version }}
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: mamba-org/setup-micromamba@v1
43+
with:
44+
environment-file: ./environment.yml
45+
environment-name: sagemaker-distribution
46+
init-shell: bash
47+
- name: Free up disk space
48+
run: rm -rf /opt/hostedtoolcache
49+
- name: Activate sagemaker-distribution
50+
run: micromamba activate sagemaker-distribution
51+
- name: Calculate target version
52+
id: calc_target
53+
run: |
54+
TARGET_VERSION=$(python -c 'import semver; print(semver.bump_${{ inputs.release-type }}("${{ inputs.base-version }}"))')
55+
echo "target_version=$TARGET_VERSION" >> $GITHUB_OUTPUT
56+
- name: Create new branch
57+
# Note - CodeBuild depends on this branch name. Don't change without corresponding backend change.
58+
run: git checkout -b 2.0.0-beta
59+
- name: Generate artifacts
60+
run: python ./src/main.py create-${{ inputs.release-type }}-version-artifacts --base-patch-version ${{ inputs.base-version }}
61+
- name: Commit .in artifacts to branch
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
run: |
65+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
66+
git config --local user.name "github-actions[bot]"
67+
git add ./build_artifacts
68+
git commit -m 'chore: Generate build artifacts for ${{ steps.calc_target.outputs.target_version }} release'
69+
git push --set-upstream origin 2.0.0-beta
70+
- name: Open pull request
71+
id: get_pr_id
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
# Note - CodeBuild depends on this PR title. Don't change without corresponding backend change.
75+
run: |
76+
URL=$(gh pr create -H 2.0.0-beta \
77+
--title 'release: v${{ steps.calc_target.outputs.target_version }}' -F ./.github/workflows/PR_TEMPLATE.md)
78+
PR=$(echo $URL | sed 's:.*/::')
79+
echo "pr_id=$PR" >> $GITHUB_OUTPUT
80+
call-codebuild-project:
81+
runs-on: ubuntu-latest
82+
needs: open-pr
83+
permissions:
84+
pull-requests: write
85+
contents: write
86+
id-token: write
87+
steps:
88+
- name: Configure AWS Credentials
89+
uses: aws-actions/configure-aws-credentials@v4
90+
with:
91+
role-to-assume: arn:aws:iam::700843992353:role/codebuild-start-build-role
92+
aws-region: us-west-2
93+
# CodeBuild timeout of 8 hours
94+
role-duration-seconds: 3840
95+
- name: Run CodeBuild
96+
uses: dark-mechanicum/aws-codebuild@v1
97+
env:
98+
CODEBUILD__sourceVersion: 'pr/${{ needs.open-pr.outputs.pr_id }}'
99+
with:
100+
projectName: 'buildtestpublicimage1C7307A-9AzES2hf19lW'
101+
buildspec: '{"imageOverride": "aws/codebuild/standard:7.0"}'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Generate nightly patch release(s)
2+
#on:
3+
# # Run every night at 5:15PM PST
4+
# # Run before monthly, so we don't immediately patch a new minor version
5+
# schedule:
6+
# - cron: '0 15 17 ? * *'
7+
jobs:
8+
generate-version-matrix:
9+
name: Generate-matrix
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'aws/sagemaker-distribution'
12+
outputs:
13+
matrix: ${{ steps.gen-mat.outputs.matrix }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Generate patch version matrix
17+
id: gen-mat
18+
# Output looks like :matrix={"version":["0.0.2","0.1.2",..."1.4.1"]}
19+
# For each minor, get highest patch version. Use each patch
20+
# as base version. Use this patch as base version.
21+
run: |
22+
versions=("{\"version\":[")
23+
for minor in build_artifacts/v2/*; do
24+
minor_version="${minor##*/}"
25+
highest_patch=$(ls $minor | sort -t. -k3,3n | tail -n1)
26+
versions+="\"${highest_patch#v}\""
27+
versions+=","
28+
done
29+
versions=${versions::-1}
30+
versions+="]}"
31+
echo "matrix=$versions" >> $GITHUB_OUTPUT
32+
33+
start-nightly-patch:
34+
name: Start nightly patch release
35+
needs: generate-version-matrix
36+
permissions:
37+
pull-requests: write
38+
contents: write
39+
id-token: write
40+
strategy:
41+
matrix: ${{ fromJson(needs.generate-version-matrix.outputs.matrix) }}
42+
fail-fast: false
43+
uses: aws/sagemaker-distribution/.github/workflows/nightly-build-image.yml@main
44+
with:
45+
release-type: "patch"
46+
base-version: ${{ matrix.version }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Change log: 2.0.0-beta(cpu)
2+
3+
## Upgrades:
4+
5+
Package | Previous Version | Current Version
6+
---|---|---
7+
boto3|1.28.64|1.34.51
8+
ipython|8.21.0|8.22.2
9+
scipy|1.11.4|1.12.0
10+
fastapi|0.103.2|0.110.0
11+
pip|23.3.2|24.0
12+
autogluon|0.8.2|1.0.0
13+
conda|23.11.0|24.1.2
14+
langchain|0.1.9|0.1.10
15+
jupyter-ai|2.9.1|2.10.0
16+
jupyterlab-lsp|5.0.3|5.1.0
17+
keras|2.12.0|2.15.0
18+
nodejs|18.18.2|18.18.2
19+
sagemaker-python-sdk|2.198.1|2.210.0
20+
tensorflow|2.12.1|2.15.0
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Change log: 2.0.0-beta(gpu)
2+
3+
## Upgrades:
4+
5+
Package | Previous Version | Current Version
6+
---|---|---
7+
boto3|1.28.64|1.34.51
8+
ipython|8.21.0|8.22.2
9+
scipy|1.11.4|1.12.0
10+
fastapi|0.103.2|0.110.0
11+
pip|23.3.2|24.0
12+
autogluon|0.8.2|1.0.0
13+
conda|23.11.0|24.1.2
14+
langchain|0.1.9|0.1.10
15+
jupyter-ai|2.9.1|2.10.0
16+
jupyterlab-lsp|5.0.3|5.1.0
17+
keras|2.12.0|2.15.0
18+
nodejs|18.18.2|18.18.2
19+
sagemaker-python-sdk|2.198.1|2.210.0
20+
tensorflow|2.12.1|2.15.0
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
8+
ARG AMZN_BASE="/opt/amazon/sagemaker"
9+
ARG DIRECTORY_TREE_STAGE_DIR="${AMZN_BASE}/dir-staging"
10+
11+
ARG NB_USER="sagemaker-user"
12+
ARG NB_UID=1000
13+
ARG NB_GID=100
14+
15+
ENV SAGEMAKER_LOGGING_DIR="/var/log/sagemaker/"
16+
ENV STUDIO_LOGGING_DIR="/var/log/studio/"
17+
18+
USER root
19+
RUN usermod "--login=${NB_USER}" "--home=/home/${NB_USER}" --move-home "-u ${NB_UID}" "${MAMBA_USER}" && \
20+
groupmod "--new-name=${NB_USER}" --non-unique "-g ${NB_GID}" "${MAMBA_USER}" && \
21+
# Update the expected value of MAMBA_USER for the
22+
# _entrypoint.sh consistency check.
23+
echo "${NB_USER}" > "/etc/arg_mamba_user" && \
24+
:
25+
ENV MAMBA_USER=$NB_USER
26+
ENV USER=$NB_USER
27+
28+
RUN apt-get update && \
29+
apt-get install -y --no-install-recommends sudo gettext-base wget curl unzip git rsync build-essential openssh-client nano && \
30+
# We just install tzdata below but leave default time zone as UTC. This helps packages like Pandas to function correctly.
31+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata krb5-user libkrb5-dev libsasl2-dev libsasl2-modules && \
32+
chmod g+w /etc/passwd && \
33+
echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
34+
touch /etc/krb5.conf.lock && chown ${NB_USER}:${MAMBA_USER} /etc/krb5.conf* && \
35+
# Note that we do NOT run `rm -rf /var/lib/apt/lists/*` here. If we did, anyone building on top of our images will
36+
# not be able to run any `apt-get install` commands and that would hamper customizability of the images.
37+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
38+
unzip awscliv2.zip && \
39+
sudo ./aws/install && \
40+
rm -rf aws awscliv2.zip && \
41+
:
42+
RUN echo "source /usr/local/bin/_activate_current_env.sh" | tee --append /etc/profile
43+
44+
USER $MAMBA_USER
45+
COPY --chown=$MAMBA_USER:$MAMBA_USER $ENV_IN_FILENAME *.in /tmp/
46+
47+
# Make sure that $ENV_IN_FILENAME has a newline at the end before the `tee` command runs. Otherwise, nasty things
48+
# will happen.
49+
RUN if [[ -z $ARG_BASED_ENV_IN_FILENAME ]] ; \
50+
then echo 'No ARG_BASED_ENV_IN_FILENAME passed' ; \
51+
else envsubst < /tmp/$ARG_BASED_ENV_IN_FILENAME | tee --append /tmp/$ENV_IN_FILENAME ; \
52+
fi
53+
54+
ARG CONDA_OVERRIDE_CUDA=$CUDA_MAJOR_MINOR_VERSION
55+
RUN micromamba install -y --name base --file /tmp/$ENV_IN_FILENAME && \
56+
micromamba clean --all --yes --force-pkgs-dirs && \
57+
rm -rf /tmp/*.in
58+
59+
60+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
61+
RUN sudo ln -s $(which python3) /usr/bin/python
62+
63+
# Install glue kernels, and move to shared directory
64+
# Also patching base kernel so Studio background code doesn't start session silently
65+
RUN install-glue-kernels && \
66+
SITE_PACKAGES=$(pip show aws-glue-sessions | grep Location | awk '{print $2}') && \
67+
jupyter-kernelspec install $SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_pyspark --user && \
68+
jupyter-kernelspec install $SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_spark --user && \
69+
mv /home/sagemaker-user/.local/share/jupyter/kernels/glue_pyspark /opt/conda/share/jupyter/kernels && \
70+
mv /home/sagemaker-user/.local/share/jupyter/kernels/glue_spark /opt/conda/share/jupyter/kernels && \
71+
sed -i '/if not store_history and (/i\ if "sm_analytics_runtime_check" in code:\n return await self._complete_cell()\n' \
72+
"$SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_kernel_base/BaseKernel.py"
73+
74+
75+
# Patch glue kernels to use kernel wrapper
76+
COPY patch_glue_pyspark.json /opt/conda/share/jupyter/kernels/glue_pyspark/kernel.json
77+
COPY patch_glue_spark.json /opt/conda/share/jupyter/kernels/glue_spark/kernel.json
78+
79+
USER root
80+
RUN HOME_DIR="/home/${NB_USER}/licenses" \
81+
&& mkdir -p ${HOME_DIR} \
82+
&& curl -o ${HOME_DIR}/oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \
83+
&& unzip ${HOME_DIR}/oss_compliance.zip -d ${HOME_DIR}/ \
84+
&& cp ${HOME_DIR}/oss_compliance/test/testOSSCompliance /usr/local/bin/testOSSCompliance \
85+
&& chmod +x /usr/local/bin/testOSSCompliance \
86+
&& chmod +x ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh \
87+
&& ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh ${HOME_DIR} python \
88+
&& rm -rf ${HOME_DIR}/oss_compliance*
89+
90+
# Merge in OS directory tree contents.
91+
RUN mkdir -p ${DIRECTORY_TREE_STAGE_DIR}
92+
COPY dirs/ ${DIRECTORY_TREE_STAGE_DIR}/
93+
RUN rsync -a ${DIRECTORY_TREE_STAGE_DIR}/ / && \
94+
rm -rf ${DIRECTORY_TREE_STAGE_DIR}
95+
96+
# Create logging directories for supervisor
97+
RUN mkdir -p $SAGEMAKER_LOGGING_DIR && \
98+
chmod a+rw $SAGEMAKER_LOGGING_DIR && \
99+
mkdir -p ${STUDIO_LOGGING_DIR} && \
100+
chown ${NB_USER}:${MAMBA_USER} ${STUDIO_LOGGING_DIR}
101+
102+
# Create supervisord runtime directory
103+
RUN mkdir -p /var/run/supervisord && \
104+
chmod a+rw /var/run/supervisord
105+
106+
USER $MAMBA_USER
107+
ENV PATH="/opt/conda/bin:/opt/conda/condabin:$PATH"
108+
WORKDIR "/home/${NB_USER}"
109+
110+
# Install Kerberos.
111+
# Make sure no dependency is added/updated
112+
RUN pip install "krb5>=0.5.1,<0.6" && \
113+
pip show krb5 | grep Require | xargs -i sh -c '[ $(echo {} | cut -d: -f2 | wc -w) -eq 0 ] '
114+
115+
# https://stackoverflow.com/questions/122327
116+
RUN SYSTEM_PYTHON_PATH=$(python3 -c "from __future__ import print_function;import sysconfig; print(sysconfig.get_paths().get('purelib'))") && \
117+
# Remove SparkRKernel as it's not supported \
118+
jupyter-kernelspec remove -f -y sparkrkernel && \
119+
# Patch Sparkmagic lib to support Custom Certificates \
120+
# https://github.com/jupyter-incubator/sparkmagic/pull/435/files \
121+
cp -a ${SYSTEM_PYTHON_PATH}/sagemaker_studio_analytics_extension/patches/configuration.py ${SYSTEM_PYTHON_PATH}/sparkmagic/utils/ && \
122+
cp -a ${SYSTEM_PYTHON_PATH}/sagemaker_studio_analytics_extension/patches/reliablehttpclient.py ${SYSTEM_PYTHON_PATH}/sparkmagic/livyclientlib/reliablehttpclient.py && \
123+
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 && \
124+
sed -i 's="Spark"="SparkMagic Spark"=g' /opt/conda/share/jupyter/kernels/sparkkernel/kernel.json && \
125+
sed -i 's="PySpark"="SparkMagic PySpark"=g' /opt/conda/share/jupyter/kernels/pysparkkernel/kernel.json
126+
127+
ENV SHELL=/bin/bash
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Release notes: 2.0.0-beta
2+
3+
Package | gpu| cpu
4+
---|---|---
5+
python|3.10.13|3.10.13
6+
numpy|1.26.4|1.26.4
7+
jinja2|3.1.3|3.1.3
8+
pandas|2.1.4|2.1.4
9+
altair|5.2.0|5.2.0
10+
boto3|1.34.51|1.34.51
11+
ipython|8.22.2|8.22.2
12+
jupyter-lsp|2.2.3|2.2.3
13+
jupyterlab|4.1.2|4.1.2
14+
amazon-codewhisperer-jupyterlab-ext|2.0.1|2.0.1
15+
jupyter-scheduler|2.5.1|2.5.1
16+
amazon-sagemaker-jupyter-scheduler|3.0.7|3.0.7
17+
scipy|1.12.0|1.12.0
18+
scikit-learn|1.4.1.post1|1.4.1.post1
19+
fastapi|0.110.0|0.110.0
20+
uvicorn|0.27.1|0.27.1
21+
pip|24.0|24.0
22+
torchvision|0.15.2|0.15.2
23+
autogluon|1.0.0|1.0.0
24+
ipywidgets|8.1.2|8.1.2
25+
notebook|7.1.1|7.1.1
26+
aws-glue-sessions|1.0.4|1.0.4
27+
conda|24.1.2|24.1.2
28+
langchain|0.1.10|0.1.10
29+
jupyter-ai|2.10.0|2.10.0
30+
jupyter-dash|0.4.2|0.4.2
31+
jupyter-server-proxy|4.1.0|4.1.0
32+
jupyterlab-git|0.50.0|0.50.0
33+
jupyterlab-lsp|5.1.0|5.1.0
34+
keras|2.15.0|2.15.0
35+
matplotlib|3.8.3|3.8.3
36+
nodejs|18.18.2|18.18.2
37+
py-xgboost-gpu|1.7.6|
38+
thrift_sasl|0.4.3|0.4.3
39+
pyhive|0.7.0|0.7.0
40+
python-gssapi|1.8.3|1.8.3
41+
python-lsp-server|1.10.0|1.10.0
42+
pytorch-gpu|2.0.0|
43+
sagemaker-headless-execution-driver|0.0.12|0.0.12
44+
sagemaker-jupyterlab-emr-extension|0.1.9|0.1.9
45+
sagemaker-jupyterlab-extension|0.2.0|0.2.0
46+
sagemaker-kernel-wrapper|0.0.2|0.0.2
47+
sagemaker-python-sdk|2.210.0|2.210.0
48+
sagemaker-studio-analytics-extension|0.0.21|0.0.21
49+
sasl|0.3.1|0.3.1
50+
supervisor|4.2.5|4.2.5
51+
tensorflow|2.15.0|2.15.0
52+
pytorch| |2.0.0
53+
py-xgboost-cpu| |1.7.6

0 commit comments

Comments
 (0)