-
Notifications
You must be signed in to change notification settings - Fork 125
128 lines (115 loc) · 4 KB
/
base.yml
File metadata and controls
128 lines (115 loc) · 4 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
name: Docker Image Build and Release
on:
push:
paths:
- ".github/workflows/base.yml"
- "official-templates/base/docker-bake.hcl"
- "official-templates/base/Dockerfile"
- "official-templates/pytorch/docker-bake.hcl"
- "official-templates/pytorch/Dockerfile"
- "official-templates/autoresearch/docker-bake.hcl"
- "official-templates/autoresearch/Dockerfile"
- "official-templates/shared/**"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-base:
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Docker
uses: ./.github/actions/docker-setup
id: setup
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build base images
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
with:
source: .
files: |
official-templates/shared/versions.hcl
official-templates/base/docker-bake.hcl
push: true
build-autoresearch:
needs: build-base
if: always() && (needs.build-base.result == 'success' || needs.build-base.result == 'skipped')
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if build is needed
uses: tj-actions/changed-files@v46
id: changes
with:
files_yaml: |
autoresearch:
- 'official-templates/shared/**'
- 'official-templates/base/**'
- 'official-templates/autoresearch/**'
- name: Setup Docker
if: steps.changes.outputs.autoresearch_any_changed == 'true'
uses: ./.github/actions/docker-setup
id: setup
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build autoresearch images
if: steps.changes.outputs.autoresearch_any_changed == 'true'
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
with:
source: .
files: |
official-templates/shared/versions.hcl
official-templates/autoresearch/docker-bake.hcl
push: true
build-pytorch:
needs: build-base
# always() forces job run even if the dependant is skipped (but not if it failed)
if: always() && (needs.build-base.result == 'success' || needs.build-base.result == 'skipped')
runs-on: blacksmith-16vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if build is needed
uses: tj-actions/changed-files@v46
id: changes
with:
files_yaml: |
pytorch:
- 'official-templates/shared/**'
- 'official-templates/pytorch/**'
- name: Setup Docker
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.pytorch_any_changed == 'true'
uses: ./.github/actions/docker-setup
id: setup
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build pytorch images
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.pytorch_any_changed == 'true'
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
with:
source: .
files: |
official-templates/shared/versions.hcl
official-templates/pytorch/docker-bake.hcl
push: true