-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (136 loc) · 4.64 KB
/
Copy pathbuild-ghcr-images.yml
File metadata and controls
147 lines (136 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build Hailo8 Docker Images
on:
push:
branches:
- main
paths:
- ".github/workflows/build-ghcr-images.yml"
- "docker/hailo8/**"
- "src/rpi5_hailo8_*/**"
workflow_dispatch:
inputs:
model:
description: "Model image to build"
required: true
default: "all"
type: choice
options:
- all
- deeplab_v3_mobilenet_v2
- fast_depth
- person_attr_resnet
- scdepthv3
- scrfd
- segformer_b0_bn
- unet_mobilenet_v2
- yolov10
- yolov11
- yolov5
- yolov8
- yolov8_pose
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAMESPACE: seeed-projects/recomputer-r20-cv
SOURCE_REPOSITORY: https://github.com/Seeed-Projects/reComputer-R20-CV
jobs:
build:
name: Build ${{ matrix.model }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- model: deeplab_v3_mobilenet_v2
image: deeplab_v3_mobilenet_v2
description: DeepLabV3 MobileNetV2 semantic segmentation
- model: fast_depth
image: fast_depth
description: FastDepth monocular depth estimation
- model: person_attr_resnet
image: person_attr_resnet
description: Person Attribute ResNet classifier
- model: scdepthv3
image: scdepthv3
description: SCDepthV3 monocular depth estimation
- model: scrfd
image: scrfd
description: SCRFD face detection
- model: segformer_b0_bn
image: segformer_b0_bn
description: SegFormer B0 BN semantic segmentation
- model: unet_mobilenet_v2
image: unet_mobilenet_v2
description: U-Net MobileNetV2 semantic segmentation
- model: yolov10
image: yolov10
description: YOLOv10 object detection
- model: yolov11
image: yolov11
description: YOLOv11 object detection
- model: yolov5
image: yolov5
description: YOLOv5 object detection
- model: yolov8
image: yolov8
description: YOLOv8 object detection
- model: yolov8_pose
image: yolov8_pose
description: YOLOv8 pose estimation
steps:
- name: Select model
id: selected
shell: bash
run: |
if [[ "${{ github.event_name }}" != "workflow_dispatch" || "${{ github.event.inputs.model }}" == "all" || "${{ github.event.inputs.model }}" == "${{ matrix.model }}" ]]; then
echo "build=true" >> "$GITHUB_OUTPUT"
else
echo "build=false" >> "$GITHUB_OUTPUT"
fi
- name: Checkout
if: steps.selected.outputs.build == 'true'
uses: actions/checkout@v4
- name: Set up QEMU
if: steps.selected.outputs.build == 'true'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
if: steps.selected.outputs.build == 'true'
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: steps.selected.outputs.build == 'true'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
if: steps.selected.outputs.build == 'true'
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.image }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=sha-
labels: |
org.opencontainers.image.title=${{ matrix.model }}
org.opencontainers.image.description=${{ matrix.description }} for Raspberry Pi 5 / CM5 + Hailo-8
org.opencontainers.image.source=${{ env.SOURCE_REPOSITORY }}
org.opencontainers.image.url=${{ env.SOURCE_REPOSITORY }}
- name: Build and push
if: steps.selected.outputs.build == 'true'
uses: docker/build-push-action@v6
with:
context: ./src/rpi5_hailo8_${{ matrix.model }}
file: ./docker/hailo8/${{ matrix.model }}.dockerfile
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.model }}
cache-to: type=gha,mode=max,scope=${{ matrix.model }}
provenance: false