smarr / ReBenchDB

ReBenchDB records benchmark results and provides customizable reporting to track and analyze run-time performance of software programs.
MIT License
12 stars 6 forks source link

Use Docker Compose and add test that the server comes up #175

Closed smarr closed 7 months ago

smarr commented 7 months ago

This PR changes how the docker-based setup works.

Instead of starting the PostgreSQL server and the Node.js server in the same container, docker-compose.yml defines both as separate containers.

This should improve the ability to use standard docker tooling and container management, and hopefully also avoid issues with the system not starting up properly.

The PR also adds code to wait for Postgres to come up properly, and retry connecting to it.

With Docker, this should be usable with:

docker compose -f ./docker-compose.yml up

For Podman users, podman-compose is needed:

pip3 install podman-compose  # if not already available
podman-compose up

The GitLab CI setup for benchmarking is not using podman-compose, and instead manually starts both containers. Unfortunately, podman-compose is not as full feature as needed. It doesn't fully support its --abort-on-container-exit/--exit-code-from, and dealing with environment variables is problematic, too.