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

feat: enable experimental multi-arch build for linux/amd64 and linux/arm64 #1103

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

networkhermit
Copy link
Contributor

@networkhermit networkhermit commented Jul 19, 2023

Building multi-arch docker image via QEMU emulation is pretty slow, but let's test the build process, if they are too slow maybe we will disable them.

References:

Summary by OpenAI

Release Notes:

  • New Feature: Experimental multi-architecture builds for linux/amd64 and linux/arm64 have been enabled in Dockerfile build targets.
  • New Feature: QEMU and Docker Buildx have been set up to enable experimental multi-arch builds for linux/amd64 and linux/arm64.

"Building with grace,
Multi-arch takes its place.
Linux/amd64 and arm64,
Docker's power we explore. 🐳"

@github-actions
Copy link
Contributor

🤖 OpenAI

High-level Summary

The changes introduce experimental multi-architecture builds for linux/amd64 and linux/arm64 in Dockerfiles. This is achieved by adding the platforms attribute to several build targets. Additionally, the changes set up QEMU and Docker Buildx in the GitHub workflow file to enable multi-arch builds.

File Summaries

File Summary
.docker-bake.hcl The diff adds the platforms attribute to several build targets in a Dockerfile. It enables experimental multi-architecture builds for linux/amd64 and linux/arm64.
.github/workflows/build.yaml Enable experimental multi-arch build for linux/amd64 and linux/arm64 by setting up QEMU and Docker Buildx.

These changes aim to enhance the flexibility and compatibility of the Docker images by enabling builds for multiple architectures.


Chat with 🤖 OpenAI Bot (@openai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @openai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Ignoring further reviews

  • Type @openai: ignore anywhere in the PR description to ignore further reviews from the bot.


In the recent run, only the files that changed from the base of the PR and between 55766a979631338ae1cdb8e2524c319bb5c427bb and 9ce8ce3708eb75e4bc6d32824d93c2c57f73c9a2 commits were reviewed.

Comment on lines 71 to +74
steps:
- name: Fetch Sources
uses: actions/checkout@v3
- name: Set up QEMU
Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The indentation of steps 72-75 is incorrect. It should be aligned with the previous step. Please fix the indentation.

Comment on lines +76 to +77
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The indentation of steps 76-77 is incorrect. It should be aligned with the previous step. Please fix the indentation.

Comment on lines 79 to 80
run: |
eval "$(./scripts/semver-ci.sh)"
Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The command eval "$(./scripts/semver-ci.sh)" is not clear in terms of its purpose and what it does. Please provide more context or documentation for this command to improve clarity.

Comment on lines 20 to 26
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/backend-server:latest", "${IMAGE_REGISTRY}/apitable/backend-server:${IMAGE_TAG}"]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The platforms attribute has been added to specify the target architectures for building the Docker image. However, it seems that the args attribute is no longer needed and can be removed. Additionally, it would be beneficial to add a comment explaining the purpose of the platforms attribute.

Suggested change
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/backend-server:latest", "${IMAGE_REGISTRY}/apitable/backend-server:${IMAGE_TAG}"]
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/backend-server:latest", "${IMAGE_REGISTRY}/apitable/backend-server:${IMAGE_TAG}"]
}

Comment on lines 30 to 36
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/room-server:latest", "${IMAGE_REGISTRY}/apitable/room-server:${IMAGE_TAG}"]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

Similar to the previous change, the platforms attribute has been added. The args attribute can be removed, and a comment explaining the platforms attribute would be helpful.

Suggested change
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/room-server:latest", "${IMAGE_REGISTRY}/apitable/room-server:${IMAGE_TAG}"]
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/room-server:latest", "${IMAGE_REGISTRY}/apitable/room-server:${IMAGE_TAG}"]
}

Comment on lines 40 to 46
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/web-server:latest", "${IMAGE_REGISTRY}/apitable/web-server:${IMAGE_TAG}"]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The platforms attribute has been added again. Remove the args attribute and consider adding a comment to explain the purpose of the platforms attribute.

Suggested change
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/web-server:latest", "${IMAGE_REGISTRY}/apitable/web-server:${IMAGE_TAG}"]
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/web-server:latest", "${IMAGE_REGISTRY}/apitable/web-server:${IMAGE_TAG}"]
}

Comment on lines 50 to 56
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/init-db:latest", "${IMAGE_REGISTRY}/apitable/init-db:${IMAGE_TAG}"]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The platforms attribute has been added once more. Remove the args attribute and consider adding a comment to clarify the intention of the platforms attribute.

Suggested change
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/init-db:latest", "${IMAGE_REGISTRY}/apitable/init-db:${IMAGE_TAG}"]
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/init-db:latest", "${IMAGE_REGISTRY}/apitable/init-db:${IMAGE_TAG}"]
}

Comment on lines 60 to 66
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/openresty:latest", "${IMAGE_REGISTRY}/apitable/openresty:${IMAGE_TAG}"]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The platforms attribute has been added. Remove the args attribute and consider adding a comment to explain the purpose of the platforms attribute.

Suggested change
args = {
SEMVER_FULL = SEMVER_FULL
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/openresty:latest", "${IMAGE_REGISTRY}/apitable/openresty:${IMAGE_TAG}"]
}
platforms = ["linux/amd64", "linux/arm64"]
tags = ["${IMAGE_REGISTRY}/apitable/openresty:latest", "${IMAGE_REGISTRY}/apitable/openresty:${IMAGE_TAG}"]
}

Comment on lines 71 to 76
SEMVER_FULL = SEMVER_FULL
IMAGE_TAG = IMAGE_TAG
}
platforms = ["linux/amd64"]
tags = ["${IMAGE_REGISTRY}/apitable/all-in-one:latest", "${IMAGE_REGISTRY}/apitable/all-in-one:${IMAGE_TAG}"]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🤖 OpenAI

The platforms attribute has been added. Remove the args attribute and consider adding a comment to clarify the intention of the platforms attribute.

Suggested change
SEMVER_FULL = SEMVER_FULL
IMAGE_TAG = IMAGE_TAG
}
platforms = ["linux/amd64"]
tags = ["${IMAGE_REGISTRY}/apitable/all-in-one:latest", "${IMAGE_REGISTRY}/apitable/all-in-one:${IMAGE_TAG}"]
}
platforms = ["linux/amd64"]
tags = ["${IMAGE_REGISTRY}/apitable/all-in-one:latest", "${IMAGE_REGISTRY}/apitable/all-in-one:${IMAGE_TAG}"]
}

@networkhermit networkhermit merged commit a171d56 into develop Jul 19, 2023
19 of 21 checks passed
@networkhermit networkhermit deleted the feat/enable-experimental-multi-arch-build branch July 19, 2023 14:29
@networkhermit networkhermit linked an issue Jul 20, 2023 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Docker ARM 版本镜像(pre-init-db、init-db和init-appdata) feat: arm64 dual image build
2 participants