-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathdockerfile
More file actions
57 lines (48 loc) · 2.34 KB
/
dockerfile
File metadata and controls
57 lines (48 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM ghcr.io/nvidia/mirrors/rapidsai-devcontainers-25.10-cpp-cuda12.9
ENV ACH_TUTORIAL=cuda-cpp \
ACH_NSYS_PATH=/usr/local/cuda-12.9/bin/nsys \
ACH_NCU_PATH=/usr/local/cuda-12.9/bin/ncu \
PATH=/accelerated-computing-hub/brev/wrappers:${PATH} \
PIP_ROOT_USER_ACTION=ignore \
CUPY_CACHE_DIR=/tmp/cupy_cache \
MPLCONFIGDIR=/tmp/matplotlib_cache
# Copy only requirements.txt first for better Docker layer caching.
COPY tutorials/${ACH_TUTORIAL}/brev/requirements.txt /opt/requirements.txt
RUN set -ex \
&& `# Install Python packages` \
&& pip install --no-cache-dir --root-user-action=ignore -r /opt/requirements.txt \
&& rm -f /opt/requirements.txt \
&& `# Install system packages` \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends ffmpeg git-lfs gosu sudo \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Disable unnecessary default Jupyter extensions.
RUN python -m jupyter labextension disable "@jupyterlab/apputils-extension:announcements" \
&& python -m jupyter labextension disable "@jupyterlab/console-extension:tracker"
# Enable passwordless sudo for all users and pass through environment and path
RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& sed -i -e 's/^Defaults\s*env_reset/Defaults !env_reset/' -e 's/^Defaults\s*secure_path=/#&/' /etc/sudoers
# Install Docker
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --chmod=0777 . /accelerated-computing-hub
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
ENTRYPOINT ["/accelerated-computing-hub/brev/entrypoint.bash", "jupyter"]