From bbbbe90abe9b9c00a09c9a090e7331ff713c82e7 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 28 Apr 2025 19:24:19 -0500 Subject: [PATCH 01/12] ci: first blacksmith build --- .github/workflows/base.yml | 60 ++++--- .github/workflows/comfyui.yml | 2 +- LICENSE | 2 +- README.md | 4 +- helper-templates/verify-nccl/Dockerfile | 3 +- official-templates/base/Dockerfile | 8 +- official-templates/base/docker-bake.hcl | 71 ++++---- official-templates/bittensor/Dockerfile | 5 +- official-templates/bittensor/docker-bake.hcl | 25 +-- official-templates/discoart/.Dockerfile.swp | Bin 12288 -> 0 bytes official-templates/discoart/Dockerfile | 7 +- official-templates/discoart/README.md | 2 +- official-templates/discoart/docker-bake.hcl | 23 ++- .../fast-stable-diffusion/Dockerfile | 5 +- .../fast-stable-diffusion/docker-bake.hcl | 19 +- official-templates/invokeai/Dockerfile | 5 +- official-templates/invokeai/docker-bake.hcl | 19 +- official-templates/oobabooga/Dockerfile | 5 +- official-templates/oobabooga/docker-bake.hcl | 19 +- official-templates/pytorch/Dockerfile | 5 +- official-templates/pytorch/README.md | 2 +- official-templates/pytorch/docker-bake.hcl | 164 +++++++++++------- .../stable-diffusion-comfyui/Dockerfile | 3 +- .../stable-diffusion-comfyui/docker-bake.hcl | 19 +- .../stable-diffusion-webui/Dockerfile | 5 +- .../stable-diffusion-webui/docker-bake.hcl | 11 +- official-templates/tensorflow/Dockerfile | 4 +- official-templates/tensorflow/docker-bake.hcl | 11 +- official-templates/vs-code/Dockerfile | 5 +- official-templates/vs-code/docker-bake.hcl | 19 +- official-templates/vscode-server/Dockerfile | 5 +- .../vscode-server/docker-bake.hcl | 19 +- 32 files changed, 315 insertions(+), 241 deletions(-) delete mode 100644 official-templates/discoart/.Dockerfile.swp diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index c647cb51..4d4581fa 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -7,10 +7,12 @@ on: 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: | @@ -19,18 +21,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: | @@ -40,26 +44,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: "offical-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 }} \ No newline at end of file diff --git a/.github/workflows/comfyui.yml b/.github/workflows/comfyui.yml index 22dd01f3..77f26e67 100644 --- a/.github/workflows/comfyui.yml +++ b/.github/workflows/comfyui.yml @@ -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 diff --git a/LICENSE b/LICENSE index 65603cc2..8b844538 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md index d12535e1..de702332 100644 --- a/README.md +++ b/README.md @@ -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' diff --git a/helper-templates/verify-nccl/Dockerfile b/helper-templates/verify-nccl/Dockerfile index c48b2d0c..ca159f5d 100644 --- a/helper-templates/verify-nccl/Dockerfile +++ b/helper-templates/verify-nccl/Dockerfile @@ -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 diff --git a/official-templates/base/Dockerfile b/official-templates/base/Dockerfile index 6b2afa12..a8c1f08c 100644 --- a/official-templates/base/Dockerfile +++ b/official-templates/base/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE +ARG BASE_IMAGE=non-existing FROM ${BASE_IMAGE} SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -197,10 +197,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 diff --git a/official-templates/base/docker-bake.hcl b/official-templates/base/docker-bake.hcl index 2d42f579..0754692f 100644 --- a/official-templates/base/docker-bake.hcl +++ b/official-templates/base/docker-bake.hcl @@ -11,13 +11,13 @@ group "default" { } 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}" @@ -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}" @@ -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}" @@ -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}" @@ -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}" @@ -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}" @@ -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}" @@ -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}" diff --git a/official-templates/bittensor/Dockerfile b/official-templates/bittensor/Dockerfile index 25e1f9dd..5132b263 100644 --- a/official-templates/bittensor/Dockerfile +++ b/official-templates/bittensor/Dockerfile @@ -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" ] diff --git a/official-templates/bittensor/docker-bake.hcl b/official-templates/bittensor/docker-bake.hcl index f0a9f0b8..f6eb8b0c 100644 --- a/official-templates/bittensor/docker-bake.hcl +++ b/official-templates/bittensor/docker-bake.hcl @@ -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}" + } } diff --git a/official-templates/discoart/.Dockerfile.swp b/official-templates/discoart/.Dockerfile.swp deleted file mode 100644 index 8bcbe1cf54977db664beebbba669321815a22802..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2&u`pB6vroUDU<>N32}l)B6THN+t~z4TC|nYY$~GWS2x)LqG&a?XV=qs$Hp_x z50DBH5+{z8kl+MI{snsB0xIGTTsVWc^iSYBUhig8R1O@FDvhPjdh=%9n>Sy-c~KOH z^EcKuXvtq-xSnO~rSDHi{ZC$IkKdVLWmqax+JS$+WbQTJSnw8`-jcVlc;TUwZ;t{7 zQKk%+N)$SXrH(RQn4q0Sd!p#eR6Nw(4LAjy0{>Nk()7KhGu_37=DZCtH~R`b|6KRK zMst2n0jGddz$xGqa0)mDoB~b(r@$kqfXQdr$H@D!I`=p0`^*FP`bT$j3OEIv0!{&^ zfK$LJ;1qBQI0c*nP64NYQ{WL)fX9q|bc(T0pFr~X|Nr>!|6iYB>=*DY_zV=_1F#M* zf+g?*`0HuLegpTwmmmhOgV%ruem}$5UGN?F1{{EW5QBHX&riV)z6Q5|1PQnfE`lX+ z3fw=<*iYadxC0azg6rTsI0x=O$=HwJ2XGgB1wya^E`S%o4EPg!{R4af?7lw-?s5t^ z1)Ks-0jGddz$x%QDzLKAruS$z&;~C;`Z}4V_gSaANyU)7PM?Az%S_-$JW2$eJxjyA zSQg~v6b!Riqq|iZOHzh@lnsMU zsl4qho_6vvTsh`4pDZ$dSG3id_nQm;{PA*(t#00+_S(+M)^caJx7FRsj2uejrllB)pI-yfo{ZLvzvrRdJKC<#wCunZC@AR9IKe2^(A4+J2YB zAs^-`wik@QO?ywRb27x#z^I<01SLrP+#yYhw+b|_O%S@3_ zJWK@&EI*cqmc2i?D?)wYpIJMlqx`^BvXqNoHU@Icq+N3(Riy-&uff=*pi{Z4D-OA zL7kOFBzjtyGDjz=mWgcMo?buBU4;Jew~Eop@Rl`zWFh(Hlx-KW+UJF1tu+WU6cTS}M;L#pp4N(sA-p*UA z>+7xRvD*hYYG12Y)|NMWS36sqyQ`aRQkjwphlNK5#cgxifqvEVMm5Bu&(W1gCn8PH i+sUZX$!x|DW&=md4CS7fbk<9GA#BwW0*ronu)hICAZ0iJ diff --git a/official-templates/discoart/Dockerfile b/official-templates/discoart/Dockerfile index 01892f5f..031f1653 100644 --- a/official-templates/discoart/Dockerfile +++ b/official-templates/discoart/Dockerfile @@ -1,8 +1,8 @@ FROM entmike/discoart:preload # Set bash as default shell, non-interactive -ENV DEBIAN_FRONTEND noninteractive\ - SHELL=/bin/bash +ENV DEBIAN_FRONTEND noninteractive +ENV SHELL=/bin/bash # Create workspace working directory WORKDIR /workspace @@ -59,7 +59,6 @@ RUN rm -Rf /root/.cache && mkdir -p /models/.cache && ln -s /models/.cache /root # Start Scripts COPY pre_start.sh /pre_start.sh -COPY --from=scripts start.sh / -RUN chmod +x /start.sh +COPY --chmod=755 --from=scripts start.sh / CMD [ "/start.sh" ] diff --git a/official-templates/discoart/README.md b/official-templates/discoart/README.md index d86bc4af..568c9bfd 100644 --- a/official-templates/discoart/README.md +++ b/official-templates/discoart/README.md @@ -1 +1 @@ -Tempalte for: https://github.com/jina-ai/discoart +Template for: https://github.com/jina-ai/discoart diff --git a/official-templates/discoart/docker-bake.hcl b/official-templates/discoart/docker-bake.hcl index 9b34a887..02bcb5e0 100644 --- a/official-templates/discoart/docker-bake.hcl +++ b/official-templates/discoart/docker-bake.hcl @@ -1,16 +1,21 @@ +variable "RELEASE" { + default = "0.0.0" +} + variable "IMAGE_NAME" { - default = "runpod/discoart" + default = "runpod/discoart" } -variable "RELEASE" { - default = "0.0.0" +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { - dockerfile = "Dockerfile" - tags = ["${IMAGE_NAME}:${RELEASE}"] - contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - } + context = "${GITHUB_WORKSPACE}/official-templates/discoart" + dockerfile = "Dockerfile" + tags = ["runpod/discoart:${RELEASE}"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + } } diff --git a/official-templates/fast-stable-diffusion/Dockerfile b/official-templates/fast-stable-diffusion/Dockerfile index b78e0b55..0a1c6dc1 100644 --- a/official-templates/fast-stable-diffusion/Dockerfile +++ b/official-templates/fast-stable-diffusion/Dockerfile @@ -1,5 +1,5 @@ # Import necessary base images -FROM runpod/stable-diffusion:models-1.0.0 as sd-models +FROM runpod/stable-diffusion:models-1.0.0 AS sd-models FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 @@ -72,8 +72,7 @@ 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 +COPY --chmod=755 --from=scripts start.sh / # Force RUN pip install --upgrade --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 diff --git a/official-templates/fast-stable-diffusion/docker-bake.hcl b/official-templates/fast-stable-diffusion/docker-bake.hcl index f1aa368c..e8d60243 100644 --- a/official-templates/fast-stable-diffusion/docker-bake.hcl +++ b/official-templates/fast-stable-diffusion/docker-bake.hcl @@ -1,12 +1,17 @@ variable "RELEASE" { - default = "2.4.0" + default = "2.4.0" +} + +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { - dockerfile = "Dockerfile" - tags = ["runpod/stable-diffusion:fast-stable-diffusion-${RELEASE}"] - contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - } + context = "${GITHUB_WORKSPACE}/official-templates/fast-stable-diffusion" + dockerfile = "Dockerfile" + tags = ["runpod/stable-diffusion:fast-stable-diffusion-${RELEASE}"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + } } diff --git a/official-templates/invokeai/Dockerfile b/official-templates/invokeai/Dockerfile index 6c75c829..0ebe1e56 100644 --- a/official-templates/invokeai/Dockerfile +++ b/official-templates/invokeai/Dockerfile @@ -26,8 +26,7 @@ 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 / CMD [ "/start.sh" ] diff --git a/official-templates/invokeai/docker-bake.hcl b/official-templates/invokeai/docker-bake.hcl index 85c28ead..42020ee0 100644 --- a/official-templates/invokeai/docker-bake.hcl +++ b/official-templates/invokeai/docker-bake.hcl @@ -1,12 +1,17 @@ variable "RELEASE" { - default = "3.3.0" + default = "3.3.0" +} + +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { - dockerfile = "Dockerfile" - tags = ["runpod/stable-diffusion:invoke-${RELEASE}"] - contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - } + context = "${GITHUB_WORKSPACE}/official-templates/invokeai" + dockerfile = "Dockerfile" + tags = ["runpod/stable-diffusion:invoke-${RELEASE}"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + } } diff --git a/official-templates/oobabooga/Dockerfile b/official-templates/oobabooga/Dockerfile index 7b4e6c05..d8245a24 100644 --- a/official-templates/oobabooga/Dockerfile +++ b/official-templates/oobabooga/Dockerfile @@ -1,7 +1,7 @@ # start from runpod pytorch container ARG BASE_IMAGE=runpod/pytorch:3.10-1.13.1-116 -FROM ${BASE_IMAGE} as dev-base +FROM ${BASE_IMAGE} AS dev-base SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -37,7 +37,6 @@ COPY README.md /usr/share/nginx/html/README.md # Start Scripts COPY pre_start.sh /pre_start.sh COPY post_start.sh /post_start.sh -COPY --from=scripts start.sh / -RUN chmod +x /start.sh +COPY --chmod=755 --from=scripts start.sh / CMD [ "/start.sh" ] diff --git a/official-templates/oobabooga/docker-bake.hcl b/official-templates/oobabooga/docker-bake.hcl index 2e45c56d..093eb022 100644 --- a/official-templates/oobabooga/docker-bake.hcl +++ b/official-templates/oobabooga/docker-bake.hcl @@ -1,12 +1,17 @@ variable "RELEASE" { - default = "1.2.1" + default = "1.2.1" +} + +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { - dockerfile = "Dockerfile" - tags = ["runpod/oobabooga:${RELEASE}"] - contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - } + context = "${GITHUB_WORKSPACE}/official-templates/oobabooga" + dockerfile = "Dockerfile" + tags = ["runpod/oobabooga:${RELEASE}"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + } } diff --git a/official-templates/pytorch/Dockerfile b/official-templates/pytorch/Dockerfile index 11d6aa83..9af066ff 100644 --- a/official-templates/pytorch/Dockerfile +++ b/official-templates/pytorch/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE +ARG BASE_IMAGE=non-existing FROM ${BASE_IMAGE} ARG TORCH @@ -58,8 +58,7 @@ 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 / -RUN chmod +x /start.sh +COPY --chmod=755 --from=scripts start.sh / # Welcome Message COPY --from=logo runpod.txt /etc/runpod.txt diff --git a/official-templates/pytorch/README.md b/official-templates/pytorch/README.md index 26c644ea..0e66adf3 100644 --- a/official-templates/pytorch/README.md +++ b/official-templates/pytorch/README.md @@ -7,7 +7,7 @@ Example: ```bash -cd containers/official-templates/pytorch +cd official-templates/pytorch docker buildx bake 280-py311-cuda1281-cudnn-devel-ubuntu2204 --set 280-py311-cuda1281-cudnn-devel-ubuntu2204.platform=linux/amd64 ``` diff --git a/official-templates/pytorch/docker-bake.hcl b/official-templates/pytorch/docker-bake.hcl index ccaad8fe..ed2e780b 100644 --- a/official-templates/pytorch/docker-bake.hcl +++ b/official-templates/pytorch/docker-bake.hcl @@ -2,6 +2,10 @@ variable "PUBLISHER" { default = "runpod" } +variable "GITHUB_WORKSPACE" { + default = "." +} + group "default" { targets = [ ### CUDA ### @@ -19,6 +23,7 @@ group "default" { # CUDA 12.4.1 "240-py311-cuda1241-devel-ubuntu2204", "251-py311-cuda1241-devel-ubuntu2204", + "260-py311-cuda1241-devel-ubuntu2204", # CUDA 12.8.1 "280-py311-cuda1281-cudnn-devel-ubuntu2204", @@ -63,18 +68,21 @@ group "cuda" { "220-py310-cuda1211-devel-ubuntu2204", "221-py310-cuda1211-devel-ubuntu2204", "240-py311-cuda1241-devel-ubuntu2204", + "251-py311-cuda1241-devel-ubuntu2204", + "260-py311-cuda1241-devel-ubuntu2204", "280-py311-cuda1281-cudnn-devel-ubuntu2204", ] } target "191-py39-cuda111-devel-ubuntu2004" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:1.9.1-py3.9-cuda11.1.1-devel-ubuntu20.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04" @@ -85,12 +93,13 @@ target "191-py39-cuda111-devel-ubuntu2004" { target "1131-py38-cuda1171-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:1.13.0-py3.10-cuda11.7.1-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:11.8.0-devel-ubuntu22.04" @@ -101,12 +110,13 @@ target "1131-py38-cuda1171-devel-ubuntu2204" { target "201-py310-cuda1180-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.0.1-py3.10-cuda11.8.0-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:11.8.0-devel-ubuntu22.04" @@ -117,12 +127,13 @@ target "201-py310-cuda1180-devel-ubuntu2204" { target "210-py310-cuda1180-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:11.8.0-devel-ubuntu22.04" @@ -133,12 +144,13 @@ target "210-py310-cuda1180-devel-ubuntu2204" { target "211-py310-cuda1211-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.1.1-py3.10-cuda12.1.1-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:12.1.1-devel-ubuntu22.04" @@ -148,73 +160,94 @@ target "211-py310-cuda1211-devel-ubuntu2204" { } target "220-py310-cuda1211-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.2.0-py3.10-cuda12.1.1-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:12.1.1-devel-ubuntu22.04" PYTHON_VERSION = "3.10" - TORCH = "pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0" + TORCH = "torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0" } } target "221-py310-cuda1211-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.2.1-py3.10-cuda12.1.1-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:12.1.1-devel-ubuntu22.04" PYTHON_VERSION = "3.10" - TORCH = "torch torchvision torchaudio" + TORCH = "torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu121" } } target "240-py311-cuda1241-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:12.4.1-devel-ubuntu22.04" PYTHON_VERSION = "3.11" - TORCH = "torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124" + TORCH = "torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu124" } } target "251-py311-cuda1241-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.5.1-py3.11-cuda12.4.1-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" + } + args = { + BASE_IMAGE = "nvidia/cuda:12.4.1-devel-ubuntu22.04" + PYTHON_VERSION = "3.11" + TORCH = "torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1" + } +} + +target "260-py311-cuda1241-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" + dockerfile = "Dockerfile" + tags = ["${PUBLISHER}/pytorch:2.6.0-py3.11-cuda12.4.1-devel-ubuntu22.04"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:12.4.1-devel-ubuntu22.04" PYTHON_VERSION = "3.11" - TORCH = "torch torchvision torchaudio" + TORCH = "torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0" } } target "280-py311-cuda1281-cudnn-devel-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.8.0-py3.11-cuda12.8.1-cudnn-devel-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04" @@ -226,12 +259,13 @@ target "280-py311-cuda1281-cudnn-devel-ubuntu2204" { # ROCM target "201-py38-rocm56-ubuntu2004" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.0.1-py3.8-rocm5.6-ubuntu20.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm5.6_ubuntu20.04_py3.8_pytorch_2.0.1" @@ -239,12 +273,13 @@ target "201-py38-rocm56-ubuntu2004" { } target "201-py310-rocm57-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.0.1-py3.10-rocm5.7-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm5.7_ubuntu22.04_py3.10_pytorch_2.0.1" @@ -252,12 +287,13 @@ target "201-py310-rocm57-ubuntu2204" { } target "212-py310-rocm602-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.1.2-py3.10-rocm6.0.2-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.0.2_ubuntu22.04_py3.10_pytorch_2.1.2" @@ -266,12 +302,13 @@ target "212-py310-rocm602-ubuntu2204" { target "211-py39-rocm60-ubuntu2004" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.1.1-py3.9-rocm6.0-ubuntu20.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.0_ubuntu20.04_py3.9_pytorch_2.1.1" @@ -279,12 +316,13 @@ target "211-py39-rocm60-ubuntu2004" { } target "201-py39-rocm61-ubuntu2004" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.0.1-py3.9-rocm6.1-ubuntu20.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.1_ubuntu20.04_py3.9_pytorch_2.0.1" @@ -292,12 +330,13 @@ target "201-py39-rocm61-ubuntu2004" { } target "212-py310-rocm61-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.1.2-py3.10-rocm6.1-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.1_ubuntu22.04_py3.10_pytorch_2.1.2" @@ -305,12 +344,13 @@ target "212-py310-rocm61-ubuntu2204" { } target "201-py39-rocm612-ubuntu2004" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.0.1-py3.9-rocm6.1.2-ubuntu20.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.1.2_ubuntu20.04_py3.9_pytorch_release-2.0.1" @@ -318,12 +358,13 @@ target "201-py39-rocm612-ubuntu2004" { } target "212-py310-rocm612-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.1.2-py3.10-rocm6.1.2-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.1.2_ubuntu22.04_py3.10_pytorch_release-2.1.2" @@ -331,12 +372,13 @@ target "212-py310-rocm612-ubuntu2204" { } target "240-py310-rocm610-ubuntu2204" { + context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" tags = ["${PUBLISHER}/pytorch:2.4.0-py3.10-rocm6.1.0-ubuntu22.04"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - logo = "../../container-template" + scripts = "container-template" + proxy = "container-template/proxy" + logo = "container-template" } args = { BASE_IMAGE = "rocm/pytorch:rocm6.1_ubuntu22.04_py3.10_pytorch_2.4" diff --git a/official-templates/stable-diffusion-comfyui/Dockerfile b/official-templates/stable-diffusion-comfyui/Dockerfile index e5e0463f..ca10f036 100644 --- a/official-templates/stable-diffusion-comfyui/Dockerfile +++ b/official-templates/stable-diffusion-comfyui/Dockerfile @@ -34,7 +34,6 @@ RUN mkdir -p /ComfyUI/user # Copy the README.md, extra_model_paths.yml and start script COPY README.md /usr/share/nginx/html/README.md COPY extra_model_paths.yml /ComfyUI/extra_model_paths.yml -COPY pre_start.sh /pre_start.sh -RUN chmod +x /pre_start.sh +COPY --chmod=755 pre_start.sh /pre_start.sh CMD [ "/start.sh" ] \ No newline at end of file diff --git a/official-templates/stable-diffusion-comfyui/docker-bake.hcl b/official-templates/stable-diffusion-comfyui/docker-bake.hcl index c33b2925..472bdbf1 100644 --- a/official-templates/stable-diffusion-comfyui/docker-bake.hcl +++ b/official-templates/stable-diffusion-comfyui/docker-bake.hcl @@ -1,4 +1,3 @@ -// ComfyUI Docker Bake file variable "RELEASE" { default = "6.0.0" } @@ -7,27 +6,17 @@ variable "COMFYUI_VERSION" { default = "v0.3.10" } -variable "DOCKERHUB_REPO" { - default = "runpod" -} - -variable "DOCKERHUB_IMG" { - default = "stable-diffusion" -} - -// For GitHub Actions compatibility variable "GITHUB_WORKSPACE" { default = "." } target "default" { context = "${GITHUB_WORKSPACE}/official-templates/stable-diffusion-comfyui" - dockerfile = "${GITHUB_WORKSPACE}/official-templates/stable-diffusion-comfyui/Dockerfile" - tags = ["${DOCKERHUB_REPO}/${DOCKERHUB_IMG}:comfy-ui-${RELEASE}"] - platforms = ["linux/amd64"] + dockerfile = "Dockerfile" + tags = ["runpod/stable-diffusion:comfy-ui-${RELEASE}"] contexts = { - scripts = "${GITHUB_WORKSPACE}/container-template" - proxy = "${GITHUB_WORKSPACE}/container-template/proxy" + scripts = "container-template" + proxy = "container-template/proxy" } args = { COMFYUI_VERSION = "${COMFYUI_VERSION}" diff --git a/official-templates/stable-diffusion-webui/Dockerfile b/official-templates/stable-diffusion-webui/Dockerfile index 92958b68..d72a7c1d 100644 --- a/official-templates/stable-diffusion-webui/Dockerfile +++ b/official-templates/stable-diffusion-webui/Dockerfile @@ -86,9 +86,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" ] diff --git a/official-templates/stable-diffusion-webui/docker-bake.hcl b/official-templates/stable-diffusion-webui/docker-bake.hcl index 72f72229..df683f4d 100644 --- a/official-templates/stable-diffusion-webui/docker-bake.hcl +++ b/official-templates/stable-diffusion-webui/docker-bake.hcl @@ -1,13 +1,18 @@ variable "RELEASE" { - default = "12.0.0" + default = "12.0.0" +} + +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { + context = "${GITHUB_WORKSPACE}/official-templates/stable-diffusion-webui" dockerfile = "Dockerfile" tags = ["runpod/stable-diffusion:web-ui-${RELEASE}"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" + scripts = "container-template" + proxy = "container-template/proxy" } args = { WEBUI_VERSION = "v1.8.0" diff --git a/official-templates/tensorflow/Dockerfile b/official-templates/tensorflow/Dockerfile index 4d51101f..f51879ad 100644 --- a/official-templates/tensorflow/Dockerfile +++ b/official-templates/tensorflow/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update --yes && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen # Setup Jupyter Notebook +RUN pip install --upgrade --no-cache-dir pip RUN pip install --upgrade --no-cache-dir jupyterlab ipywidgets jupyter-archive jupyter_contrib_nbextensions RUN pip install notebook==6.5.5 RUN jupyter contrib nbextension install --user && \ @@ -23,8 +24,7 @@ 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 / -RUN chmod +x /start.sh +COPY --from=scripts --chmod=755 start.sh / # Custom MOTD COPY --from=scripts runpod.txt /etc/motd diff --git a/official-templates/tensorflow/docker-bake.hcl b/official-templates/tensorflow/docker-bake.hcl index 13a8ceb2..3926da36 100644 --- a/official-templates/tensorflow/docker-bake.hcl +++ b/official-templates/tensorflow/docker-bake.hcl @@ -1,12 +1,17 @@ variable "RELEASE" { - default = "1.0.3" + default = "1.0.3" +} + +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { + context = "${GITHUB_WORKSPACE}/official-templates/tensorflow" dockerfile = "Dockerfile" tags = ["runpod/tensorflow:${RELEASE}"] contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" + scripts = "container-template" + proxy = "container-template/proxy" } } diff --git a/official-templates/vs-code/Dockerfile b/official-templates/vs-code/Dockerfile index c94d502e..887701c6 100644 --- a/official-templates/vs-code/Dockerfile +++ b/official-templates/vs-code/Dockerfile @@ -46,8 +46,7 @@ COPY --from=proxy readme.html /usr/share/nginx/html/readme.html COPY README.md /usr/share/nginx/html/README.md # Start Scripts -COPY post_start.sh /post_start.sh -COPY --from=scripts start.sh / -RUN chmod +x /start.sh +COPY --chmod=755 post_start.sh /post_start.sh +COPY --chmod=755 --from=scripts start.sh / CMD [ "/start.sh" ] diff --git a/official-templates/vs-code/docker-bake.hcl b/official-templates/vs-code/docker-bake.hcl index b24d82a6..7f8f70b8 100644 --- a/official-templates/vs-code/docker-bake.hcl +++ b/official-templates/vs-code/docker-bake.hcl @@ -1,12 +1,17 @@ variable "RELEASE" { - default = "0.1.0" + default = "0.1.0" +} + +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { - dockerfile = "Dockerfile" - tags = ["runpod/coder:${RELEASE}"] - contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - } + context = "${GITHUB_WORKSPACE}/official-templates/vs-code" + dockerfile = "Dockerfile" + tags = ["runpod/coder:${RELEASE}"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + } } diff --git a/official-templates/vscode-server/Dockerfile b/official-templates/vscode-server/Dockerfile index 36ddad86..168b64a6 100644 --- a/official-templates/vscode-server/Dockerfile +++ b/official-templates/vscode-server/Dockerfile @@ -67,8 +67,7 @@ COPY --from=proxy readme.html /usr/share/nginx/html/readme.html COPY README.md /usr/share/nginx/html/README.md # Start Scripts -COPY post_start.sh /post_start.sh -COPY --from=scripts start.sh / -RUN chmod +x /start.sh +COPY --chmod=755 post_start.sh /post_start.sh +COPY --chmod=755 --from=scripts start.sh / CMD [ "/start.sh" ] diff --git a/official-templates/vscode-server/docker-bake.hcl b/official-templates/vscode-server/docker-bake.hcl index 70cf79da..15171e79 100644 --- a/official-templates/vscode-server/docker-bake.hcl +++ b/official-templates/vscode-server/docker-bake.hcl @@ -1,16 +1,17 @@ variable "RELEASE" { - default = "0.1.2" + default = "0.1.2" } -variable "IMAGE_NAME" { - default = "runpod/vscode-server" +variable "GITHUB_WORKSPACE" { + default = "." } target "default" { - dockerfile = "Dockerfile" - tags = ["${IMAGE_NAME}:${RELEASE}"] - contexts = { - scripts = "../../container-template" - proxy = "../../container-template/proxy" - } + context = "${GITHUB_WORKSPACE}/official-templates/vscode-server" + dockerfile = "Dockerfile" + tags = ["runpod/vscode-server:${RELEASE}"] + contexts = { + scripts = "container-template" + proxy = "container-template/proxy" + } } From e00018b2230f6d6f39042a46a89fba6419245429 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 28 Apr 2025 19:25:55 -0500 Subject: [PATCH 02/12] ci: fix typo :) --- .github/workflows/base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 4d4581fa..91b4b158 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -70,7 +70,7 @@ jobs: BUILDX_BAKE_ENTITLEMENTS_FS: 0 with: source: . - files: "offical-templates/base/docker-bake.hcl" #${{ steps.changed_files_csv.outputs.files }} + 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) || '' }} From aa4ef39b52017c8bd3db0539d09252d897b380e2 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 28 Apr 2025 19:31:48 -0500 Subject: [PATCH 03/12] ci: add workflow dispatch --- .github/workflows/base.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 91b4b158..ba81a21d 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -4,6 +4,7 @@ on: push: paths: - "official-templates/base/**" + workflow_dispatch: jobs: build: From a137fbd467e82ab30cbc0a5bc9cc4f0e671a5015 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 28 Apr 2025 19:32:31 -0500 Subject: [PATCH 04/12] ci: trigger build --- official-templates/base/docker-bake.hcl | 1 + 1 file changed, 1 insertion(+) diff --git a/official-templates/base/docker-bake.hcl b/official-templates/base/docker-bake.hcl index 0754692f..c27c731d 100644 --- a/official-templates/base/docker-bake.hcl +++ b/official-templates/base/docker-bake.hcl @@ -129,3 +129,4 @@ target "12-6-2" { BASE_IMAGE = "nvidia/cuda:12.6.2-devel-ubuntu22.04" } } + From 9a7400d923ab54594687cebd1b53dea0653f690d Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 28 Apr 2025 19:47:09 -0500 Subject: [PATCH 05/12] ci: limit build to cuda 12+ images --- official-templates/base/docker-bake.hcl | 2 +- official-templates/pytorch/docker-bake.hcl | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/official-templates/base/docker-bake.hcl b/official-templates/base/docker-bake.hcl index c27c731d..0ca35c4e 100644 --- a/official-templates/base/docker-bake.hcl +++ b/official-templates/base/docker-bake.hcl @@ -7,7 +7,7 @@ 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" { diff --git a/official-templates/pytorch/docker-bake.hcl b/official-templates/pytorch/docker-bake.hcl index ed2e780b..eae31e8e 100644 --- a/official-templates/pytorch/docker-bake.hcl +++ b/official-templates/pytorch/docker-bake.hcl @@ -8,14 +8,6 @@ variable "GITHUB_WORKSPACE" { group "default" { targets = [ - ### CUDA ### - # CUDA 11.1 - "191-py39-cuda111-devel-ubuntu2004", - # CUDA 11.7.1 - "1131-py38-cuda1171-devel-ubuntu2204", - # CUDA 11.8.0 - "201-py310-cuda1180-devel-ubuntu2204", - "210-py310-cuda1180-devel-ubuntu2204", # CUDA 12.1.1 "211-py310-cuda1211-devel-ubuntu2204", "220-py310-cuda1211-devel-ubuntu2204", @@ -207,7 +199,6 @@ target "240-py311-cuda1241-devel-ubuntu2204" { } } - target "251-py311-cuda1241-devel-ubuntu2204" { context = "${GITHUB_WORKSPACE}/official-templates/pytorch" dockerfile = "Dockerfile" From 2a626cbe3191187331ef4b7bb367707cb562b37e Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Thu, 1 May 2025 12:01:01 -0500 Subject: [PATCH 06/12] fix: drop python 3.8 --- official-templates/base/Dockerfile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/official-templates/base/Dockerfile b/official-templates/base/Dockerfile index a8c1f08c..df2410b9 100644 --- a/official-templates/base/Dockerfile +++ b/official-templates/base/Dockerfile @@ -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 \ @@ -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 && \ @@ -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 && \ From 3b75ea107b7e4964f5f6cf79f47fd57b1da4ee8e Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Thu, 1 May 2025 12:44:45 -0500 Subject: [PATCH 07/12] ci: trigger build --- official-templates/base/docker-bake.hcl | 1 + 1 file changed, 1 insertion(+) diff --git a/official-templates/base/docker-bake.hcl b/official-templates/base/docker-bake.hcl index 0ca35c4e..2df1b07c 100644 --- a/official-templates/base/docker-bake.hcl +++ b/official-templates/base/docker-bake.hcl @@ -130,3 +130,4 @@ target "12-6-2" { } } + From 9877558630b7fae20dd21ac5411a3f3f7b619b02 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Thu, 1 May 2025 13:15:06 -0500 Subject: [PATCH 08/12] fix: remove unused build var [skip ci] --- official-templates/discoart/docker-bake.hcl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/official-templates/discoart/docker-bake.hcl b/official-templates/discoart/docker-bake.hcl index 02bcb5e0..41b21f12 100644 --- a/official-templates/discoart/docker-bake.hcl +++ b/official-templates/discoart/docker-bake.hcl @@ -2,10 +2,6 @@ variable "RELEASE" { default = "0.0.0" } -variable "IMAGE_NAME" { - default = "runpod/discoart" -} - variable "GITHUB_WORKSPACE" { default = "." } From a0d38d7f9895bfd2b03e3439119e180c42c186c9 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 12 May 2025 14:08:35 -0500 Subject: [PATCH 09/12] ci: attempt a run on depot --- .github/workflows/base.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index ba81a21d..4b4f2cab 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: blacksmith-4vcpu-ubuntu-2204 + runs-on: depot-ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -22,16 +22,14 @@ jobs: rm -rf "/usr/local/share/boost" rm -rf "$AGENT_TOOLSDIRECTORY" + - 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 From b6ab669a0d1f12c4d59c78d495450866dacbd4dd Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Mon, 12 May 2025 14:09:24 -0500 Subject: [PATCH 10/12] ci: trigger build --- official-templates/base/docker-bake.hcl | 1 - 1 file changed, 1 deletion(-) diff --git a/official-templates/base/docker-bake.hcl b/official-templates/base/docker-bake.hcl index 2df1b07c..0ca35c4e 100644 --- a/official-templates/base/docker-bake.hcl +++ b/official-templates/base/docker-bake.hcl @@ -130,4 +130,3 @@ target "12-6-2" { } } - From d56e7c8d08db88ec632cf6d61c349b58e1bed9f9 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Wed, 14 May 2025 12:26:06 -0500 Subject: [PATCH 11/12] Revert "ci: attempt a run on depot" This reverts commit a0d38d7f9895bfd2b03e3439119e180c42c186c9. --- .github/workflows/base.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 4b4f2cab..ba81a21d 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: depot-ubuntu-22.04 + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - name: Checkout uses: actions/checkout@v4 @@ -22,14 +22,16 @@ jobs: rm -rf "/usr/local/share/boost" rm -rf "$AGENT_TOOLSDIRECTORY" - - 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 From 5dbc48882dcd1fe49846df06de3399f44a66dea8 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Wed, 14 May 2025 12:26:34 -0500 Subject: [PATCH 12/12] ci: trigger build --- official-templates/base/docker-bake.hcl | 1 - 1 file changed, 1 deletion(-) diff --git a/official-templates/base/docker-bake.hcl b/official-templates/base/docker-bake.hcl index 0ca35c4e..dbb276ec 100644 --- a/official-templates/base/docker-bake.hcl +++ b/official-templates/base/docker-bake.hcl @@ -129,4 +129,3 @@ target "12-6-2" { BASE_IMAGE = "nvidia/cuda:12.6.2-devel-ubuntu22.04" } } -