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 qemu arm64 builds #2879

Merged
merged 2 commits into from
May 3, 2023
Merged

fix qemu arm64 builds #2879

merged 2 commits into from
May 3, 2023

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Apr 26, 2023

Changes

This PR adds ERL_FLAGS=+JPperf true to public image builds to stop it from segfaulting in qemu when building for arm64. More info for why it works: erlang/otp#6340 (once v26 is released, we can switch to +JMsingle bool)

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@bundlemon
Copy link

bundlemon bot commented Apr 26, 2023

BundleMon

Unchanged files (7)
Status Path Size Limits
static/css/app.css
492.34KB -
static/js/dashboard.js
298.06KB -
static/js/app.js
12.13KB -
static/js/embed.host.js
5.58KB -
static/js/embed.content.js
5.06KB -
tracker/js/plausible.js
733B -
static/js/applyTheme.js
314B -

No change in files bundle size

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@ruslandoga
Copy link
Contributor Author

ruslandoga commented Apr 26, 2023

I've tagged this commit v2.0.0-rc.0 to check if the build is fixed.


UPDATE: seems fixed. I'll try running that image on aws t4g (arm64 instance)


UPDATE: the container doesn't start on aws t4g

$ uname -a
Linux ip-172-31-24-175.ap-southeast-1.compute.internal 6.1.23-36.46.amzn2023.aarch64 #1 SMP Mon Apr 10 22:42:58 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

$ sudo docker run --rm -ti --platform linux/arm64 plausible/analytics:v2.0.0-rc.0 ash
exec /entrypoint.sh: exec format error

Seems like

FROM alpine:3.17.0@sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c

pins to amd64

Ping @cnkk

$ docker inspect alpine:3.17.0@sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c --format "{{ .Architecture }}"
amd64

Is it possible to pin to multi-arch image? Seems not.

But maybe we can provide sha in build args like ALPINE_SHA_arm64=... and ALPIEN_SHA_amd64=c0d488a8... and then in the Dockerfile

FROM  alpine:3.17.0@sha256:$ALPINE_SHA_${TARGETARCH}

this doesn't work but maybe some similar approach would.


UPDATE: unpinning to

FROM alpine:3.17.0

lets it build on aws t4g.

$ docker run -ti --rm local-build ash
~ $ uname -a
Linux 483704a3d705 6.1.23-36.46.amzn2023.aarch64 #1 SMP Mon Apr 10 22:42:58 UTC 2023 aarch64 Linux

It starts analytics too.

I'll try unpinning it in this PR and run the resulting image on aws t4g again.


UPDATE: the image works both on t4g and t2 instances, https://who.copycat.fun is now running plausible/analytics:v2.0.0-rc.0 on aws t2.micro.

@ruslandoga ruslandoga marked this pull request as draft April 26, 2023 13:35
@cnkk
Copy link
Member

cnkk commented Apr 26, 2023

Is it possible to pin to multi-arch image? Seems not.

Correct, this won't work. Images built from the same Dockerfile and base image but with different architectures will have a different sha256 hashsum.

But maybe we can provide sha in build args like ALPINE_SHA_arm64=... and ALPIEN_SHA_amd64=c0d488a8... and then in the Dockerfile

The problem with moving the sha256 hash to a variable is, that we'll loose the dependabot auto updates for the image.
IMO you can continue with removing the fixed hash and we will try to re-add this in the future somehow (at least for production images).

@ruslandoga ruslandoga marked this pull request as ready for review April 27, 2023 04:39
@ruslandoga ruslandoga requested a review from cnkk April 27, 2023 04:40
@aerosol aerosol merged commit 885ccaa into master May 3, 2023
@aerosol aerosol deleted the fix-arm64-qemu-builds branch May 3, 2023 11:13
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.

None yet

3 participants