microservices-demo icon indicating copy to clipboard operation
microservices-demo copied to clipboard

Unable to deploycartservice using skaffold

Open joshuasequeira19 opened this issue 1 year ago • 10 comments

Write down your inquiry

Describe the bug

Unable to deploy using skaffold run

To Reproduce

skaffold run

Logs

Waiting for deployments to stabilize...- deployment/checkoutservice is ready. [10/11 deployment(s) still pending]- deployment/productcatalogservice is ready. [9/11 deployment(s) still pending]- deployment/paymentservice is ready. [8/11 deployment(s) still pending]- deployment/cartservice: container server terminated with exit code 133- pod/cartservice-7758fb5bd6-m9xxk: container server terminated with exit code 133> [cartservice-7758fb5bd6-m9xxk server] rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2> [cartservice-7758fb5bd6-m9xxk server]- deployment/cartservice failed. Error: container server terminated with exit code 133.1/11 deployment(s) failed

Tried changing the cartservice.yaml

added --platform=linux/amd64

Screenshot 2024-11-02 at 2 56 46 AM

Got this error:

Screenshot 2024-11-02 at 2 57 26 AM

Environment

Chip: M2 Mem: 16 GB macOs: 14.4 (23E214)

skaffold version: v2.13.2 Client: Cloud integration: v1.0.35+desktop.13 Version: 26.0.0 API version: 1.45 Go version: go1.21.8 Git commit: 2ae903e Built: Wed Mar 20 15:14:46 2024 OS/Arch: darwin/arm64 Context: desktop-linux

Server: Docker Desktop 4.29.0 (145265) Engine: Version: 26.0.0 API version: 1.45 (minimum version 1.24) Go version: go1.21.8 Git commit: 8b79278 Built: Wed Mar 20 15:18:02 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0

Kindly help me out, seems I made a mistake somewhere :3

joshuasequeira19 avatar Nov 01 '24 21:11 joshuasequeira19

I have same issue on Mac mini M4 :(

dominikhaska avatar Dec 30 '24 17:12 dominikhaska

I have same issue on Mac mini M4 :(

Heyy, @dominikhaska

You can refer this by @woop

https://github.com/woop/microservices-demo

joshuasequeira19 avatar Dec 31 '24 04:12 joshuasequeira19

Hi @joshuasequeira19 and @dominikhaska , the intent of this PR https://github.com/GoogleCloudPlatform/microservices-demo/pull/2589 (WIP) is to support this.

It's not yet ready, but please could you give a try to this Dockerfile for cartservice and report back if this is working for you?

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0.100-noble AS builder
ARG TARGETARCH
WORKDIR /app
COPY cartservice.csproj .
RUN dotnet restore cartservice.csproj \
    -a $TARGETARCH
COPY . .
RUN dotnet publish cartservice.csproj \
    -p:PublishSingleFile=true \
    -a $TARGETARCH \
    --self-contained true \
    -p:PublishTrimmed=true \
    -p:TrimMode=full \
    -c release \
    -o /cartservice

FROM mcr.microsoft.com/dotnet/runtime-deps:9.0.0-noble-chiseled
WORKDIR /app
COPY --from=builder /cartservice .
EXPOSE 7070
ENV DOTNET_EnableDiagnostics=0 \
    ASPNETCORE_HTTP_PORTS=7070
USER 1000
ENTRYPOINT ["/app/cartservice"]

Note: I see that you are still with .NET 8, make sure to get the latest version of the repo, cartservice is now in .NET 9, JFYI. Otherwise this Dockerfile above needs to be adapted from .NET 9 to 8.

Thanks for your feedback as it could help improving this coming PR to better support this.

mathieu-benoit avatar Jan 09 '25 02:01 mathieu-benoit

Hi @mathieu-benoit ,

I am running kind on a Macbook M4 and tried out your latest cartservice Dockerfile.

Got the following:

` Waiting for deployments to stabilize...

  • deployment/cartservice: container server terminated with exit code 127
    • pod/cartservice-565b66f477-hv5l5: container server terminated with exit code 127

      [cartservice-565b66f477-hv5l5 server] /app/cartservice: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

  • deployment/cartservice failed. Error: container server terminated with exit code 127. `

DaveInga avatar Jan 17 '25 21:01 DaveInga

@DaveInga, thanks for the info.

Just to make sure, could you get the latest version of this branch https://github.com/mathieu-benoit/microservices-demo/tree/arm64, that's where all the latest updates are about the arm64 support and in progress. It would be ideal if you can do your tests again from there and let me know if you have still the error.

3 people there where able to deploy this cartservice successfully:

  • one on Apple M1
  • an other on both ARM MacBook and on GKE C4A nodes on GKE (ARM-based)
  • I was able to successfully deploy it on the new GH runner linux/arm64.

Let's see and learn from your Macbook M4 if there is anything we are missing there.

If you still have the issue, telling us the command you ran and the outputs of kubectl get pods + kubectl logs will help a lot. Thanks!

mathieu-benoit avatar Jan 17 '25 21:01 mathieu-benoit

Hi @mathieu-benoit ,

the latest version of https://github.com/mathieu-benoit/microservices-demo/tree/arm64 ran successfully after I started with a fresh repo / fresh kind cluster.

DaveInga avatar Jan 17 '25 23:01 DaveInga

That's good to know, @DaveInga, thanks for following up.

JFYI: @bourgeoisor

mathieu-benoit avatar Jan 18 '25 00:01 mathieu-benoit

Hi @DaveInga and @dominikhaska, just to make sure, this https://github.com/GoogleCloudPlatform/microservices-demo/pull/2589 has been merged into main, could you please give it another try? And if now successful, maybe closing this issue? Thanks for your feedback!

mathieu-benoit avatar Jan 31 '25 14:01 mathieu-benoit

I have problem with addservice still:

#13 [builder 5/9] RUN chmod +x gradlew #13 DONE 0.2s

#14 [builder 6/9] RUN ./gradlew downloadRepos #14 0.264 # #14 0.264 # A fatal error has been detected by the Java Runtime Environment: #14 0.264 # #14 0.264 # SIGILL (0x4) at pc=0x0000ffff9bd3fc5c, pid=7, tid=18 #14 0.264 # #14 0.264 # JRE version: (21.0.5+11) (build ) #14 0.264 # Java VM: OpenJDK 64-Bit Server VM (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64) #14 0.264 # Problematic frame: #14 0.264 # j java.lang.System.registerNatives()V+0 [email protected] #14 0.264 # #14 0.264 # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again #14 0.264 # #14 0.264 # An error report file with more information is saved as: #14 0.264 # /app/hs_err_pid7.log #14 0.272 [0.025s][warning][os] Loading hsdis library failed #14 0.275 # #14 0.275 # The crash happened outside the Java Virtual Machine in native code. #14 0.275 # See problematic frame for where to report the bug. #14 0.275 # #14 0.277 Aborted #14 ERROR: process "/bin/sh -c ./gradlew downloadRepos" did not complete successfully: exit code: 134

dominikhaska avatar Jan 31 '25 17:01 dominikhaska

Thanks for the feedback, @dominikhaska , appreciate it.

I think this issue you are facing is more related to this one: https://github.com/GoogleCloudPlatform/microservices-demo/issues/1347

ERROR: process "/bin/sh -c ./gradlew downloadRepos" did not complete successfully: exit code: 134

Could you look at this thread there and see the latest comment's recommendation and see if this helps?

mathieu-benoit avatar Jan 31 '25 18:01 mathieu-benoit