edgedb / imdbench

IMDBench — Realistic ORM benchmarking
https://edgedb.github.io/imdbench
Apache License 2.0
237 stars 24 forks source link

make load-edgedb hangs forever #52

Closed marcj closed 2 years ago

marcj commented 2 years ago
$ make load-edgedb
docker network inspect webapp-bench>/dev/null 2>&1 \
        || docker network create \
            --driver=bridge \
            --opt com.docker.network.bridge.name=br-webapp-bench \
            webapp-bench
docker volume inspect webapp-bench-edgedb >/dev/null 2>&1 \
        || docker volume create webapp-bench-edgedb
docker stop webapp-bench-edgedb >/dev/null 2>&1 || :
docker run --rm -d --name webapp-bench-edgedb \
        -v webapp-bench-edgedb:/var/lib/edgedb/data \
        -e EDGEDB_SERVER_SECURITY=insecure_dev_mode \
        --network=webapp-bench \
        -p 15656:5656 \
        edgedb/edgedb
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
9fc5eb48ec272137ff8b37f545036e0eb234a75fec64fb1cfe9e281ec63576e9
edgedb -H localhost -P 15656 \
        --tls-security=insecure --wait-until-available=120s \
        query "SELECT 'EdgeDB ready'"
$ docker logs webapp-bench-edgedb
INFO 1 2022-03-30T19:43:28.258 edb.server: starting EdgeDB server 1.2+85bef76, built on 2022-03-17T18:49Z from revision c0d870b92 (2022-03-16T02:01Z) for x86_64-unknown-linux-gnu
INFO 1 2022-03-30T19:43:32.067 edb.server: Using 74 max backend connections based on total memory.
INFO 112 2022-03-30T19:43:33.321 postgres: starting PostgreSQL 13.6 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
INFO 112 2022-03-30T19:43:33.324 postgres: listening on Unix socket "/run/edgedb/.s.PGSQL.5432"
INFO 112 2022-03-30T19:43:33.324 postgres: database system was shut down at 2022-03-30 19:43:19 UTC
INFO 112 2022-03-30T19:43:33.325 postgres: database system is ready to accept connections
INFO 1 2022-03-30T19:43:35.823 edb.server: Connection established to backend database: edgedb
INFO 1 2022-03-30T19:43:44.213 edb.server: started 5 compiler worker processes
INFO 1 2022-03-30T19:43:44.234 edb.server: Serving on {0.0.0.0, ::}:5656
INFO 1 2022-03-30T19:43:44.236 edb.server: Serving admin on /run/edgedb/.s.EDGEDB.admin.5656
$ netcat -z -v localhost 15656
localhost [127.0.0.1] 15656 open

MacOS 12.0.1 EdgeDB CLI 1.1.1+24a93b7

elprans commented 2 years ago

Are you on an ARM Mac? EdgeDB docker images don't work there unfortunately due to edgedb/edgedb-docker#24

marcj commented 2 years ago

Yes, it's ARM. Oh ok, that's unfortunate.

colinhacks commented 2 years ago

If you open Terminal.app with Rosetta it should work:

Screen Shot 2022-04-01 at 10 56 25 AM
marcj commented 2 years ago

What has a x86 terminal to do with the ARM docker engine?

colinhacks commented 2 years ago

Docker Desktop is a multi-architecture binary, so I figured it would either run in emulation or not depending on the environment that originated the docker commands. But this is working for me on my M1 Mac both with and without emulation so I'm not sure.

marcj commented 2 years ago

This really worked for you? As far as I understand it, conceptually the docker command in Docker on Mac communicates with the Docker engine running inside a (ARM) virtual machine. In this ARM virtual machine are living all containers. The virtual machine is always an ARM architecture on a M1 mac, so it doesn't matter /how/ you communicate with it, whether be it via a docker cli running in x86 translation or not. It should not make any difference. Although you can run x86 container on an ARM Mac (via --platform linux/amd64), it is then using inside the ARM virtual machine a qemu emulator, which is not very stable, nor feature complete, or fast. I mean there is also xbuild that allows you to build x86 images on ARM, but again this is terribly slow as it also uses qemu. So I'm trying to understand how this works for you when in theory it shouldn't.

It seems to be able to build our own ARM image from https://github.com/edgedb/edgedb-docker it's required that the apt server in https://packages.edgedb.com/apt needs to host ARM builds as well, or better: edgedb is building inside the docker container as well instead of relying on an apt server.