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

28 add arm support #45

Merged
merged 28 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
28ea1f1
Added buildx arm support
nuvious Mar 15, 2024
493a3ec
Attempt to fix buildx issue
nuvious Mar 15, 2024
00fcab4
Disabling these workflows temporarily.
nuvious Mar 15, 2024
c961046
Corrected syntax of buildx setup
nuvious Mar 15, 2024
3920380
Fixed issue with platform dependency in alpine for libxml2 and libxsl…
nuvious Mar 15, 2024
b130f4e
Fixed dependency for gcc
nuvious Mar 15, 2024
48ec561
Reduced number of platforms; seems lxml is not compatible with linux/386
nuvious Mar 15, 2024
9fee2e9
More tweaks to the dockerifle to support building lxml
nuvious Mar 15, 2024
bec74da
Switching to my docker repo
nuvious Mar 15, 2024
eee2054
Trying again, something keeps reverting on this.
nuvious Mar 15, 2024
1fa7166
Trying a different build action
nuvious Mar 15, 2024
075a264
One more change to get through the CICD fully.
nuvious Mar 15, 2024
98a4493
Modified test-docker-image so it doesn't have to be modified for cont…
nuvious Mar 15, 2024
c5a196c
Restoring state for PR
nuvious Mar 16, 2024
064d1be
Minor modification to minimize changes for pr
nuvious Mar 16, 2024
19e8093
Trying to reduce the image size a bit
nuvious Mar 16, 2024
bd59e56
Reverting and branching before trying to do dockerhub testing
nuvious Mar 16, 2024
f9e3092
Modular build and release phase that tests arm64 using qemu
nuvious Mar 18, 2024
14f717d
Removed limitation on parallel jobs used duing
nuvious Mar 18, 2024
bfad1b4
Bumped checkout version to resolve node.js warning.
nuvious Mar 18, 2024
a54ef37
Minor adjustment to comment in test-docker-image.sh
nuvious Mar 18, 2024
f43e3a4
Restricting build to arm64 no longer requires modifying the dockerfil…
nuvious Mar 18, 2024
3465306
Newline re-added after removed in error.
nuvious Mar 18, 2024
a1822ff
Format and style
EpicWink Mar 19, 2024
4e038bc
Test Docker image in main and pull-requests
EpicWink Mar 19, 2024
cc5d3e3
Handle invalid refs for Docker tag
EpicWink Mar 19, 2024
d07185f
Merge remote-tracking branch 'origin/master' into pr/nuvious/45
EpicWink Mar 19, 2024
02bdb3e
Only push latest on release versions
EpicWink Mar 19, 2024
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
88 changes: 69 additions & 19 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,89 @@ env:
REF_SLUG: ${{ contains(github.ref_name, '/') && github.sha || github.ref_name }}

jobs:
release:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- name: linux/amd64
image-suffix: amd64
- name: linux/arm64
image-suffix: arm64

steps:
- uses: actions/checkout@v3
- name: Build image
run: docker buildx build . --tag "epicwink/proxpi:${{ env.REF_SLUG }}"
- name: Run unit-tests in image
- uses: actions/checkout@v4

- name: Set up QEMU
if: ${{ matrix.platform.name != 'linux/amd64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform.name }}

- name: Set up Docker Buildx to support multiple architectures
if: ${{ matrix.platform.name != 'linux/amd64' }}
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ matrix.platform.name }}

- name: Build ${{ matrix.platform.image-suffix }} for testing
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: epicwink/proxpi:${{ env.REF_SLUG }}-${{ matrix.platform.image-suffix }}
platforms: ${{ matrix.platform.name }}

- name: Run unit-tests in image for ${{ matrix.platform.image-suffix }}
run: docker run
--rm
--volume "$(pwd)/tests:/srv/tests"
--entrypoint ''
"epicwink/proxpi:${{ env.REF_SLUG }}"
sh -c 'pip install --requirement /srv/tests/requirements.txt
"epicwink/proxpi:${{ env.REF_SLUG }}-${{ matrix.platform.image-suffix }}"
sh -c 'uname -a && pip install --requirement /srv/tests/requirements.txt
&& pytest -vvra /srv/tests'
- name: Run image test
run: tests/test-docker-image.sh "${{ env.REF_SLUG }}"

- name: Run image test for ${{ matrix.platform.image-suffix }}
run: tests/test-docker-image.sh
"epicwink/proxpi:${{ env.REF_SLUG }}-${{ matrix.platform.image-suffix }}"

build-and-publish:
if: ${{ github.event_name == 'release' }}
needs: ['build-and-test']
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx to support multiple architectures
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Login to DockerHub
if: ${{ github.event_name == 'release' }}
run: >
echo ${{ secrets.DOCKERHUB_PASSWORD }}
| docker login --password-stdin -u epicwink
- name: Publish image
if: ${{ github.event_name == 'release' }}
run: docker push "epicwink/proxpi:${{ env.REF_SLUG }}"

- name: Push all architectures
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: epicwink/proxpi:${{ github.ref_name }}

- name: Check tag
if: ${{ github.event_name == 'release' }}
id: check-tag
run: |
if [[ "${{ github.ref_name }}" =~ '^v\d+\.\d+\.\d+$' ]]; then
echo ::set-output name=match::true
fi
- name: Publish latest image
if: ${{ github.event_name == 'release' && steps.check-tag.outputs.match == 'true' }}
run: |
docker tag "epicwink/proxpi:${{ env.REF_SLUG }}" epicwink/proxpi:latest
docker push epicwink/proxpi:latest

- name: Push all architectures
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: epicwink/proxpi:latest
5 changes: 2 additions & 3 deletions tests/test-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

# Test Docker image
#
# Usage: test-docker-image.sh TAG
# where TAG is Docker image tag (not including repository)
# Usage: test-docker-image.sh REPO/IMAGE:TAG
EpicWink marked this conversation as resolved.
Show resolved Hide resolved

# Make command errors cause script to fail
set -e
Expand All @@ -21,7 +20,7 @@ cleanUp () {
# Start proxpi server
container="$(docker create \
--publish 5042:5000 \
"epicwink/proxpi:$1"
"$1"
)"
echo "created container: $container" 1>&2

Expand Down
Loading