Skip to content

Commit

Permalink
Adds support for multi-platform linux/amd64 & linux/arm64 docker imag…
Browse files Browse the repository at this point in the history
…es (#603)
  • Loading branch information
pschork authored Jun 14, 2024
1 parent 44569ec commit 7d77786
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/docker-publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ success() }}

# Build And Push Image
- name: Build docker image release
run: make docker-release-build
if: ${{ success() }}

# Publish if release is tagged or force == true
- name: Push docker image release
run: make docker-release-push
- name: Set release PUSH_FLAG
run: echo "PUSH_FLAG=--push" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.force == 'true'

- name: Build (and potentially push) docker image release
run: PUSH_FLAG=$PUSH_FLAG make docker-release-build
10 changes: 6 additions & 4 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docker-publish
name: docker-publish-internal
on:
push:
branches:
Expand All @@ -19,7 +19,9 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Buildx
uses: docker/setup-buildx-action@v1
Expand Down Expand Up @@ -47,10 +49,10 @@ jobs:

# Build And Push Image
- name: Build Docker image
run: docker compose -f docker-compose-build.yaml build
run: docker compose -f docker-compose-internal.yaml build
- name: Push Docker image
if: github.ref == 'refs/heads/master'
run: docker compose -f docker-compose-build.yaml push
run: docker compose -f docker-compose-internal.yaml push

- name: Send GitHub Action trigger data to Slack workflow
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ branches:
increment: None
prevent-increment-of-merged-branch-version: true
track-merge-target: false
regex: ^v*|^releases?[/-]
regex: ^v\d+\.\d+\.\d+$|^releases?[/-]
source-branches:
- main
- release
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ integration-tests-dataapi:
go test -v ./disperser/dataapi

docker-release-build:
RELEASE_TAG=${SEMVER} docker compose -f docker-compose-release.yaml build --build-arg SEMVER=${SEMVER} --build-arg GITCOMMIT=${GITCOMMIT} --build-arg GITDATE=${GITDATE}

docker-release-push:
RELEASE_TAG=${SEMVER} docker compose -f docker-compose-release.yaml push
RELEASE_TAG=${SEMVER} docker compose -f docker-compose-release.yaml build --build-arg SEMVER=${SEMVER} --build-arg GITCOMMIT=${GITCOMMIT} --build-arg GITDATE=${GITDATE} ${PUSH_FLAG}

semver:
echo "${SEMVER}"
File renamed without changes.
6 changes: 6 additions & 0 deletions docker-compose-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ services:
build:
context: .
dockerfile: node/cmd/Dockerfile
platforms:
- "linux/amd64"
- "linux/arm64"
image: ghcr.io/layr-labs/eigenda/opr-node:${RELEASE_TAG}
nodeplugin:
build:
context: .
dockerfile: node/plugin/cmd/Dockerfile
platforms:
- "linux/amd64"
- "linux/arm64"
image: ghcr.io/layr-labs/eigenda/opr-nodeplugin:${RELEASE_TAG}

0 comments on commit 7d77786

Please sign in to comment.