Skip to content

Commit e75f960

Browse files
authored
revamp repo
all new containers! see #94
2 parents b541692 + 7816b40 commit e75f960

File tree

204 files changed

+1471
-1623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+1471
-1623
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: 'Docker Setup'
2+
description: 'Common Docker setup steps for Blacksmith builds'
3+
inputs:
4+
dockerhub-username:
5+
description: 'Docker Hub username'
6+
required: true
7+
dockerhub-token:
8+
description: 'Docker Hub token'
9+
required: true
10+
outputs:
11+
is-production:
12+
description: 'Whether this is a production build'
13+
value: ${{ steps.build-type.outputs.is_production }}
14+
release-suffix:
15+
description: 'Release suffix for non-production builds'
16+
value: ${{ steps.env-vars.outputs.release }}
17+
18+
runs:
19+
using: 'composite'
20+
steps:
21+
- name: Clear space to remove unused folders
22+
shell: bash
23+
run: |
24+
rm -rf /usr/share/dotnet
25+
rm -rf /opt/ghc
26+
rm -rf "/usr/local/share/boost"
27+
rm -rf "$AGENT_TOOLSDIRECTORY"
28+
29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v3
31+
with:
32+
username: ${{ inputs.dockerhub-username }}
33+
password: ${{ inputs.dockerhub-token }}
34+
35+
- name: Set up Docker Buildx
36+
uses: useblacksmith/build-push-action@v1.2
37+
with:
38+
setup-only: true
39+
40+
- name: Set up QEMU
41+
uses: docker/setup-qemu-action@v3
42+
43+
- name: Determine if this is a production build
44+
id: build-type
45+
shell: bash
46+
run: |
47+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
48+
echo "is_production=true" >> $GITHUB_OUTPUT
49+
else
50+
echo "is_production=false" >> $GITHUB_OUTPUT
51+
fi
52+
53+
- name: Set Environment Variables
54+
id: env-vars
55+
shell: bash
56+
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

.github/actions/update-readme/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "Update Template README"
2-
description: "Updates a RunPod template README via the API"
2+
description: "Updates a Runpod template README via the API"
33
inputs:
44
template_id:
5-
description: "RunPod Template ID"
5+
description: "Runpod Template ID"
66
required: true
77
template_path:
88
description: "Path to the template directory"

.github/workflows/base.yml

