-
Notifications
You must be signed in to change notification settings - Fork 746
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
DEV: Build base images for ARM64 platform in a seperate daily job #744
Closed
+168
−33
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
98f70c3
DEV: Build base images for ARM64 platform in a seperate daily job
tgxworld aa89cbb
DEV: Add job for building the discourse/discourse_test images for arm64
tgxworld 1b22084
DEV: Add job for building Discourse dev release image for arm64
tgxworld efd4424
DEV: Hack using a locally build slim image for now to get faster
tgxworld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
on: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
concurrency: | ||
group: build-arm64-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
BUILDKIT_PROGRESS: plain | ||
|
||
jobs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is alot of duplication between this new workflow and |
||
base: | ||
runs-on: ubuntu-20.04 | ||
services: | ||
registry: | ||
image: registry | ||
ports: | ||
- 5000:5000 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
# - name: build slim image | ||
# run: | | ||
# cd image && ruby auto_build.rb base_slim_arm64 | ||
# - name: tag slim images | ||
# id: tag-images | ||
# run: | | ||
# TAG=`date +%Y%m%d-%H%M` | ||
# echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT | ||
# docker tag discourse/base:build_slim_arm64 discourse/base:2.0.$TAG-slim-arm64 | ||
# docker tag discourse/base:build_slim_arm64 discourse/base:slim-arm64 | ||
# docker push localhost:5000/discourse/base:build_slim_arm64 | ||
- name: build release image | ||
run: | | ||
cd image && ruby auto_build.rb base_arm64 --build-arg from=tgxworld/base | ||
- name: tag release images | ||
run: | | ||
# TAG=${{ steps.tag-images.outputs.tag }} | ||
# docker tag discourse/base:build_arm64 discourse/base:2.0.$TAG-arm64 | ||
# docker tag discourse/base:build_arm64 discourse/base:release-arm64 | ||
docker tag discourse/base:build_arm64 localhost:5000/discourse/base:build_arm64 | ||
docker push localhost:5000/discourse/base:build_arm64 | ||
- name: build test_build image | ||
run: | | ||
cd image && ruby auto_build.rb discourse_test_build_arm64 --build-arg from=localhost:5000/discourse/base | ||
- name: run specs | ||
run: | | ||
docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build_arm64 | ||
- name: Print summary | ||
run: | | ||
docker images discourse/base | ||
- name: push to dockerhub | ||
if: success() && (github.ref == 'refs/heads/main') | ||
env: | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
run: | | ||
TAG=${{ steps.tag-images.outputs.tag }} | ||
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD | ||
docker push discourse/base:2.0.$TAG-slim-arm64 | ||
docker push discourse/base:slim-arm64 | ||
docker tag discourse/base:slim-arm64 discourse/base:aarch64 | ||
docker push discourse/base:2.0.$TAG-arm64 | ||
docker push discourse/base:release-arm64 | ||
docker push discourse/base:aarch64 | ||
test: | ||
runs-on: ubuntu-20.04 | ||
needs: base | ||
defaults: | ||
run: | ||
working-directory: image/discourse_test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: build discourse/discourse_test:slim-arm64 | ||
run: | | ||
docker buildx build . --load \ | ||
--build-arg from_tag=slim-arm64 \ | ||
--target base \ | ||
--tag discourse/discourse_test:slim-arm64 | ||
- name: build discourse/discourse_test:slim-browsers-arm64 | ||
run: | | ||
docker buildx build . --load \ | ||
--build-arg from_tag=slim-arm64 \ | ||
--target with_browsers \ | ||
--tag discourse/discourse_test:slim-browsers-arm64 | ||
- name: build discourse/discourse_test:release-arm64 | ||
run: | | ||
docker buildx build . --load \ | ||
--build-arg from_tag=release-arm64 \ | ||
--target release \ | ||
--tag discourse/discourse_test:release-arm64 | ||
- name: Print summary | ||
run: | | ||
docker images discourse/discourse_test | ||
- name: push to dockerhub | ||
if: success() && (github.ref == 'refs/heads/main') | ||
env: | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
run: | | ||
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD | ||
docker push discourse/discourse_test:slim-arm64 | ||
docker push discourse/discourse_test:slim-browsers-arm64 | ||
docker push discourse/discourse_test:release-arm64 | ||
dev: | ||
runs-on: ubuntu-20.04 | ||
needs: base | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: build discourse/discourse_dev:release-arm64 image | ||
run: | | ||
cd image && ruby auto_build.rb discourse_dev_arm64 | ||
- name: push to dockerhub | ||
if: success() && (github.ref == 'refs/heads/main') | ||
env: | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
run: | | ||
docker tag discourse/discourse_dev:build_arm64 discourse/discourse_dev:release-arm64 | ||
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD | ||
docker push discourse/discourse_dev:release-arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling it on pull requests first so that we run the job in this PR and I know I got things right. Will remove before merging.