Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 37 additions & 24 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on:
push:
paths:
- "official-templates/base/**"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest-public-m
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Clear space to remove unused folders
run: |
Expand All @@ -19,18 +22,20 @@ jobs:
rm -rf "/usr/local/share/boost"
rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: useblacksmith/build-push-action@v1.1
with:
setup-only: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Determine if this is a production build
id: build_type
run: |
Expand All @@ -40,26 +45,34 @@ jobs:
echo "is_production=false" >> $GITHUB_OUTPUT
fi

- name: Set environment variables
- name: Get changed docker-bake.hcl files
id: changed_files
uses: tj-actions/changed-files@v46
with:
files: |
**/docker-bake.hcl

- name: Set Environment Variables
if: steps.build_type.outputs.is_production != 'true'
run: |
# Set environment variable to disable entitlements checks
echo "BUILDX_BAKE_ENTITLEMENTS_FS=0" >> $GITHUB_ENV
BRANCH_NAME=$(echo ${GITHUB_REF##refs/heads/} | sed 's/\//-/g')
echo "RELEASE=dev-${BRANCH_NAME}" >> $GITHUB_ENV

# Only set RELEASE for development builds
# For production, we'll use the default from docker-bake.hcl
if [[ "${{ steps.build_type.outputs.is_production }}" != "true" ]]; then
# For development builds (non-main branches)
# Convert branch name to tag-friendly format (replace / with -)
BRANCH_NAME=$(echo ${GITHUB_REF##refs/heads/} | sed 's/\//-/g')
# Add dev- prefix to the branch name
echo "RELEASE=dev-${BRANCH_NAME}" >> $GITHUB_ENV
fi
- name: Convert changed files to CSV format
if: steps.changed_files.outputs.any_changed == 'true'
id: changed_files_csv
run: |
echo "files=${{ steps.changed_files.outputs.all_changed_files }}" | tr ' ' ',' >> $GITHUB_OUTPUT

- name: Build and push the images to Docker Hub
uses: docker/bake-action@v2
- name: Build and push images
if: steps.changed_files.outputs.any_changed == 'true'
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
with:
files: ./official-templates/base/docker-bake.hcl
source: .
files: "official-templates/base/docker-bake.hcl" #${{ steps.changed_files_csv.outputs.files }}
push: true
set: |
${{ steps.build_type.outputs.is_production != 'true' && format('*.args.RELEASE={0}', env.RELEASE) || '' }}
*.args.GITHUB_WORKSPACE=${{ github.workspace }}
*.args.GITHUB_WORKSPACE=${{ github.workspace }}
2 changes: 1 addition & 1 deletion .github/workflows/comfyui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest-public-m
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Run-Pod
Copyright (c) 2022 RunPod, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ The following dependencies are required as part of RunPod platform functionality

- `nginx` - Required for proxying ports to the user.
- `openssh-server` - Required for SSH access to the container.
- 'pip install jupyterlab' - Required for JupyterLab access to the container.
- `pip install jupyterlab` - Required for JupyterLab access to the container.

### runpod.yaml

Each container foulder needs to have a runpod.yaml file. This file will contain version info as well as services to be ran. The runpod.yaml file should be formatted as follows:
Each container folder needs to have a runpod.yaml file. This file will contain version info as well as services to be ran. The runpod.yaml file should be formatted as follows:

```yaml
version: '1.0.0'
Expand Down
3 changes: 1 addition & 2 deletions helper-templates/verify-nccl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ RUN git clone https://github.com/NVIDIA/cuda-samples.git && \
cd cuda-samples/Samples/0_Introduction/simpleP2P && \
make

COPY check_nccl.sh .
RUN chmod +x check_nccl.sh
COPY --chmod=755 check_nccl.sh .

# Start Container
CMD tail -f /dev/null
20 changes: 6 additions & 14 deletions official-templates/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE
ARG BASE_IMAGE=non-existing
FROM ${BASE_IMAGE}

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down Expand Up @@ -105,11 +105,8 @@ RUN apt install --yes --no-install-recommends \
# Add the Python PPA
RUN add-apt-repository ppa:deadsnakes/ppa

# Install Python 3.8-3.11 with distutils
# Install Python 3.9-3.11 with distutils
RUN apt install --yes --no-install-recommends \
python3.8-dev \
python3.8-venv \
python3.8-distutils \
python3.9-dev \
python3.9-venv \
python3.9-distutils \
Expand Down Expand Up @@ -137,7 +134,6 @@ RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen

# Install pip
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.8 get-pip.py && \
python3.9 get-pip.py && \
python3.10 get-pip.py && \
python3.11 get-pip.py && \
Expand All @@ -146,16 +142,14 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
rm get-pip.py

# Get the latest pip for all python versions
RUN python3.8 -m pip install --upgrade pip && \
python3.9 -m pip install --upgrade pip && \
RUN python3.9 -m pip install --upgrade pip && \
python3.10 -m pip install --upgrade pip && \
python3.11 -m pip install --upgrade pip && \
python3.12 -m pip install --upgrade pip && \
python3.13 -m pip install --upgrade pip

# Install virtualenv
RUN python3.8 -m pip install virtualenv && \
python3.9 -m pip install virtualenv && \
RUN python3.9 -m pip install virtualenv && \
python3.10 -m pip install virtualenv && \
python3.11 -m pip install virtualenv && \
python3.12 -m pip install virtualenv && \
Expand Down Expand Up @@ -197,10 +191,8 @@ COPY --from=proxy readme.html /usr/share/nginx/html/readme.html
COPY README.md /usr/share/nginx/html/README.md

# Start Scripts
COPY --from=scripts start.sh /
COPY --from=base post_start.sh /
RUN chmod +x /start.sh && \
chmod +x /post_start.sh
COPY --from=scripts --chmod=755 start.sh /
COPY --chmod=755 post_start.sh /

# Welcome Message
COPY --from=logo runpod.txt /etc/runpod.txt
Expand Down
73 changes: 38 additions & 35 deletions official-templates/base/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ variable "GITHUB_WORKSPACE" {
}

group "default" {
targets = ["cpu", "11-1-1", "11-8-0", "12-1-0", "12-2-0", "12-4-1", "12-5-1", "12-6-2"]
targets = ["cpu", "12-1-0", "12-2-0", "12-4-1", "12-5-1", "12-6-2"]
}

target "cpu" {
dockerfile = "${GITHUB_WORKSPACE}/official-templates/base/Dockerfile"
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cpu"]
contexts = {
scripts = "${GITHUB_WORKSPACE}/container-template"
proxy = "${GITHUB_WORKSPACE}/container-template/proxy"
logo = "${GITHUB_WORKSPACE}/container-template"
base = "${GITHUB_WORKSPACE}/official-templates/base"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -26,13 +26,13 @@ target "cpu" {
}

target "11-1-1" {
dockerfile = "${GITHUB_WORKSPACE}/official-templates/base/Dockerfile"
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda11.1.1"]
contexts = {
scripts = "${GITHUB_WORKSPACE}/container-template"
proxy = "${GITHUB_WORKSPACE}/container-template/proxy"
logo = "${GITHUB_WORKSPACE}/container-template"
base = "${GITHUB_WORKSPACE}/official-templates/base"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -41,13 +41,13 @@ target "11-1-1" {
}

target "11-8-0" {
dockerfile = "${GITHUB_WORKSPACE}/official-templates/base/Dockerfile"
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda11.8.0"]
contexts = {
scripts = "${GITHUB_WORKSPACE}/container-template"
proxy = "${GITHUB_WORKSPACE}/container-template/proxy"
logo = "${GITHUB_WORKSPACE}/container-template"
base = "${GITHUB_WORKSPACE}/official-templates/base"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -56,13 +56,13 @@ target "11-8-0" {
}

target "12-1-0" {
dockerfile = "${GITHUB_WORKSPACE}/official-templates/base/Dockerfile"
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda12.1.0"]
contexts = {
scripts = "${GITHUB_WORKSPACE}/container-template"
proxy = "${GITHUB_WORKSPACE}/container-template/proxy"
logo = "${GITHUB_WORKSPACE}/container-template"
base = "${GITHUB_WORKSPACE}/official-templates/base"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -71,13 +71,13 @@ target "12-1-0" {
}

target "12-2-0" {
dockerfile = "${GITHUB_WORKSPACE}/official-templates/base/Dockerfile"
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda12.2.0"]
contexts = {
scripts = "${GITHUB_WORKSPACE}/container-template"
proxy = "${GITHUB_WORKSPACE}/container-template/proxy"
logo = "${GITHUB_WORKSPACE}/container-template"
base = "${GITHUB_WORKSPACE}/official-templates/base"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -86,12 +86,13 @@ target "12-2-0" {
}

target "12-4-1" {
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda12.4.1"]
contexts = {
scripts = "../../container-template"
proxy = "../../container-template/proxy"
logo = "../../container-template"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -100,12 +101,13 @@ target "12-4-1" {
}

target "12-5-1" {
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda12.5.1"]
contexts = {
scripts = "../../container-template"
proxy = "../../container-template/proxy"
logo = "../../container-template"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand All @@ -114,12 +116,13 @@ target "12-5-1" {
}

target "12-6-2" {
context = "${GITHUB_WORKSPACE}/official-templates/base"
dockerfile = "Dockerfile"
tags = ["runpod/base:${RELEASE}-cuda12.6.2"]
contexts = {
scripts = "../../container-template"
proxy = "../../container-template/proxy"
logo = "../../container-template"
scripts = "container-template"
proxy = "container-template/proxy"
logo = "container-template"
}
args = {
BASE_RELEASE_VERSION = "${RELEASE}"
Expand Down
5 changes: 2 additions & 3 deletions official-templates/bittensor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ COPY --from=proxy readme.html /usr/share/nginx/html/readme.html
COPY README.md /usr/share/nginx/html/README.md

# Start Scripts
COPY pre_start.sh /pre_start.sh
COPY --from=scripts start.sh /
RUN chmod +x /start.sh && chmod +x /pre_start.sh
COPY --chmod=755 pre_start.sh /pre_start.sh
COPY --chmod=755 --from=scripts start.sh /

SHELL ["/bin/bash", "--login", "-c"]
CMD [ "/start.sh" ]
25 changes: 15 additions & 10 deletions official-templates/bittensor/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
variable "VERSION" {
default = "5.3.3"
default = "5.3.3"
}

variable "GITHUB_WORKSPACE" {
default = "." # replaced with cwd
}

target "default" {
dockerfile = "Dockerfile"
tags = ["runpod/bittensor:${VERSION}"]
contexts = {
scripts = "../../container-template"
proxy = "../../container-template/proxy"
}
args = {
VERSION = "${VERSION}"
}
context = "${GITHUB_WORKSPACE}/official-templates/bittensor"
dockerfile = "Dockerfile"
tags = ["runpod/bittensor:${VERSION}"]
contexts = {
scripts = "container-template"
proxy = "container-template/proxy"
}
args = {
VERSION = "${VERSION}"
}
}
Binary file removed official-templates/discoart/.Dockerfile.swp
Binary file not shown.
Loading