AxaFrance / SlimFaas

SlimFaas : The slimest and simplest Function As A Service
MIT License
171 stars 7 forks source link

Arm64 image #44

Closed didlawowo closed 4 months ago

didlawowo commented 4 months ago

Issue and Steps to Reproduce

Do you think it's possible to build un image for arm64 ?

Versions

latest

Screenshots

image

Expected

running

Actual

crashloopbackoff

Additional Details

try but several error with nugget

#18 [publish 2/7] RUN dotnet restore -r linux-musl-x64
#18 1.314   Determining projects to restore...
#18 70.88   Failed to download package 'Microsoft.NETCore.App.Runtime.linux-musl-x64.8.0.4' from 'https://api.nuget.org/v3-flatcontainer/microsoft.netcore.app.runtime.linux-musl-x64/8.0.4/microsoft.netcore.app.runtime.linux-musl-x64.8.0.4.nupkg'.
#18 70.88   I/O error : '/root/.local/share/NuGet/http-cache/670c1461c29885f9aa22c281d8b7da90845b38e4$ps:_api.nuget.org_v3_index.json/nupkg_microsoft.netcore.app.runtime.linux-musl-x64.8.0.4.dat-new'
guillaume-chervet commented 4 months ago

Hi @didlawowo, thank you for your issue.

Yes sure it will be a nice enhancement to add. Alpine have an arm64 image and dotnet have aot arm64 compilation mode.

didlawowo commented 4 months ago

i have successfully build slimfaas arm64 with

ARG RUNTIME_ID=linux-musl-arm64
# ARG RUNTIME_ID=linux-musl-x64

but i don't understand how the db work, cause there is no config to connect to the database

didlawowo commented 4 months ago

trying to build with dockerfile full arm64 and get this error

84.49 /usr/bin/ld.bfd: /__w/1/s/src/native/libs/System.Security.Cryptography.Native/pal_x509.c:490:(.text.ReadNextPublicCert+0x128): undefined reference to `fopen64'

found this

https://gitlab.alpinelinux.org/alpine/aports/-/issues/15573

guillaume-chervet commented 4 months ago

Thank you @didlawowo , yes i struggle yesteday evening to build a arm64 image. I am starting to understand that slimfaas would be awesome on arm64 architecture on small device.

guillaume-chervet commented 4 months ago

Hi @didlawowo i have a kind of deadlock during the build on full arm64/v8 https://github.com/AxaFrance/SlimFaas/actions/runs/8951482569/job/24587891272 Did you encouter that?

guillaume-chervet commented 4 months ago

It was hard but i finally succeded https://hub.docker.com/r/axaguildev/slimfaas-arm64/tags Now i need to find a way to test it.

didlawowo commented 4 months ago

i have tested, it's better than my image, but not sure it's work

Starting in namespace slimfaas
Waiting for at least 2 pods to be ready
Waiting for at least 2 pods to be ready
Adding node  http://10.0.1.74:3262/
Adding node  http://10.0.3.149:3262/
Starting node slimfaas-0
Node started slimfaas-0 http://10.0.1.74:3262/
>> Configuration: 
- partitioning:false
- lowerElectionTimeout:400
- upperElectionTimeout:800
- requestTimeout:00:01:20.0000000
- rpcTimeout:00:00:40.0000000
- publicEndPoint:http://10.0.1.74:3262/
- coldStart:false
- requestJournal:memoryLimit:5
- requestJournal:expiration:00:01:00
- heartbeatThreshold:0.2
CORS Allowing origins: *
CORS Allowing all origins
Raft cluster has no leader
Raft cluster has no leader
SlimDataSynchronizationWorker: Start
Raft cluster has no leader
RaftClientHandlerFactory.CreateHandler(raftClient)
RaftClientHandlerFactory.CreateHandler(raftClient)
New cluster leader is elected. Leader address is http://10.0.1.74:3262/
Term of local cluster member is 1. Election timeout 00:00:00.4720000
warn: DotNext.Net.Cluster.Consensus.Raft.Http.RaftHttpCluster[74015]
      Replication of http://10.0.3.149:3262/ is failed. Retry replication from entry 1
SlimDataSynchronizationWorker: SlimFaas pod slimfaas-1 has to be added in the cluster
RaftClientHandlerFactory.CreateHandler(raftClient)
warn: DotNext.Net.Cluster.Consensus.Raft.Http.RaftHttpCluster[74015]
      Replication of http://10.0.2.50:3262/ is failed. Retry replication from entry 1
RaftClientHandlerFactory.CreateHandler(raftClient)
warn: DotNext.Net.Cluster.Consensus.Raft.Http.RaftHttpCluster[74015]
      Replication of http://10.0.2.50:3262/ is failed. Retry replication from entry 2

on node 1

Starting in namespace slimfaas
Waiting current pod to be ready
Adding node  http://10.0.1.74:3262/
Adding node  http://10.0.2.50:3262/
Adding node  http://10.0.3.149:3262/
Starting node slimfaas-1
Node started slimfaas-1 http://10.0.2.50:3262/
>> Configuration: 
- partitioning:false
- lowerElectionTimeout:400
- upperElectionTimeout:800
- requestTimeout:00:01:20.0000000
- rpcTimeout:00:00:40.0000000
- publicEndPoint:http://10.0.2.50:3262/
- coldStart:false
- requestJournal:memoryLimit:5
- requestJournal:expiration:00:01:00
- heartbeatThreshold:0.2
CORS Allowing origins: *
CORS Allowing all origins
Raft cluster has no leader
Raft cluster has no leader
SlimDataSynchronizationWorker: Start
Raft cluster has no leader
RaftClientHandlerFactory.CreateHandler(raftClient)
RaftClientHandlerFactory.CreateHandler(raftClient)
RaftClientHandlerFactory.CreateHandler(raftClient)
Raft cluster has no leader
Raft cluster has no leader
Raft cluster has no leader
New cluster leader is elected. Leader address is http://10.0.1.74:3262/
Term of local cluster member is 1. Election timeout 00:00:00.5500000
guillaume-chervet commented 4 months ago

It is very verbose, it is working @didlawowo 😀

guillaume-chervet commented 4 months ago

I have merge the pullrequest and now arm64 image is included as arm64 plateform inside the default slimfaas image.