2022-11-06 14:19:00 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2023-07-27 14:56:12 +02:00
|
|
|
workflow_dispatch:
|
2022-11-06 14:19:00 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
- master
|
|
|
|
|
2023-01-19 00:30:49 +01:00
|
|
|
# only run the latest commit to avoid cache overwrites
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-11-06 14:19:00 +01:00
|
|
|
env:
|
|
|
|
PYTHON_VERSION: 3.9
|
|
|
|
|
|
|
|
jobs:
|
2023-07-27 14:56:12 +02:00
|
|
|
amd64_build:
|
2022-11-06 14:19:00 +01:00
|
|
|
runs-on: ubuntu-latest
|
2023-07-27 14:56:12 +02:00
|
|
|
name: AMD64 Build
|
2022-11-06 14:19:00 +01:00
|
|
|
steps:
|
|
|
|
- name: Check out code
|
2023-09-06 15:02:16 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-07-27 14:56:12 +02:00
|
|
|
- name: Set up QEMU and Buildx
|
|
|
|
id: setup
|
|
|
|
uses: ./.github/actions/setup
|
2022-11-06 14:19:00 +01:00
|
|
|
with:
|
2023-07-27 14:56:12 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-07-24 00:22:54 +02:00
|
|
|
- name: Build and push amd64 standard build
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2023-07-24 00:22:54 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker/main/Dockerfile
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64
|
|
|
|
target: frigate
|
2023-07-27 14:56:12 +02:00
|
|
|
tags: ${{ steps.setup.outputs.image-name }}-amd64
|
|
|
|
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
|
|
|
|
- name: Build and push TensorRT (x86 GPU)
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/bake-action@v4
|
2023-07-27 14:56:12 +02:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: tensorrt
|
|
|
|
files: docker/tensorrt/trt.hcl
|
|
|
|
set: |
|
|
|
|
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
|
2023-07-27 18:41:41 +02:00
|
|
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
|
2023-07-28 12:37:51 +02:00
|
|
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
|
2024-02-12 13:24:02 +01:00
|
|
|
- name: AMD/ROCm general build
|
|
|
|
env:
|
|
|
|
AMDGPU: gfx
|
|
|
|
HSA_OVERRIDE: 0
|
|
|
|
uses: docker/bake-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: rocm
|
|
|
|
files: docker/rocm/rocm.hcl
|
|
|
|
set: |
|
|
|
|
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm
|
|
|
|
*.cache-from=type=gha
|
|
|
|
- name: AMD/ROCm gfx900
|
|
|
|
env:
|
|
|
|
AMDGPU: gfx900
|
|
|
|
HSA_OVERRIDE: 1
|
|
|
|
HSA_OVERRIDE_GFX_VERSION: 9.0.0
|
|
|
|
uses: docker/bake-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: rocm
|
|
|
|
files: docker/rocm/rocm.hcl
|
|
|
|
set: |
|
|
|
|
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx900
|
|
|
|
*.cache-from=type=gha
|
|
|
|
- name: AMD/ROCm gfx1030
|
|
|
|
env:
|
|
|
|
AMDGPU: gfx1030
|
|
|
|
HSA_OVERRIDE: 1
|
|
|
|
HSA_OVERRIDE_GFX_VERSION: 10.3.0
|
|
|
|
uses: docker/bake-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: rocm
|
|
|
|
files: docker/rocm/rocm.hcl
|
|
|
|
set: |
|
|
|
|
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx1030
|
|
|
|
*.cache-from=type=gha
|
|
|
|
- name: AMD/ROCm gfx1100
|
|
|
|
env:
|
|
|
|
AMDGPU: gfx1100
|
|
|
|
HSA_OVERRIDE: 1
|
|
|
|
HSA_OVERRIDE_GFX_VERSION: 11.0.0
|
|
|
|
uses: docker/bake-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: rocm
|
|
|
|
files: docker/rocm/rocm.hcl
|
|
|
|
set: |
|
|
|
|
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx1100
|
|
|
|
*.cache-from=type=gha
|
2023-07-27 14:56:12 +02:00
|
|
|
arm64_build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: ARM Build
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
2023-09-06 15:02:16 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-07-27 14:56:12 +02:00
|
|
|
- name: Set up QEMU and Buildx
|
|
|
|
id: setup
|
|
|
|
uses: ./.github/actions/setup
|
|
|
|
with:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-07-24 00:22:54 +02:00
|
|
|
- name: Build and push arm64 standard build
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2022-11-24 03:00:45 +01:00
|
|
|
with:
|
|
|
|
context: .
|
2023-07-23 23:45:29 +02:00
|
|
|
file: docker/main/Dockerfile
|
2022-11-24 03:00:45 +01:00
|
|
|
push: true
|
2023-07-24 00:22:54 +02:00
|
|
|
platforms: linux/arm64
|
2022-12-30 17:53:17 +01:00
|
|
|
target: frigate
|
2022-11-24 03:00:45 +01:00
|
|
|
tags: |
|
2023-07-27 14:56:12 +02:00
|
|
|
${{ steps.setup.outputs.image-name }}-standard-arm64
|
2023-07-27 18:41:41 +02:00
|
|
|
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
|
2023-07-23 23:45:29 +02:00
|
|
|
- name: Build and push RPi build
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/bake-action@v4
|
2023-07-23 23:45:29 +02:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: rpi
|
|
|
|
files: docker/rpi/rpi.hcl
|
|
|
|
set: |
|
2023-07-27 14:56:12 +02:00
|
|
|
rpi.tags=${{ steps.setup.outputs.image-name }}-rpi
|
2023-07-27 18:41:41 +02:00
|
|
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
|
2023-07-28 12:37:51 +02:00
|
|
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64,mode=max
|
2023-11-02 13:55:24 +01:00
|
|
|
- name: Build and push RockChip build
|
|
|
|
uses: docker/bake-action@v3
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: rk
|
|
|
|
files: docker/rockchip/rk.hcl
|
|
|
|
set: |
|
2023-11-02 14:36:34 +01:00
|
|
|
rk.tags=${{ steps.setup.outputs.image-name }}-rk
|
2023-11-02 13:55:24 +01:00
|
|
|
*.cache-from=type=gha
|
2023-07-27 14:56:12 +02:00
|
|
|
jetson_jp4_build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Jetson Jetpack 4
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
2023-09-06 15:02:16 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-07-27 14:56:12 +02:00
|
|
|
- name: Set up QEMU and Buildx
|
|
|
|
id: setup
|
|
|
|
uses: ./.github/actions/setup
|
2022-12-30 17:53:17 +01:00
|
|
|
with:
|
2023-07-27 14:56:12 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-07-26 12:50:41 +02:00
|
|
|
- name: Build and push TensorRT (Jetson, Jetpack 4)
|
|
|
|
env:
|
|
|
|
ARCH: arm64
|
|
|
|
BASE_IMAGE: timongentzsch/l4t-ubuntu20-opencv:latest
|
|
|
|
SLIM_BASE: timongentzsch/l4t-ubuntu20-opencv:latest
|
|
|
|
TRT_BASE: timongentzsch/l4t-ubuntu20-opencv:latest
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/bake-action@v4
|
2023-07-26 12:50:41 +02:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: tensorrt
|
|
|
|
files: docker/tensorrt/trt.hcl
|
|
|
|
set: |
|
2023-07-27 14:56:12 +02:00
|
|
|
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp4
|
2023-07-28 12:37:51 +02:00
|
|
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp4
|
|
|
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp4,mode=max
|
2023-07-27 14:56:12 +02:00
|
|
|
jetson_jp5_build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Jetson Jetpack 5
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
2023-09-06 15:02:16 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-07-27 14:56:12 +02:00
|
|
|
- name: Set up QEMU and Buildx
|
|
|
|
id: setup
|
|
|
|
uses: ./.github/actions/setup
|
|
|
|
with:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-07-26 12:50:41 +02:00
|
|
|
- name: Build and push TensorRT (Jetson, Jetpack 5)
|
|
|
|
env:
|
|
|
|
ARCH: arm64
|
|
|
|
BASE_IMAGE: nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime
|
|
|
|
SLIM_BASE: nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime
|
|
|
|
TRT_BASE: nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/bake-action@v4
|
2023-07-26 12:50:41 +02:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
targets: tensorrt
|
|
|
|
files: docker/tensorrt/trt.hcl
|
|
|
|
set: |
|
2023-07-27 14:56:12 +02:00
|
|
|
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp5
|
2023-07-28 12:37:51 +02:00
|
|
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp5
|
|
|
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp5,mode=max
|
2023-07-27 14:56:12 +02:00
|
|
|
# The majority of users running arm64 are rpi users, so the rpi
|
|
|
|
# build should be the primary arm64 image
|
|
|
|
assemble_default_build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Assemble and push default build
|
|
|
|
needs:
|
|
|
|
- amd64_build
|
|
|
|
- arm64_build
|
|
|
|
steps:
|
|
|
|
- id: lowercaseRepo
|
2023-11-02 14:36:49 +01:00
|
|
|
uses: ASzc/change-string-case-action@v6
|
2023-07-27 14:56:12 +02:00
|
|
|
with:
|
|
|
|
string: ${{ github.repository }}
|
|
|
|
- name: Log in to the Container registry
|
2023-09-24 14:00:41 +02:00
|
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
|
2023-07-27 14:56:12 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create short sha
|
|
|
|
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
2024-03-05 14:00:27 +01:00
|
|
|
- uses: int128/docker-manifest-create-action@v2
|
2023-07-23 23:45:29 +02:00
|
|
|
with:
|
2023-07-27 18:41:41 +02:00
|
|
|
tags: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}
|
2024-03-05 20:56:12 +01:00
|
|
|
sources: |
|
|
|
|
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-amd64
|
|
|
|
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-rpi
|