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

fix docker build #338

Merged
merged 22 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
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
115 changes: 58 additions & 57 deletions .github/workflows/espresso-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,60 +158,61 @@ jobs:
#
# For documentation refer to
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
merge_into_multiplatform_images:
needs:
- docker_build
strategy:
matrix:
target: [nitro-node, nitro-node-dev]
include:
- target: nitro-node
image: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node
- target: nitro-node-dev
image: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev

runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Repo
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Remove digests dir
run: |
rm -rf "${{ runner.temp }}/digests"

- name: Download digests
uses: actions/download-artifact@v3
with:
name: "${{ matrix.target }}-digests"
path: "${{ runner.temp }}/digests"

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}

- name: Create manifest list and push
working-directory: "${{ runner.temp }}/digests"
run: |
# Count the number of files in the directory
file_count=$(find . -type f | wc -l)

if [ "$file_count" -ne 2 ]; then
echo "Should have exactly 2 digests to combine, something went wrong"
ls -lah
exit 1
fi

docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ matrix.image }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ matrix.image }}:${{ steps.meta.outputs.version }}
# Only building for AMD64
Copy link
Author

Choose a reason for hiding this comment

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

@Sneh1999 why comment this out? The arm image is used by anyone developing on a mac.

Copy link
Author

Choose a reason for hiding this comment

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

So I tried re-enabling it but now I'm thinking the part of extracting the wavm binary we may not need anymore as long as we always use the upstream one.

# merge_into_multiplatform_images:
# needs:
# - docker_build
# strategy:
# matrix:
# target: [nitro-node, nitro-node-dev]
# include:
# - target: nitro-node
# image: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node
# - target: nitro-node-dev
# image: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev

# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Login to Github Container Repo
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Remove digests dir
# run: |
# rm -rf "${{ runner.temp }}/digests"

# - name: Download digests
# uses: actions/download-artifact@v3
# with:
# name: "${{ matrix.target }}-digests"
# path: "${{ runner.temp }}/digests"

# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ matrix.image }}

# - name: Create manifest list and push
# working-directory: "${{ runner.temp }}/digests"
# run: |
# # Count the number of files in the directory
# file_count=$(find . -type f | wc -l)

# if [ "$file_count" -ne 2 ]; then
# echo "Should have exactly 2 digests to combine, something went wrong"
# ls -lah
# exit 1
# fi

# docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
# $(printf '${{ matrix.image }}@sha256:%s ' *)
# - name: Inspect image
# run: |
# docker buildx imagetools inspect ${{ matrix.image }}:${{ steps.meta.outputs.version }}
Loading