Skip to content

Commit bbe4750

Browse files
authored
Merge pull request #100 from runpod/dj/containers-v1
feat: containers v1
2 parents e75f960 + 1d174c8 commit bbe4750

File tree

16 files changed

+202
-513
lines changed

16 files changed

+202
-513
lines changed

.github/actions/docker-setup/action.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ outputs:
1313
value: ${{ steps.build-type.outputs.is_production }}
1414
release-suffix:
1515
description: 'Release suffix for non-production builds'
16-
value: ${{ steps.env-vars.outputs.release }}
16+
value: ${{ steps.env-vars.outputs.release_suffix }}
1717

1818
runs:
1919
using: 'composite'
@@ -32,10 +32,8 @@ runs:
3232
username: ${{ inputs.dockerhub-username }}
3333
password: ${{ inputs.dockerhub-token }}
3434

35-
- name: Set up Docker Buildx
36-
uses: useblacksmith/[email protected]
37-
with:
38-
setup-only: true
35+
- name: Set up Docker Build
36+
uses: useblacksmith/setup-docker-builder@v1
3937

4038
- name: Set up QEMU
4139
uses: docker/setup-qemu-action@v3
@@ -52,10 +50,10 @@ runs:
5250
5351
- name: Set Environment Variables
5452
id: env-vars
53+
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dj/containers-v1'
5554
shell: bash
5655
run: |
57-
if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
58-
BRANCH_NAME=$(echo ${GITHUB_REF##refs/heads/} | sed 's/\//-/g')
59-
echo "RELEASE=dev-${BRANCH_NAME}" >> $GITHUB_ENV
60-
echo "release=dev-${BRANCH_NAME}" >> $GITHUB_OUTPUT
61-
fi
56+
BRANCH_NAME=$(echo ${GITHUB_REF##refs/heads/} | sed 's/\//-/g')
57+
SUFFIX="-dev-${BRANCH_NAME}"
58+
echo "RELEASE=${SUFFIX}" >> $GITHUB_ENV
59+
echo "release_suffix=${SUFFIX}" >> $GITHUB_OUTPUT

.github/workflows/base.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ jobs:
3535
uses: docker/bake-action@v6
3636
env:
3737
BUILDX_BAKE_ENTITLEMENTS_FS: 0
38+
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
3839
with:
3940
source: .
4041
files: |
4142
official-templates/shared/versions.hcl
4243
official-templates/base/docker-bake.hcl
4344
push: true
44-
set: |
45-
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}
4645

4746
build-pytorch:
4847
needs: build-base
@@ -77,11 +76,10 @@ jobs:
7776
uses: docker/bake-action@v6
7877
env:
7978
BUILDX_BAKE_ENTITLEMENTS_FS: 0
79+
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
8080
with:
8181
source: .
8282
files: |
8383
official-templates/shared/versions.hcl
8484
official-templates/pytorch/docker-bake.hcl
8585
push: true
86-
set: |
87-
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}

.github/workflows/rocm.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
paths:
66
- ".github/workflows/rocm.yml"
77
- "official-templates/rocm/**"
8-
- "official-templates/shared/**"
9-
- "official-templates/base/Dockerfile"
108
workflow_dispatch:
119

1210
permissions:
@@ -33,11 +31,10 @@ jobs:
3331
uses: docker/bake-action@v6
3432
env:
3533
BUILDX_BAKE_ENTITLEMENTS_FS: 0
34+
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
3635
with:
3736
source: .
3837
files: |
3938
official-templates/shared/versions.hcl
4039
official-templates/rocm/docker-bake.hcl
4140
push: true
42-
set: |
43-
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ This repository contains the Dockerfiles for the Runpod containers used for our
88

99
The following dependencies are required for all images for Runpod platform functionality.
1010

11-
- `nginx` - Required for proxying ports to the user.
12-
- `openssh-server` - Required for SSH access to the container.
13-
- `jupyterlab` - Required for JupyterLab access to the container.
11+
- `nginx`: Required for proxying ports to the user.
12+
- `openssh-server`: Required for SSH access to the container.
13+
- `jupyterlab`: Required for JupyterLab access to the container.
1414

1515
### README
1616

17-
Every container folder has its own README.md file, this file is displayed on the Docker Hub and the README section of the template on the Runpod website. Additionally, if the container opens a port other than 8888 that is passed through the proxy and the service is not running yet, the README will be displayed to the user to guide them.
17+
Every container folder has its own README.md file, displayed on Docker Hub and in the template section on the Runpod website. When containers open ports other than 8888 through the proxy, the README guides users while services are starting up.
1818

1919
## Building Containers
2020

21-
This repository is powered by Docker Buildx and uses [bake files](https://docs.docker.com/build/bake/) to manage builds.
21+
This repository uses Docker Buildx with [bake files](https://docs.docker.com/build/bake/) to manage builds.
2222

2323
### Using the Bake Script
2424

25-
`./bake.sh` automatically combines shared version definitions with template-specific bake files.
25+
`./bake.sh` automatically combines shared version definitions with template specific bake files.
2626

2727
Use it like this:
2828

@@ -39,4 +39,4 @@ Use it like this:
3939

4040
### Version Definitions
4141

42-
Version compatibility and build targets for CUDA, Ubuntu, and PyTorch is centralized in `official-templates/shared/versions.hcl`. This file is automatically included when building with the `bake.sh` script. When adding new versions or changing compatibility, modify this file.
42+
Version compatibility and build targets for CUDA, Ubuntu, and PyTorch are centralized in `official-templates/shared/versions.hcl`. This file is automatically included when building with the `bake.sh` script. When adding new versions or changing compatibility, modify this file.

container-template/start.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -e # Exit the script if any statement returns a non-true return value
2+
set -e # Exit the script if any statement returns a non-true return value
33

44
# ---------------------------------------------------------------------------- #
55
# Function Definitions #
@@ -29,7 +29,7 @@ setup_ssh() {
2929
echo "$PUBLIC_KEY" >> ~/.ssh/authorized_keys
3030
chmod 700 -R ~/.ssh
3131

32-
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
32+
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
3333
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -q -N ''
3434
echo "RSA key fingerprint:"
3535
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub
@@ -66,17 +66,19 @@ setup_ssh() {
6666
# Export env vars
6767
export_env_vars() {
6868
echo "Exporting environment variables..."
69-
printenv | grep -E '^RUNPOD_|^PATH=|^_=' | awk -F = '{ print "export " $1 "=\"" $2 "\"" }' >> /etc/rp_environment
70-
echo 'source /etc/rp_environment' >> ~/.bashrc
69+
printenv | grep -E '^[A-Z_][A-Z0-9_]*=' | grep -v '^PUBLIC_KEY' | awk -F = '{ val = $0; sub(/^[^=]*=/, "", val); print "export " $1 "=\"" val "\"" }' > /etc/rp_environment
70+
if ! grep -q 'source /etc/rp_environment' ~/.bashrc; then
71+
echo 'source /etc/rp_environment' >> ~/.bashrc
72+
fi
7173
}
7274

7375
# Start jupyter lab
7476
start_jupyter() {
7577
if [[ $JUPYTER_PASSWORD ]]; then
7678
echo "Starting Jupyter Lab..."
77-
mkdir -p /workspace && \
78-
cd / && \
79-
nohup python3.10 -m jupyter lab --allow-root --no-browser --port=8888 --ip=* --FileContentsManager.delete_to_trash=False --ServerApp.terminado_settings='{"shell_command":["/bin/bash"]}' --ServerApp.token=$JUPYTER_PASSWORD --ServerApp.allow_origin=* --ServerApp.preferred_dir=/workspace &> /jupyter.log &
79+
mkdir -p /workspace &&
80+
cd / &&
81+
nohup python3 -m jupyter lab --allow-root --no-browser --port=8888 --ip=* --FileContentsManager.delete_to_trash=False --ServerApp.terminado_settings='{"shell_command":["/bin/bash"]}' --IdentityProvider.token=$JUPYTER_PASSWORD --ServerApp.allow_origin=* --ServerApp.preferred_dir=/workspace &> /jupyter.log &
8082
echo "Jupyter Lab started"
8183
fi
8284
}
@@ -95,8 +97,6 @@ setup_ssh
9597
start_jupyter
9698
export_env_vars
9799

98-
execute_script "/post_start.sh" "Running post-start script..."
99-
100100
echo "Start script(s) finished, Pod is ready to use."
101101

102102
sleep infinity

official-templates/base/Dockerfile

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,19 @@ ENV TZ=Etc/UTC
3131

3232
WORKDIR /
3333

34-
# Update and upgrade
35-
RUN apt-get update --yes && \
36-
apt-get upgrade --yes
37-
3834
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
3935

4036
# Install
41-
RUN apt-get install --yes --no-install-recommends \
42-
ca-certificates curl dirmngr file git gpg gpg-agent inotify-tools \
43-
jq lsof nano nginx openssh-server rsync software-properties-common \
44-
sudo tmux unzip vim wget zip build-essential make cmake gfortran ffmpeg \
45-
libatlas-base-dev libavcodec-dev libavfilter-dev libavformat-dev libblas-dev \
46-
libffi-dev libhdf5-dev libgl1 libjpeg-dev liblapack-dev libpng-dev \
47-
libpostproc-dev libsm6 libssl-dev libswscale-dev libtiff-dev \
48-
libv4l-dev libx264-dev libxrender-dev libxvidcore-dev \
49-
cifs-utils nfs-common zstd
37+
RUN apt-get update --yes && \
38+
apt-get upgrade --yes && \
39+
apt-get install --yes --no-install-recommends \
40+
build-essential ca-certificates cifs-utils cmake curl dirmngr dnsutils ffmpeg \
41+
file gfortran git gpg gpg-agent inetutils-traceroute inotify-tools iputils-ping jq \
42+
libatlas-base-dev libavcodec-dev libavfilter-dev libavformat-dev libblas-dev libffi-dev \
43+
libgl1 libhdf5-dev libjpeg-dev liblapack-dev libnuma-dev libpng-dev libpostproc-dev \
44+
libsm6 libssl-dev libswscale-dev libtiff-dev libv4l-dev libx264-dev libxrender-dev \
45+
libxvidcore-dev lsof make mtr nano nfs-common nginx openssh-server rsync slurm-wlm \
46+
software-properties-common sudo tmux unzip vim wget zip zstd
5047

5148
# Add the Python PPA
5249
RUN add-apt-repository ppa:deadsnakes/ppa -y
@@ -57,13 +54,13 @@ RUN apt-get install --yes --no-install-recommends \
5754
python3.10-dev python3.10-venv python3.10-distutils \
5855
python3.11-dev python3.11-venv python3.11-distutils \
5956
python3.12-dev python3.12-venv \
60-
python3.13-dev python3.13-venv python-is-python3 && \
57+
python3.13-dev python3.13-venv && \
6158
apt-get autoremove -y && \
6259
apt-get clean && \
6360
rm -rf /var/lib/apt/lists/*
6461

6562
# Install pip if we are not ROCm
66-
RUN if [ -z "${ROCM_PATH}"]; then \
63+
RUN if [ -z "${ROCM_PATH}" ]; then \
6764
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
6865
python3.9 get-pip.py && \
6966
python3.10 get-pip.py && \
@@ -74,28 +71,27 @@ RUN if [ -z "${ROCM_PATH}"]; then \
7471
fi
7572

7673
# ensurepip (it's there, we just installed it^) and install virtualenv
77-
RUN if [ -z "${ROCM_PATH}"]; then \
74+
RUN if [ -z "${ROCM_PATH}" ]; then \
7875
python3.9 -m pip install --upgrade pip virtualenv && \
7976
python3.10 -m pip install --upgrade pip virtualenv && \
8077
python3.11 -m pip install --upgrade pip virtualenv && \
8178
python3.12 -m pip install --upgrade pip virtualenv && \
8279
python3.13 -m pip install --upgrade pip virtualenv; \
8380
fi
8481

85-
# Install Jupyter and related packages (always with Python 3.10)
86-
RUN python3.10 -m pip install --upgrade --no-cache-dir \
82+
RUN ln -sf /usr/bin/python3.12 /usr/local/bin/python
83+
RUN ln -sf /usr/local/bin/pip3.12 /usr/local/bin/pip
84+
RUN ln -sf /usr/local/bin/pip3.12 /usr/local/bin/pip3
85+
86+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
87+
88+
# Install Jupyter and related packages
89+
RUN python -m pip install --upgrade --no-cache-dir \
8790
jupyterlab \
8891
ipywidgets \
8992
jupyter-archive \
9093
notebook==7.4.2
9194

92-
# Install pip drop-in replacement uv (https://github.com/astral-sh/uv)
93-
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
94-
echo 'export PATH="$HOME/.local/bin:$PATH"' >> /etc/profile.d/uv.sh && \
95-
chmod +x /etc/profile.d/uv.sh && \
96-
export PATH="$HOME/.local/bin:$PATH" && \
97-
uv --version
98-
9995
# Install filebrowser
10096
RUN curl -LsSf https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
10197

@@ -110,9 +106,8 @@ RUN rm -f /etc/ssh/ssh_host_*
110106
# Copy the README.md
111107
COPY README.md /usr/share/nginx/html/README.md
112108

113-
# Start Scripts
109+
# Start Script
114110
COPY --from=scripts --chmod=755 start.sh /
115-
COPY --chmod=755 post_start.sh /
116111

117112
# Welcome Message
118113
COPY --from=logo runpod.txt /etc/runpod.txt

official-templates/base/README.md

Lines changed: 28 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,42 @@
1-
<h1>Runpod Base</h1>
1+
### Runpod Base
22

3-
**Essential foundation for machine learning workflows.**
3+
**A lean, flexible starting point for machine learning workflows.**
44

5-
Runpod Base images are designed to be lightweight but flexible—supporting a wide range of user workloads without overwhelming choice when building your own images. Whether you're prototyping a new ML model, setting up a development environment, or deploying a production workload, these images provide the essential foundation you need to get started fast.
5+
The Runpod Base images provide a clean, developer friendly environment for everything from quick experiments to production, supporting both GPU and CPU-only workloads. Use them standalone for a preconfigured workspace, or as the foundation for your own images.
66

7-
**What makes these essential:**
8-
- **Ready-to-use Jupyter Environment** — Both Notebook and JupyterLab with widgets and extensions (optional - can be disabled by not setting `JUPYTER_PASSWORD`)
9-
- **Multiple Python Versions** — Python 3.9 through 3.13 installed and ready to use, with 3.10 as the default
10-
- **Smart Workspace Setup** — Pre-configured directory structure with optimized cache locations for faster package installs
11-
- **Developer Tools** — SSH access for remote development and NGINX server for web services
12-
- **ML-Ready Libraries** — Core dependencies for scientific computing, image processing, and machine learning workflows
7+
### What's included
8+
- **Multiple Python versions**: 3.9–3.13 preinstalled; 3.10 is the default.
9+
- **ML ready**: Essential libraries for scientific computing, computer vision, and machine learning, plus SLURM support.
10+
- **Developer friendly**: SSH server preconfigured for seamless remote development and debugging.
11+
- **Smart workspace**: Optimized directory structure and package caches for faster dependency installation.
12+
- **Performance tuned**: Environment variables and cache strategies optimized for faster builds and execution.
13+
- **Jupyter ready (optional)**: Notebook and JupyterLab with widgets/extensions; enable by setting `JUPYTER_PASSWORD` (omit to disable).
1314

14-
**Choose your combination:**
15-
- **Ubuntu versions:** 20.04, 22.04, or 24.04
16-
- **CUDA versions:** 12.4.1 through 12.9.0 for GPU acceleration
17-
- **Optimized Performance:** Efficiently configured environment variables and cache directories
15+
### Available configurations
16+
- **Ubuntu**: 22.04 (Jammy) and 24.04 (Noble)
17+
- **CUDA**: 12.8.0, 12.8.1, 12.9.0, and 13.0.0
1818

19-
Perfect for immediate development and experimenting, or as the foundation for more specialized containers.
20-
21-
*Need something more specialized? Check out our other templates in the `official-templates` directory for ROCm support, PyTorch, and other ML frameworks.*
19+
Need something more specialized? Explore the templates in `official-templates` for ROCm, PyTorch, and more.
2220

2321
<div class="base-images">
2422

2523
## Generated Images
2624

27-
### Operating Systems:
28-
- Ubuntu 20.04:
29-
- `runpod/base:0.7.0`
30-
- `runpod/base:0.7.0-ubuntu2004`
31-
- Ubuntu 22.04:
32-
- `runpod/base:0.7.0-ubuntu2204`
33-
- `runpod/base:0.7.0-jammy`
34-
- Ubuntu 24.04:
35-
- `runpod/base:0.7.0-ubuntu2404`
36-
- `runpod/base:0.7.0-noble`
25+
### Base Images (CPU-Only, No GPU Drivers):
26+
- Ubuntu 22.04: `runpod/base:1.0.2-ubuntu2204`
27+
- Ubuntu 24.04: `runpod/base:1.0.2-ubuntu2404`
3728

38-
### CUDA Versions:
39-
- 12.4.1:
40-
- Ubuntu 20.04:
41-
- `runpod/base:0.7.0-cuda1241`
42-
- `runpod/base:0.7.0-cuda1241-ubuntu2004`
43-
- `runpod/base:0.7.0-focal-cuda1241`
44-
- Ubuntu 22.04:
45-
- `runpod/base:0.7.0-cuda1241`
46-
- `runpod/base:0.7.0-cuda1241-ubuntu2204`
47-
- `runpod/base:0.7.0-jammy-cuda1241`
48-
- 12.5.1:
49-
- Ubuntu 20.04:
50-
- `runpod/base:0.7.0-cuda1251`
51-
- `runpod/base:0.7.0-cuda1251-ubuntu2004`
52-
- `runpod/base:0.7.0-focal-cuda1251`
53-
- Ubuntu 22.04:
54-
- `runpod/base:0.7.0-cuda1251`
55-
- `runpod/base:0.7.0-cuda1251-ubuntu2204`
56-
- `runpod/base:0.7.0-jammy-cuda1251`
57-
- 12.6.3:
58-
- Ubuntu 20.04:
59-
- `runpod/base:0.7.0-cuda1263`
60-
- `runpod/base:0.7.0-cuda1263-ubuntu2004`
61-
- `runpod/base:0.7.0-focal-cuda1263`
62-
- Ubuntu 22.04:
63-
- `runpod/base:0.7.0-cuda1263`
64-
- `runpod/base:0.7.0-cuda1263-ubuntu2204`
65-
- `runpod/base:0.7.0-jammy-cuda1263`
66-
- Ubuntu 24.04:
67-
- `runpod/base:0.7.0-cuda1263`
68-
- `runpod/base:0.7.0-cuda1263-ubuntu2404`
69-
- `runpod/base:0.7.0-noble-cuda1263`
29+
### CUDA Images (GPU Required) by Version:
30+
- 12.8.0:
31+
- Ubuntu 22.04: `runpod/base:1.0.2-cuda1280-ubuntu2204`
32+
- Ubuntu 24.04: `runpod/base:1.0.2-cuda1280-ubuntu2404`
7033
- 12.8.1:
71-
- Ubuntu 20.04:
72-
- `runpod/base:0.7.0-cuda1281`
73-
- `runpod/base:0.7.0-cuda1281-ubuntu2004`
74-
- `runpod/base:0.7.0-focal-cuda1281`
75-
- Ubuntu 22.04:
76-
- `runpod/base:0.7.0-cuda1281`
77-
- `runpod/base:0.7.0-cuda1281-ubuntu2204`
78-
- `runpod/base:0.7.0-jammy-cuda1281`
79-
- Ubuntu 24.04:
80-
- `runpod/base:0.7.0-cuda1281`
81-
- `runpod/base:0.7.0-cuda1281-ubuntu2404`
82-
- `runpod/base:0.7.0-noble-cuda1281`
34+
- Ubuntu 22.04: `runpod/base:1.0.2-cuda1281-ubuntu2204`
35+
- Ubuntu 24.04: `runpod/base:1.0.2-cuda1281-ubuntu2404`
8336
- 12.9.0:
84-
- Ubuntu 20.04:
85-
- `runpod/base:0.7.0-cuda1290`
86-
- `runpod/base:0.7.0-cuda1290-ubuntu2004`
87-
- `runpod/base:0.7.0-focal-cuda1290`
88-
- Ubuntu 22.04:
89-
- `runpod/base:0.7.0-cuda1290`
90-
- `runpod/base:0.7.0-cuda1290-ubuntu2204`
91-
- `runpod/base:0.7.0-jammy-cuda1290`
92-
- Ubuntu 24.04:
93-
- `runpod/base:0.7.0-cuda1290`
94-
- `runpod/base:0.7.0-cuda1290-ubuntu2404`
95-
- `runpod/base:0.7.0-noble-cuda1290`
37+
- Ubuntu 22.04: `runpod/base:1.0.2-cuda1290-ubuntu2204`
38+
- Ubuntu 24.04: `runpod/base:1.0.2-cuda1290-ubuntu2404`
39+
- 13.0.0:
40+
- Ubuntu 22.04: `runpod/base:1.0.2-cuda1300-ubuntu2204`
41+
- Ubuntu 24.04: `runpod/base:1.0.2-cuda1300-ubuntu2404`
9642
</div>

0 commit comments

Comments
 (0)