CardanoSolutions / ogmios

❇️ A WebSocket JSON/RPC bridge for Cardano
https://ogmios.dev
Mozilla Public License 2.0
303 stars 90 forks source link

Docker image cardano-node-ogmios fails to execute on aarch64 architecture #422

Closed nielstron closed 2 hours ago

nielstron commented 2 hours ago

What Git revision / release tag are you using?

v6.8.0_9.2.0-preview

Do you use any client SDK? If yes, which one?

None

Describe what the problem is?

I also tried v6.8.0_9.1.1-preview and v6.7.1_9.1.1-preview

I have the following docker-compose.yaml (from the opshin-pioneer-program) and tried to host an ogmios-preview instance for new students to get up to speed quickly on a server hosted by opshin already (arm64)

https://github.com/OpShin/opshin-pioneer-program/blob/63c1336181674a15c2357f641c4329118a02b1d8/docker-compose.yaml

When starting this with docker compose up the following error gets thrown:

docker compose up
[+] Running 10/10
 ✔ ogmios Pulled                                                                                                                                                                             6.1s 
   ✔ 362bc2f05844 Already exists                                                                                                                                                             0.0s 
   ✔ 38ff75fb3a1b Already exists                                                                                                                                                             0.0s 
   ✔ 04f1cfca6ae6 Pull complete                                                                                                                                                              3.0s 
   ✔ d3190daeee56 Pull complete                                                                                                                                                              3.0s 
   ✔ ccb1779bdf83 Pull complete                                                                                                                                                              3.0s 
   ✔ 982a4b0cc2a7 Pull complete                                                                                                                                                              4.1s 
   ✔ 4c61209955b3 Pull complete                                                                                                                                                              4.1s 
   ✔ e3f892e98f76 Pull complete                                                                                                                                                              4.1s 
   ✔ cff9e76e2727 Pull complete                                                                                                                                                              4.1s 
[+] Running 1/1
 ✔ Container opshin-pioneer-program-ogmios-1  Recreated                                                                                                                                      0.1s 
Attaching to ogmios-1
ogmios-1  | exec /tini: exec format error
ogmios-1 exited with code 1

uname gives

uname -a
Linux *** 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:30:28 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

What should be the expected behavior?

The docker image should spin up as expected.

If applicable, what are the logs from the server around the occurence of the problem?

See problem description

KtorZ commented 2 hours ago

aarch64 is not supported for the cardano-node-ogmios image for it is not supported by the base cardano-node image. We could fancy using alternative docker images such as the ones from BlinkLabs which has supports for aarch64 / armv8 images.

nielstron commented 2 hours ago

One workaround for anyone stumbling accross this is running binfmt to add support for amd64 manually

$docker run --privileged --rm tonistiigi/binfmt --install amd64
installing: amd64 OK
{
  "supported": [
    "linux/arm64",
    "linux/amd64",
    "linux/arm/v7",
    "linux/arm/v6"
  ],
  "emulators": [
    "python3.10",
    "qemu-x86_64"
  ]
}
 $ docker compose up
[+] Running 1/0
 ✔ Container opshin-pioneer-program-ogmios-1  Created                                                                                                                                        0.0s 
Attaching to ogmios-1
ogmios-1  | Node configuration: NodeConfiguration {ncSocketConfig = SocketConfig {ncNodeIPv4Addr = Last {getLast = Just 0.0.0.0}, ncNodeIPv6Addr = Last {getLast = Nothing}, ncNodePortNumber = Last {getLast = Just 3000}, ncSocketPath = Last {getLast = Just "/ipc/node.socket"}}, ncConfigFile = "/config/cardano-node/config.json", ncTopologyFile = "/config/cardano-node/topology.json", ncDatabaseFile = "/db", ncProtocolFiles = ProtocolFilepaths {byronCertFile = Nothing, byronKeyFile = Nothing, shelleyKESFile = Nothing, shelleyVRFFile = Nothing, shelleyCertFile = Nothing, shelleyBulkCredsFile = Nothing}, ncValidateDB = False, ncShu
...

Albeit still no preview instance hosted by opshin since this appears to exceed the server RAM and gets OOM killed eventually