-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add support for arm64 #2589
base: main
Are you sure you want to change the base?
Add support for arm64 #2589
Conversation
Hi @mathieu-benoit ! What do you think is the effort needed to make this work? From comments here it looks like there's still a ton of want for this feature: #622 |
@bourgeoisor and @NimJay, please could you approve the CI tests on this PR? I'd like to see what my latest changes will produce. Thanks! |
@mathieu-benoit tests are passing. Thank you for your patience; getting back from the holidays! Feel free to DM me if I don't respond within a few days. |
@bourgeoisor, thanks! I think this is now ready for your review. Again, it's not publishing the |
@mathieu-benoit , I've tested the branch with Apple M1. The branch seems to fix the build issues. The resulting images seem to be ARM64 as well. |
Thanks @vlsi, for testing and following up, that's good news! |
Hi @mathieu-benoit! I just tested this by
|
@vlsi, guessing that's the same for you where @bourgeoisor, could you please deploy the |
Looks like the services are fine for me:
Here's the output from the loadgenerator pod:
Previously, I was trying to adjust SHAs since they referred AMD64 ids. For instance (see https://hub.docker.com/layers/library/python/3.12.7-alpine/images/sha256-b83d5ec7274bee17d2f4bd0bfbb082f156241e4513f0a37c70500e1763b1d90d). The images are multi-arch ones, so we should use multi-arch sha rather than amd64 sha) -FROM python:3.12.7-alpine@sha256:b83d5ec7274bee17d2f4bd0bfbb082f156241e4513f0a37c70500e1763b1d90d AS base
+FROM python:3.12.7-alpine@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98 AS base However, I reverted the changes when trying the PR branch. |
I just checked
|
@vlsi, this 👆 is a really good point, I should update the Dockerfiles accordingly, commit about that coming soon, it will be a good start to continue the tests based on that. I'll keep you posted when done. Thanks for your help and your patience! 😃 |
@bourgeoisor, could you please approve the run of the CI with latest commits? Thanks! |
The build fails now:
|
The following fixes the build to a certain degree: diff --git a/src/emailservice/Dockerfile b/src/emailservice/Dockerfile
index 9105a5a5..3a69c2a3 100644
--- a/src/emailservice/Dockerfile
+++ b/src/emailservice/Dockerfile
@@ -17,7 +17,7 @@ FROM --platform=$BUILDPLATFORM python:3.12.8-alpine@sha256:54bec49592c8455de8d59
FROM base AS builder
RUN apk update \
- && apk add --no-cache wget g++ \
+ && apk add --no-cache wget g++ linux-headers libstdc++ \
&& rm -rf /var/cache/apk/*
# get packages
diff --git a/src/recommendationservice/Dockerfile b/src/recommendationservice/Dockerfile
index 72add8de..3653e7b6 100644
--- a/src/recommendationservice/Dockerfile
+++ b/src/recommendationservice/Dockerfile
@@ -20,8 +20,18 @@ RUN apk update \
&& apk add --no-cache \
wget \
g++ \
+ linux-headers \
+ libstdc++ \
&& rm -rf /var/cache/apk/* However, both
|
Here's the fix: diff --git a/src/emailservice/Dockerfile b/src/emailservice/Dockerfile
index 9105a5a5..6f6c2dcb 100644
--- a/src/emailservice/Dockerfile
+++ b/src/emailservice/Dockerfile
@@ -17,7 +17,7 @@ FROM --platform=$BUILDPLATFORM python:3.12.8-alpine@sha256:54bec49592c8455de8d59
FROM base AS builder
RUN apk update \
- && apk add --no-cache wget g++ \
+ && apk add --no-cache wget g++ linux-headers \
&& rm -rf /var/cache/apk/*
# get packages
@@ -30,6 +30,11 @@ ENV PYTHONUNBUFFERED=1
# Enable Profiler
ENV ENABLE_PROFILER=1
+RUN apk update \
+ && apk add --no-cache \
+ libstdc++ \
+ && rm -rf /var/cache/apk/*
+
WORKDIR /email_server
# Grab packages from builder
diff --git a/src/recommendationservice/Dockerfile b/src/recommendationservice/Dockerfile
index 72add8de..6c661479 100644
--- a/src/recommendationservice/Dockerfile
+++ b/src/recommendationservice/Dockerfile
@@ -20,6 +20,7 @@ RUN apk update \
&& apk add --no-cache \
wget \
g++ \
+ linux-headers \
&& rm -rf /var/cache/apk/*
# get packages
@@ -30,6 +31,11 @@ FROM base
# Enable unbuffered logging
ENV PYTHONUNBUFFERED=1
+RUN apk update \
+ && apk add --no-cache \
+ libstdc++ \
+ && rm -rf /var/cache/apk/*
+
# get packages
WORKDIR /recommendationservice |
Thanks @vlsi, this #2589 (comment) did it indeed, awesome! JFYI, with the new availability today of the @vlsi, could you please give it a try on your end to check that everything is working successfully? Same for you @bourgeoisor with |
For some reason I'm now unable to build the emailservice. I keep getting a fail exactly here. Tested 3 times, fails exactly at the same spot.
|
This PR has not yet perfectly tested the full
arm64
support, but it's helping make progress towards this goal.Here is what covers this PR:
arm64
support mathieu-benoit/sail-sharp#162 forcartservice
.score-compose && docker compose
on bothamd64
andarm64
GitHub Runners: Test OnlineBoutique on both platforms:linux/amd64
andlinux/arm64
mathieu-benoit/microservices-demo#2Here is what this PR is waiting for before going in an official "Ready for review" state from "Draft":
skaffold run
still works and that the repo still works on the defaultamd64
platform/OS: https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/.github/workflows/ci-pr.yaml#L88C9-L88C21.Here is what this PR is not covering and has not yet tested:
scaffold dev
from anarm64
platform/OSarm64
manifest entry for each container image published at each release of this repo - this needs more investigation. Something to change there https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/docs/releasing/make-docker-images.sh#L43?kubectl apply -f
on anarm64
Kubernetes clusterJFYI, not related to the
arm64
support, here is what has been done too while here:adservice
:eclipse-temurin:21.0.4_7
-->eclipse-temurin:21.0.5_11
cartservice
: .NET9.0.0
-->9.0.1
checkoutservice
,frontend
,productcatalogservice
,shippingservice
:golang:1.23.2
-->golang:1.23.4
currencyservice
,paymentservice
:node:20.17.0-alpine
-->node:20.18.1-alpine
emailservice
:python:3.12.7-alpine
-->python:3.12.8-alpine
loadgenerator
:python:3.12.8-slim
-->python:3.12.8-alpine
shoppingassistantservice
:python:3.12.6-slim
-->python:3.12.8-slim