Skip to content

Commit

Permalink
add turing-distribution template
Browse files Browse the repository at this point in the history
  • Loading branch information
mats16 committed Mar 6, 2024
1 parent 1b98f14 commit 5920cfc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
26 changes: 26 additions & 0 deletions turing-distribution/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG TAG_FOR_BASE_SAGEMAKER_IMAGE=1.5.2-cpu
FROM --platform=linux/amd64 public.ecr.aws/sagemaker/sagemaker-distribution:$TAG_FOR_BASE_SAGEMAKER_IMAGE

ARG DEBIAN_FRONTEND=noninteractive

# Install docker-cli
COPY docker-cli-install.sh ./
RUN ./docker-cli-install.sh

# for OpenCV
RUN sudo apt-get update && \
sudo apt-get install -y libopencv-dev && \
sudo rm -rf /var/lib/apt/lists/*

# Install poetry to base python
RUN conda run -n base python -m pip install poetry==1.8.2

# Add kernel - Python 3.11
RUN conda create --yes -n py311 python=3.11.8 ipykernel pytorch torchvision -c pytorch && \
conda run -n py311 python -m pip install poetry==1.8.2 && \
conda run -n py311 python -m ipykernel install --prefix /opt/conda --name "python3.11" --display-name "Python 3.11 (Anaconda)"

# Add kernel - Python 3.12
RUN conda create --yes -n py312 python=3.12.2 ipykernel pytorch torchvision -c pytorch && \
conda run -n py311 python -m pip install poetry==1.8.2 && \
conda run -n py312 python -m ipykernel install --prefix /opt/conda --name "python3.12" --display-name "Python 3.12 (Anaconda)"
19 changes: 19 additions & 0 deletions turing-distribution/docker-cli-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# https://github.com/aws-samples/amazon-sagemaker-local-mode/blob/main/sagemaker_studio_docker_cli_install/sagemaker-distribution-docker-cli-install.sh

sudo apt-get -y install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get -y update

# pick the latest patch from:
# apt-cache madison docker-ce | awk '{ print $3 }' | grep -i 20.10
VERSION_STRING=5:20.10.24~3-0~ubuntu-jammy
sudo apt-get install docker-ce-cli=$VERSION_STRING docker-compose-plugin -y

0 comments on commit 5920cfc

Please sign in to comment.