@@ -14,8 +14,25 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17- image-build :
17+ extras-image-build :
18+ uses : ./.github/workflows/image_build.yml
19+ with :
20+ tag-latest : ${{ matrix.tag-latest }}
21+ tag-suffix : ${{ matrix.tag-suffix }}
22+ ffmpeg : ${{ matrix.ffmpeg }}
23+ image-type : ${{ matrix.image-type }}
24+ build-type : ${{ matrix.build-type }}
25+ cuda-major-version : ${{ matrix.cuda-major-version }}
26+ cuda-minor-version : ${{ matrix.cuda-minor-version }}
27+ platforms : ${{ matrix.platforms }}
28+ runs-on : ${{ matrix.runs-on }}
29+ secrets :
30+ dockerUsername : ${{ secrets.LOCALAI_REGISTRY_USERNAME }}
31+ dockerPassword : ${{ secrets.LOCALAI_REGISTRY_PASSWORD }}
1832 strategy :
33+ # Pushing with all jobs in parallel
34+ # eats the bandwidth of all the nodes
35+ max-parallel : ${{ github.event_name != 'pull_request' && 2 || 4 }}
1936 matrix :
2037 include :
2138 - build-type : ' '
@@ -34,35 +51,35 @@ jobs:
3451 image-type : ' extras'
3552 runs-on : ' arc-runner-set'
3653 - build-type : ' cublas'
37- cuda-major-version : 11
38- cuda-minor-version : 7
54+ cuda-major-version : " 11 "
55+ cuda-minor-version : " 7 "
3956 platforms : ' linux/amd64'
4057 tag-latest : ' false'
4158 tag-suffix : ' -cublas-cuda11'
4259 ffmpeg : ' '
4360 image-type : ' extras'
4461 runs-on : ' arc-runner-set'
4562 - build-type : ' cublas'
46- cuda-major-version : 12
47- cuda-minor-version : 1
63+ cuda-major-version : " 12 "
64+ cuda-minor-version : " 1 "
4865 platforms : ' linux/amd64'
4966 tag-latest : ' false'
5067 tag-suffix : ' -cublas-cuda12'
5168 ffmpeg : ' '
5269 image-type : ' extras'
5370 runs-on : ' arc-runner-set'
5471 - build-type : ' cublas'
55- cuda-major-version : 11
56- cuda-minor-version : 7
72+ cuda-major-version : " 11 "
73+ cuda-minor-version : " 7 "
5774 platforms : ' linux/amd64'
5875 tag-latest : ' false'
5976 tag-suffix : ' -cublas-cuda11-ffmpeg'
6077 ffmpeg : ' true'
6178 image-type : ' extras'
6279 runs-on : ' arc-runner-set'
6380 - build-type : ' cublas'
64- cuda-major-version : 12
65- cuda-minor-version : 1
81+ cuda-major-version : " 12 "
82+ cuda-minor-version : " 1 "
6683 platforms : ' linux/amd64'
6784 tag-latest : ' false'
6885 tag-suffix : ' -cublas-cuda12-ffmpeg'
7794 ffmpeg : ' '
7895 image-type : ' extras'
7996 runs-on : ' arc-runner-set'
97+ core-image-build :
98+ uses : ./.github/workflows/image_build.yml
99+ with :
100+ tag-latest : ${{ matrix.tag-latest }}
101+ tag-suffix : ${{ matrix.tag-suffix }}
102+ ffmpeg : ${{ matrix.ffmpeg }}
103+ image-type : ${{ matrix.image-type }}
104+ build-type : ${{ matrix.build-type }}
105+ cuda-major-version : ${{ matrix.cuda-major-version }}
106+ cuda-minor-version : ${{ matrix.cuda-minor-version }}
107+ platforms : ${{ matrix.platforms }}
108+ runs-on : ${{ matrix.runs-on }}
109+ secrets :
110+ dockerUsername : ${{ secrets.LOCALAI_REGISTRY_USERNAME }}
111+ dockerPassword : ${{ secrets.LOCALAI_REGISTRY_PASSWORD }}
112+ strategy :
113+ matrix :
114+ include :
80115 - build-type : ' '
81116 platforms : ' linux/amd64'
82117 tag-latest : ' false'
@@ -85,133 +120,38 @@ jobs:
85120 image-type : ' core'
86121 runs-on : ' ubuntu-latest'
87122 - build-type : ' cublas'
88- cuda-major-version : 11
89- cuda-minor-version : 7
123+ cuda-major-version : " 11 "
124+ cuda-minor-version : " 7 "
90125 platforms : ' linux/amd64'
91126 tag-latest : ' false'
92127 tag-suffix : ' -cublas-cuda11-core'
93128 ffmpeg : ' '
94129 image-type : ' core'
95130 runs-on : ' ubuntu-latest'
96131 - build-type : ' cublas'
97- cuda-major-version : 12
98- cuda-minor-version : 1
132+ cuda-major-version : " 12 "
133+ cuda-minor-version : " 1 "
99134 platforms : ' linux/amd64'
100135 tag-latest : ' false'
101136 tag-suffix : ' -cublas-cuda12-core'
102137 ffmpeg : ' '
103138 image-type : ' core'
104139 runs-on : ' ubuntu-latest'
105140 - build-type : ' cublas'
106- cuda-major-version : 11
107- cuda-minor-version : 7
141+ cuda-major-version : " 11 "
142+ cuda-minor-version : " 7 "
108143 platforms : ' linux/amd64'
109144 tag-latest : ' false'
110145 tag-suffix : ' -cublas-cuda11-ffmpeg-core'
111146 ffmpeg : ' true'
112147 image-type : ' core'
113148 runs-on : ' ubuntu-latest'
114149 - build-type : ' cublas'
115- cuda-major-version : 12
116- cuda-minor-version : 1
150+ cuda-major-version : " 12 "
151+ cuda-minor-version : " 1 "
117152 platforms : ' linux/amd64'
118153 tag-latest : ' false'
119154 tag-suffix : ' -cublas-cuda12-ffmpeg-core'
120155 ffmpeg : ' true'
121156 image-type : ' core'
122157 runs-on : ' ubuntu-latest'
123-
124- runs-on : ${{ matrix.runs-on }}
125- steps :
126- - name : Force Install GIT latest
127- run : |
128- sudo apt-get update \
129- && sudo apt-get install -y software-properties-common \
130- && sudo apt-get update \
131- && sudo add-apt-repository -y ppa:git-core/ppa \
132- && sudo apt-get update \
133- && sudo apt-get install -y git
134- - name : Checkout
135- uses : actions/checkout@v4
136- # - name: Release space from worker
137- # run: |
138- # echo "Listing top largest packages"
139- # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr)
140- # head -n 30 <<< "${pkgs}"
141- # echo
142- # df -h
143- # echo
144- # sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true
145- # sudo apt-get remove --auto-remove android-sdk-platform-tools || true
146- # sudo apt-get purge --auto-remove android-sdk-platform-tools || true
147- # sudo rm -rf /usr/local/lib/android
148- # sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true
149- # sudo rm -rf /usr/share/dotnet
150- # sudo apt-get remove -y '^mono-.*' || true
151- # sudo apt-get remove -y '^ghc-.*' || true
152- # sudo apt-get remove -y '.*jdk.*|.*jre.*' || true
153- # sudo apt-get remove -y 'php.*' || true
154- # sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true
155- # sudo apt-get remove -y '^google-.*' || true
156- # sudo apt-get remove -y azure-cli || true
157- # sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true
158- # sudo apt-get remove -y '^gfortran-.*' || true
159- # sudo apt-get remove -y microsoft-edge-stable || true
160- # sudo apt-get remove -y firefox || true
161- # sudo apt-get remove -y powershell || true
162- # sudo apt-get remove -y r-base-core || true
163- # sudo apt-get autoremove -y
164- # sudo apt-get clean
165- # echo
166- # echo "Listing top largest packages"
167- # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr)
168- # head -n 30 <<< "${pkgs}"
169- # echo
170- # sudo rm -rfv build || true
171- # df -h
172- - name : Docker meta
173- id : meta
174- uses : docker/metadata-action@v5
175- with :
176- images : quay.io/go-skynet/local-ai
177- tags : |
178- type=ref,event=branch
179- type=semver,pattern={{raw}}
180- type=sha
181- flavor : |
182- latest=${{ matrix.tag-latest }}
183- suffix=${{ matrix.tag-suffix }}
184-
185- - name : Set up QEMU
186- uses : docker/setup-qemu-action@master
187- with :
188- platforms : all
189-
190- - name : Set up Docker Buildx
191- id : buildx
192- uses : docker/setup-buildx-action@master
193-
194- - name : Login to DockerHub
195- if : github.event_name != 'pull_request'
196- uses : docker/login-action@v3
197- with :
198- registry : quay.io
199- username : ${{ secrets.LOCALAI_REGISTRY_USERNAME }}
200- password : ${{ secrets.LOCALAI_REGISTRY_PASSWORD }}
201-
202- - name : Build and push
203- uses : docker/build-push-action@v5
204- with :
205- builder : ${{ steps.buildx.outputs.name }}
206- build-args : |
207- BUILD_TYPE=${{ matrix.build-type }}
208- CUDA_MAJOR_VERSION=${{ matrix.cuda-major-version }}
209- CUDA_MINOR_VERSION=${{ matrix.cuda-minor-version }}
210- FFMPEG=${{ matrix.ffmpeg }}
211- IMAGE_TYPE=${{ matrix.image-type }}
212- context : .
213- file : ./Dockerfile
214- platforms : ${{ matrix.platforms }}
215- push : ${{ github.event_name != 'pull_request' }}
216- tags : ${{ steps.meta.outputs.tags }}
217- labels : ${{ steps.meta.outputs.labels }}
0 commit comments