openwallet-foundation / acapy

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
412 stars 512 forks source link

Error deploying with docker on arm64 system #2129

Closed vitorestevamia closed 1 year ago

vitorestevamia commented 1 year ago

I'm trying to deploy the agent on a raspberrypi 4 (arm64v8 system) with docker but he image's platform is amd64 only. I did not found any variation of the image for this system. Is there any different image i can use or a way to build my own?

docker compose file:

version: "3.5"

services:
  agent:
    image: bcgovimages/aries-cloudagent:py36-1.16-1_0.7.5

    container_name: agent-${AGENT_NAME}
    environment:
      ACAPY_ENDPOINT: "${ENDPOINT}:${AGENT_PORT}"
      ACAPY_LABEL: "${AGENT_NAME}"

      ACAPY_ADMIN_INSECURE_MODE: "true"
      ACAPY_AUTO_PROVISION: "true"
      ACAPY_LOG_LEVEL: "info"

      ACAPY_GENESIS_URL: "http://dev.bcovrin.vonx.io/genesis"
      ACAPY_WALLET_TYPE: "indy"
      ACAPY_WALLET_SEED: "${WALLET_SEED}"
      ACAPY_WALLET_NAME: "wallet${AGENT_NAME}"
      ACAPY_WALLET_KEY: "walletkey"

    entrypoint: /bin/bash
    command: ["-c",
        "aca-py start \
        --inbound-transport http '0.0.0.0' ${AGENT_PORT} \
        --outbound-transport http \
        --admin '0.0.0.0' ${ADMIN_PORT}"
    ]
    ports:
      - "${ADMIN_PORT}:${ADMIN_PORT}"
      - "${AGENT_PORT}:${AGENT_PORT}"

terminal output:

pi@raspberrypi:~$ docker compose --env-file .env up
[+] Running 16/16
 ⠿ agent Pulled                                                 28.8s
   ⠿ 25fa05cd42bd Already exists                                 0.0s
   ⠿ 5a34de941c01 Already exists                                 0.0s
   ⠿ 6cc28c0a6c31 Already exists                                 0.0s
   ⠿ 4f4fb700ef54 Already exists                                 0.0s
   ⠿ c525056b4e0b Already exists                                 0.0s
   ⠿ 395ee1648f40 Already exists                                 0.0s
   ⠿ 0d388e985b6a Already exists                                 0.0s
   ⠿ fed55ff98fdf Already exists                                 0.0s
   ⠿ a3db232b9e91 Already exists                                 0.0s
   ⠿ 268e78079620 Already exists                                 0.0s
   ⠿ 107f00f66495 Already exists                                 0.0s
   ⠿ 5569e1c6653d Already exists                                 0.0s
   ⠿ bb6993f7d73d Pull complete                                  2.7s
   ⠿ 0ab206c116fe Pull complete                                  3.4s
   ⠿ eab48a5ff6f0 Pull complete                                 26.7s
[+] Running 0/1
 ⠸ Container agent-testing                                                                                                                              Recreate 8.3s
[+] Running 0/2quested image's platform (linux/amd64) does not match t ⠼ Container agent-testing                                                                                                                              Recreate 8.4s
[+] Running 1/2quested image's platform (linux/amd64) does not match t ⠿ Container agent-testing                                                                                                                              Recreated 8.5s
 ⠹ agent The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested  0.0s
Attaching to agent-testing
agent-testing  | exec /bin/bash: exec format error
agent-testing exited with code 1
WadeBarnes commented 1 year ago

Here is a comment @PatStLouis made on the Hyperledger Discord #aries-embedded channel:

I had great success running aca-py on a raspberry pi in a docker container using QUS https://dbhi.github.io/qus/ You can even setup a fleet on balena cloud (max 10 agents in the free tier) and expose the agent inbound port https://www.balena.io/cloud

WadeBarnes commented 1 year ago

We will be publishing multiarchitecture images that will have support for ARM. We are currently working though some dependency issues related to this; https://github.com/hyperledger/aries-cloudagent-python/issues/2124

vitorestevamia commented 1 year ago

Nice, i'll run some tests using QUS! Thank you @WadeBarnes and @PatStLouis for sharing this ;)

Do you have any idea of when the multiarchitecture images will come out?

WadeBarnes commented 1 year ago

The multiarchitecture images will be available as soon as the askar dependencies publish the supporting binaries. In most cases I think it's just a matter of bumping the version defined in aca-py. The bbs dependency may lag behind a bit, but I don't think it's a blocker for many use cases.

vitorestevamia commented 1 year ago

About using QUS, this emulator based on it worked pretty well in my case and it's very straightforward to use https://github.com/tonistiigi/binfmt

For anyone having this problem, you just need to:

  1. Emulate amd64

    docker run --privileged --rm tonistiigi/binfmt --install amd64
  2. Add platform field on your docker-compose service and set it to linux/amd64

    services:
    agent:
    platform: linux/amd64
    image: bcgovimages/aries-cloudagent:py36-1.16-1_0.7.5
    ...
  3. Run it :D

    docker compose up

    Thank you @WadeBarnes for the fast and effective help.

arminveres commented 11 months ago

The multiarchitecture images will be available as soon as the askar dependencies publish the supporting binaries. In most cases I think it's just a matter of bumping the version defined in aca-py. The bbs dependency may lag behind a bit, but I don't think it's a blocker for many use cases.

Hi there, am I right in guessing, that there still isn't (official) support for arm64?