Lines changed: 87 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,87 @@
1-
name: Base Image Build and Release
2-
3-
on:
4-
push:
5-
paths:
6-
- "official-templates/base/**"
7-
workflow_dispatch:
8-
9-
jobs:
10-
build:
11-
runs-on: blacksmith-4vcpu-ubuntu-2204
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0
17-
18-
- name: Clear space to remove unused folders
19-
run: |
20-
rm -rf /usr/share/dotnet
21-
rm -rf /opt/ghc
22-
rm -rf "/usr/local/share/boost"
23-
rm -rf "$AGENT_TOOLSDIRECTORY"
24-
25-
- name: Login to Docker Hub
26-
uses: docker/login-action@v3
27-
with:
28-
username: ${{ secrets.DOCKERHUB_USERNAME }}
29-
password: ${{ secrets.DOCKERHUB_TOKEN }}
30-
31-
- name: Set up Docker Buildx
32-
uses: useblacksmith/build-push-action@v1.1
33-
with:
34-
setup-only: true
35-
36-
- name: Set up QEMU
37-
uses: docker/setup-qemu-action@v3
38-
39-
- name: Determine if this is a production build
40-
id: build_type
41-
run: |
42-
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
43-
echo "is_production=true" >> $GITHUB_OUTPUT
44-
else
45-
echo "is_production=false" >> $GITHUB_OUTPUT
46-
fi
47-
48-
- name: Get changed docker-bake.hcl files
49-
id: changed_files
50-
uses: tj-actions/changed-files@v46
51-
with:
52-
files: |
53-
**/docker-bake.hcl
54-
55-
- name: Set Environment Variables
56-
if: steps.build_type.outputs.is_production != 'true'
57-
run: |
58-
BRANCH_NAME=$(echo ${GITHUB_REF##refs/heads/} | sed 's/\//-/g')
59-
echo "RELEASE=dev-${BRANCH_NAME}" >> $GITHUB_ENV
60-
61-
- name: Convert changed files to CSV format
62-
if: steps.changed_files.outputs.any_changed == 'true'
63-
id: changed_files_csv
64-
run: |
65-
echo "files=${{ steps.changed_files.outputs.all_changed_files }}" | tr ' ' ',' >> $GITHUB_OUTPUT
66-
67-
- name: Build and push images
68-
if: steps.changed_files.outputs.any_changed == 'true'
69-
uses: docker/bake-action@v6
70-
env:
71-
BUILDX_BAKE_ENTITLEMENTS_FS: 0
72-
with:
73-
source: .
74-
files: "official-templates/base/docker-bake.hcl" #${{ steps.changed_files_csv.outputs.files }}
75-
push: true
76-
set: |
77-
${{ steps.build_type.outputs.is_production != 'true' && format('*.args.RELEASE={0}', env.RELEASE) || '' }}
78-
*.args.GITHUB_WORKSPACE=${{ github.workspace }}
1+
name: Docker Image Build and Release
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/base.yml"
7+
- "official-templates/base/docker-bake.hcl"
8+
- "official-templates/base/Dockerfile"
9+
- "official-templates/pytorch/docker-bake.hcl"
10+
- "official-templates/pytorch/Dockerfile"
11+
- "official-templates/shared/**"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
jobs:
19+
build-base:
20+
runs-on: blacksmith-8vcpu-ubuntu-2204
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Setup Docker
28+
uses: ./.github/actions/docker-setup
29+
id: setup
30+
with:
31+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Build base images
35+
uses: docker/bake-action@v6
36+
env:
37+
BUILDX_BAKE_ENTITLEMENTS_FS: 0
38+
with:
39+
source: .
40+
files: |
41+
official-templates/shared/versions.hcl
42+
official-templates/base/docker-bake.hcl
43+
push: true
44+
set: |
45+
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}
46+
47+
build-pytorch:
48+
needs: build-base
49+
# always() forces job run even if the dependant is skipped (but not if it failed)
50+
if: always() && (needs.build-base.result == 'success' || needs.build-base.result == 'skipped')
51+
runs-on: blacksmith-8vcpu-ubuntu-2204
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 0
57+
58+
- name: Check if build is needed
59+
uses: tj-actions/changed-files@v46
60+
id: changes
61+
with:
62+
files_yaml: |
63+
pytorch:
64+
- 'official-templates/shared/**'
65+
- 'official-templates/pytorch/**'
66+
67+
- name: Setup Docker
68+
if: steps.changes.outputs.pytorch_any_changed == 'true'
69+
uses: ./.github/actions/docker-setup
70+
id: setup
71+
with:
72+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
73+
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
74+
75+
- name: Build pytorch images
76+
if: steps.changes.outputs.pytorch_any_changed == 'true'
77+
uses: docker/bake-action@v6
78+
env:
79+
BUILDX_BAKE_ENTITLEMENTS_FS: 0
80+
with:
81+
source: .
82+
files: |
83+
official-templates/shared/versions.hcl
84+
official-templates/pytorch/docker-bake.hcl
85+
push: true
86+
set: |
87+
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}

.github/workflows/comfyui.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/rocm.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ROCm Image Build
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/rocm.yml"
7+
- "official-templates/rocm/**"
8+
- "official-templates/shared/**"
9+
- "official-templates/base/Dockerfile"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
build-rocm:
18+
runs-on: blacksmith-8vcpu-ubuntu-2204
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Docker
26+
uses: ./.github/actions/docker-setup
27+
id: setup
28+
with:
29+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Build rocm images
33+
uses: docker/bake-action@v6
34+
env:
35+
BUILDX_BAKE_ENTITLEMENTS_FS: 0
36+
with:
37+
source: .
38+
files: |
39+
official-templates/shared/versions.hcl
40+
official-templates/rocm/docker-bake.hcl
41+
push: true
42+
set: |
43+
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}

0 commit comments

Comments
 (0)