Skip to content

Commit 01cfdc7

Browse files
laurenyuYYStreetsaravsak
authored
change: install SageMaker Python SDK into Python 3 images (#170)
Co-authored-by: Zhuo Weng <[email protected]> Co-authored-by: Saravana Kumar <[email protected]>
1 parent d9b277c commit 01cfdc7

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

docker/1.4.0/py3/Dockerfile.cpu

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ARG OPEN_MPI_VERSION=4.0.1
88

99
# Python won’t try to write .pyc or .pyo files on the import of source modules
1010
# Force stdin, stdout and stderr to be totally unbuffered. Good for logging
11-
ENV PYTHONDONTWRITEBYTECODE=1
12-
ENV PYTHONUNBUFFERED=1
13-
ENV PYTHONIOENCODING=UTF-8
14-
ENV LANG=C.UTF-8
15-
ENV LC_ALL=C.UTF-8
16-
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
17-
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/conda/lib"
18-
ENV PATH=/opt/conda/bin:$PATH
19-
ENV SAGEMAKER_TRAINING_MODULE=sagemaker_pytorch_container.training:main
20-
ENV DGLBACKEND=pytorch
11+
ENV PYTHONDONTWRITEBYTECODE=1
12+
ENV PYTHONUNBUFFERED=1
13+
ENV PYTHONIOENCODING=UTF-8
14+
ENV LANG=C.UTF-8
15+
ENV LC_ALL=C.UTF-8
16+
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
17+
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/conda/lib"
18+
ENV PATH=/opt/conda/bin:$PATH
19+
ENV SAGEMAKER_TRAINING_MODULE=sagemaker_pytorch_container.training:main
20+
ENV DGLBACKEND=pytorch
2121

2222
WORKDIR /
2323

@@ -52,8 +52,8 @@ RUN wget https://www.open-mpi.org/software/ompi/v4.0/downloads/openmpi-$OPEN_MPI
5252
# The ENV variables declared below are changed in the previous section
5353
# Grouping these ENV variables in the first section causes
5454
# ompi_info to fail. This is only observed in CPU containers
55-
ENV PATH="$PATH:/home/.openmpi/bin"
56-
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/.openmpi/lib/"
55+
ENV PATH="$PATH:/home/.openmpi/bin"
56+
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/.openmpi/lib/"
5757
RUN ompi_info --parsable --all | grep mpi_built_with_cuda_support:value
5858

5959
# Copy workaround script for incorrect hostname
@@ -84,7 +84,7 @@ RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-la
8484
requests==2.22.0 \
8585
&& conda install -c dglteam -y dgl==0.4.1 \
8686
&& /opt/conda/bin/conda clean -ya \
87-
&& conda clean -ya
87+
&& conda clean -ya
8888

8989
# The following section uninstalls torch and torchvision before installing the
9090
# custom versions from an S3 bucket. This will need to be removed in the future
@@ -95,6 +95,7 @@ RUN pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pytho
9595
fastai==1.0.59 \
9696
scipy==1.2.2 \
9797
smdebug==0.5.0.post0 \
98+
sagemaker==1.50.17 \
9899
sagemaker-experiments==0.1.3 \
99100
/sagemaker_pytorch_training.tar.gz \
100101
&& pip install --no-cache-dir -U https://pytorch-aws.s3.amazonaws.com/pytorch-1.4.0/py3/cpu/torch-1.4.0-cp36-cp36m-manylinux1_x86_64.whl \

docker/1.4.0/py3/Dockerfile.gpu

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ ARG CUBLAS_VERSION=10.2.1.243-1_amd64
99

1010
# Python won’t try to write .pyc or .pyo files on the import of source modules
1111
# Force stdin, stdout and stderr to be totally unbuffered. Good for logging
12-
ENV PYTHONDONTWRITEBYTECODE=1
13-
ENV PYTHONUNBUFFERED=1
14-
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
15-
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/conda/lib"
16-
ENV PYTHONIOENCODING=UTF-8
17-
ENV LANG=C.UTF-8
12+
ENV PYTHONDONTWRITEBYTECODE=1
13+
ENV PYTHONUNBUFFERED=1
14+
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
15+
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/conda/lib"
16+
ENV PYTHONIOENCODING=UTF-8
17+
ENV LANG=C.UTF-8
1818
ENV LC_ALL=C.UTF-8
1919
ENV PATH /opt/conda/bin:$PATH
2020
ENV TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1 7.0+PTX"
@@ -119,6 +119,7 @@ RUN /opt/conda/bin/conda config --set ssl_verify False \
119119
# custom versions from an S3 bucket. This will need to be removed in the future
120120
RUN pip install \
121121
--no-cache-dir smdebug==0.5.0.post0 \
122+
sagemaker==1.50.17 \
122123
sagemaker-experiments==0.1.3 \
123124
--no-cache-dir fastai==1.0.59 \
124125
awscli \

0 commit comments

Comments
 (0)