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 15 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
44 changes: 28 additions & 16 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,25 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
# Checkout code
- uses: actions/checkout@v3
- name: Build image
run: docker buildx build . --tag "epicwink/proxpi:${{ github.ref_name }}"

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

# Build amd64 for testing
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: epicwink/proxpi:${{ github.ref_name }}
platforms: linux/amd64

# Run tests
- name: Run unit-tests in image
run: docker run
--rm
Expand All @@ -20,21 +36,17 @@ jobs:
sh -c 'pip install --requirement /srv/tests/requirements.txt
&& pytest -vvra /srv/tests'
- name: Run image test
run: tests/test-docker-image.sh "${{ github.ref_name }}"
run: tests/test-docker-image.sh "epicwink/proxpi:${{ github.ref_name }}"

# Build all architectures and push to dockerhub
- name: Login to DockerHub
run: >
echo ${{ secrets.DOCKERHUB_PASSWORD }}
| docker login --password-stdin -u epicwink
- name: Publish image
run: docker push "epicwink/proxpi:${{ github.ref_name }}"
- name: Check tag
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: steps.check-tag.outputs.match == 'true'
run: |
docker tag "epicwink/proxpi:${{ github.ref_name }}" epicwink/proxpi:latest
docker push epicwink/proxpi:latest
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
push: true
tags: epicwink/proxpi:${{ github.ref_name }},epicwink/proxpi:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.12-alpine

RUN --mount=source=.,target=/root/src/proxpi,rw \
uname -a && cat /etc/issue && apk --version && python --version && pip --version \
&& apk --no-cache add git \
&& apk --no-cache add git build-base libxslt-dev libxml2-dev \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had build failures related to the lxml library which expects gcc and these libraries to be available to build. They likely don't build arm wheels so lxml needs to build from source.

&& git -C /root/src/proxpi restore .dockerignore \
&& pip install --no-cache-dir --no-deps \
--requirement /root/src/proxpi/app.requirements.txt \
Expand Down
4 changes: 2 additions & 2 deletions tests/test-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

Expand Down