eth-infinitism/bundler

Test docker fails to run

Closed this issue · 3 comments

tenuki commented

When running the docker-compose in dockers/test, the bundle container fails to run with the error below.

Launch:

$ ./aabundler-launcher.sh start
Creating network "geth-dev_default" with the default driver
Pulling bundler (accountabstraction/bundler:)...
latest: Pulling from accountabstraction/bundler
5b18dd3a8fc6: Pull complete
a28de039d9b6: Pull complete
a67a939353a3: Pull complete
ddfb18524a5c: Pull complete
b2a0178bf962: Pull complete
64e388ab7361: Pull complete
8eb8d57ab568: Pull complete
d751ba846103: Pull complete
bd0a59e111d6: Pull complete
Digest: sha256:aaa655ac2f486b6fc1ffad6eb2de420786fb086a85fa87a152292b6e394cb451
Status: Downloaded newer image for accountabstraction/bundler:latest
Building geth-dev
[+] Building 2.4s (5/5) FINISHED                                                                                                                                               docker:default
 => [internal] load .dockerignore                                                                                                                                                        0.2s
 => => transferring context: 2B                                                                                                                                                          0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                     0.2s
 => => transferring dockerfile: 474B                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/ethereum/client-go:release-1.10                                                                                                               2.0s
 => CACHED [1/1] FROM docker.io/ethereum/client-go:release-1.10@sha256:03604c12f6123fda67f534c9a68a73dbabd35d5c0a13f0c6cfcf735cfd8760c8                                                  0.0s
 => exporting to image                                                                                                                                                                   0.0s
 => => exporting layers                                                                                                                                                                  0.0s
 => => writing image sha256:1a8e603dfe59386bb1a289c4e223e44984ff2b87aaf0e4057f43b91b7e350d16                                                                                             0.0s
 => => naming to docker.io/library/geth-dev_geth-dev                                                                                                                                     0.0s
WARNING: Image for service geth-dev was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating geth-dev_bundler_1  ... done
Creating geth-dev_geth-dev_1 ... done

At this point, in other console:

$ docker ps -a
CONTAINER ID   IMAGE                        COMMAND                  CREATED              STATUS                          PORTS                                                                       NAMES
029c9231641f   geth-dev_geth-dev            "/bin/sh -c 'geth   …"   About a minute ago   Up About a minute               8546/tcp, 0.0.0.0:8545->8545/tcp, :::8545->8545/tcp, 30303/tcp, 30303/udp   geth-dev_geth-dev_1
d6abd4af1fd2   accountabstraction/bundler   "/app/bundler.sh --n…"   About a minute ago   Exited (1) About a minute ago                                                                               geth-dev_bundler_1

$ docker logs d6abd4af1fd2
exec /app/bundler.sh: exec format error

In my case I was able to workaround the problem by changing the bundler image, locally building one with this change in file: dockers/bundler/bundler/sh:

#!/bin/sh
-exec node `dirname $0`/bundler.js "$@"
+node `dirname $0`/bundler.js "$@"

Environment with the problem:

  • docker image ls:
accountabstraction/bundler      latest        9841ce9e49d2   5 months ago    194MB

exec format error is a notorious issue with docker: our images are built for Linux, and you probably run than locally on mac. Mac attempts to built an "apple silicon" docker image, and complain on the Linux binary.
a workaround is to explicitly specify:

export DOCKER_DEFAULT_PLATFORM=linux/amd64
tenuki commented

exec format error is a notorious issue with docker: our images are built for Linux, and you probably run than locally on mac. Mac attempts to built an "apple silicon" docker image, and complain on the Linux binary. a workaround is to explicitly specify:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

@drortirosh thanks for your reply. The problem was actually in a linux box:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 21.2
Release:	21.2
Codename:	victoria
$ uname -a
Linux T460p 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

I have this question:

is using exec an optimization?

afaik, the only difference with exec is that it doesn't "spawn" a new executable, but replaces the current process.
That docker images works both on local (linux, macos), and also on CI (in our bundler-test-executor - e.g. here

anyway, this entire "test" folder is unused for quite some time, and I'm going to remove it.