Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for multi-platform linux/amd64 & linux/arm64 docker images #603

Merged
merged 8 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 10 additions & 7 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: docker-publish
name: docker-publish-internal
on:
push:
branches:
- master
- pschork/multi-platform-releases
pull_request:
pschork marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

Expand All @@ -19,7 +20,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 All @@ -45,12 +48,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build And Push Image
- name: Build Docker image
run: docker compose -f docker-compose-build.yaml build
- name: Push Docker image
- name: Set internal release PUSH_FLAG
run: echo "PUSH_FLAG=--push" >> $GITHUB_ENV
if: github.ref == 'refs/heads/master'
run: docker compose -f docker-compose-build.yaml push

- name: Build (and potentially push) internal docker image release
run: PUSH_FLAG=$PUSH_FLAG make docker-internal-build

- 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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ integration-tests-dataapi:
make dataapi-build
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-internal-build:
RELEASE_TAG=latest docker compose -f docker-compose-internal.yaml build --build-arg SEMVER=${SEMVER} --build-arg GITCOMMIT=${GITCOMMIT} --build-arg GITDATE=${GITDATE} ${PUSH_FLAG}

docker-release-push:
RELEASE_TAG=${SEMVER} docker compose -f docker-compose-release.yaml push
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} ${PUSH_FLAG}

semver:
echo "${SEMVER}"
3 changes: 3 additions & 0 deletions docker-compose-build.yaml → docker-compose-internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ services:
build:
context: .
dockerfile: node/cmd/Dockerfile
platforms:
- "linux/amd64"
- "linux/arm64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add arm images to the other components too?

Copy link
Contributor Author

@pschork pschork Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping this from this change. Building with docker compose is kludgy and we might be better off using buildx directly. This is also triggering a failure with gitversion that needs more debugging.

image: ghcr.io/layr-labs/eigenda/node:${BUILD_TAG:-latest}
churner:
build:
Expand Down
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}
Loading