Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
63f0269f
Commit
63f0269f
authored
Feb 04, 2025
by
Michael Yang
Browse files
ci: split docker build by platform
this improves build reliability and concurrency
parent
4759ecae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
20 deletions
+60
-20
.github/workflows/release.yaml
.github/workflows/release.yaml
+60
-20
No files found.
.github/workflows/release.yaml
View file @
63f0269f
...
@@ -330,32 +330,71 @@ jobs:
...
@@ -330,32 +330,71 @@ jobs:
path
:
|
path
:
|
dist/*.tgz
dist/*.tgz
docker-build
:
# Build each Docker variant (OS, arch, and flavor) separately. Using QEMU is unreliable and slower.
docker-build-push
:
strategy
:
strategy
:
matrix
:
matrix
:
include
:
include
:
-
flavor
:
'
latest=false'
-
os
:
linux
platforms
:
linux/amd64,linux/
arm64
arch
:
arm64
build-args
:
|
build-args
:
|
CGO_CFLAGS
CGO_CFLAGS
CGO_CXXFLAGS
CGO_CXXFLAGS
GOFLAGS
GOFLAGS
-
flavor
:
'
latest=false,suffix=-rocm'
-
os
:
linux
platforms
:
linux/amd64
arch
:
amd64
build-args
:
|
CGO_CFLAGS
CGO_CXXFLAGS
GOFLAGS
-
os
:
linux
arch
:
amd64
suffix
:
'
-rocm'
build-args
:
|
build-args
:
|
CGO_CFLAGS
CGO_CFLAGS
CGO_CXXFLAGS
CGO_CXXFLAGS
GOFLAGS
GOFLAGS
FLAVOR=rocm
FLAVOR=rocm
env
:
runs-on
:
${{ matrix.arch == 'arm64' && format('{0}-{1}', matrix.os, matrix.arch) || matrix.os }}
GOFLAGS
:
${{ needs.setup-environment.outputs.GOFLAGS }}
runs-on
:
linux
environment
:
release
environment
:
release
needs
:
setup-environment
needs
:
setup-environment
env
:
GOFLAGS
:
${{ needs.setup-environment.outputs.GOFLAGS }}
steps
:
steps
:
-
uses
:
actions/checkout@v4
-
uses
:
actions/checkout@v4
-
uses
:
docker/setup-qemu-action@v2
-
uses
:
docker/setup-buildx-action@v2
-
uses
:
docker/setup-buildx-action@v2
-
uses
:
docker/login-action@v3
with
:
username
:
${{ vars.DOCKER_USER }}
password
:
${{ secrets.DOCKER_ACCESS_TOKEN }}
-
id
:
build-push
uses
:
docker/build-push-action@v6
with
:
context
:
.
platforms
:
${{ matrix.os }}/${{ matrix.arch }}
build-args
:
${{ matrix.build-args }}
outputs
:
type=image,name=ollama/ollama,push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=registry,ref=ollama/ollama:latest
cache-to
:
type=inline
-
run
:
|
mkdir -p ${{ matrix.os }}-${{ matrix.arch }}
echo "${{ steps.build-push.outputs.digest }}" >${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.suffix }}.txt
working-directory
:
${{ runner.temp }}
-
uses
:
actions/upload-artifact@v4
with
:
name
:
digest-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.suffix }}
path
:
|
${{ runner.temp }}/${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.suffix }}.txt
# Merge Docker images for the same flavor into a single multi-arch manifest
docker-merge-push
:
strategy
:
matrix
:
suffix
:
[
'
'
,
'
-rocm'
]
runs-on
:
linux
environment
:
release
needs
:
[
docker-build-push
]
steps
:
-
uses
:
docker/login-action@v3
-
uses
:
docker/login-action@v3
with
:
with
:
username
:
${{ vars.DOCKER_USER }}
username
:
${{ vars.DOCKER_USER }}
...
@@ -363,22 +402,23 @@ jobs:
...
@@ -363,22 +402,23 @@ jobs:
-
id
:
metadata
-
id
:
metadata
uses
:
docker/metadata-action@v4
uses
:
docker/metadata-action@v4
with
:
with
:
flavor
:
${{ matrix.flavor }}
flavor
:
|
latest=false
suffix=${{ matrix.suffix }}
images
:
|
images
:
|
ollama/ollama
ollama/ollama
tags
:
|
tags
:
|
type=ref,enable=true,priority=600,prefix=pr-,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{version}}
-
uses
:
docker/build-push-action
@v
6
-
uses
:
actions/download-artifact
@v
4
with
:
with
:
context
:
.
pattern
:
digest-*
push
:
true
path
:
${{ runner.temp }}
platforms
:
${{ matrix.platforms }}
merge-multiple
:
true
build-args
:
${{ matrix.build-args }}
-
run
:
|
tags
:
${{ steps.metadata.outputs.tags }}
docker buildx imagetools create $(echo '${{ steps.metadata.outputs.json }}' | jq -cr '.tags | map("-t", .) | join(" ")') $(cat *-${{ matrix.suffix }}.txt | xargs printf 'ollama/ollama@%s ')
labels
:
${{ steps.metadata.outputs.labels }}
docker buildx imagetools inspect ollama/ollama:${{ steps.metadata.outputs.version }}
cache-from
:
type=registry,ref=ollama/ollama:latest
working-directory
:
${{ runner.temp }}
cache-to
:
type=inline
provenance
:
false
# Aggregate all the assets and ship a release
# Aggregate all the assets and ship a release
release
:
release
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment