ocurrent / ocaml-ci

A CI for OCaml projects
https://ocaml.ci.dev
MIT License
112 stars 74 forks source link

Docker compose setup for locally testing the whole OCaml-CI stack #884

Closed benmandrew closed 1 year ago

benmandrew commented 1 year ago

The tested stack currently involves:

Rebased on top of the contents of #883.

To run

  1. In docker-compose.yml, change the file paths under the secrets label to point to your own relevant local files.

  2. scheduler, worker and caddy pull pre-built images from Docker Hub; service and web must be built as local images by running:

    docker build -t ocaml-ci-service -f Dockerfile .
    docker build -t ocaml-ci-web -f Dockerfile.web .
  3. Create a file at /etc/caddy/Caddyfile containing:

    
    https://localhost:8100 {
    reverse_proxy service:8080
    }

https://localhost { reverse_proxy web:8090 }



4. Run `docker compose up`.
benmandrew commented 1 year ago

On my machine web is currently failing with:

Failed to connect to backend: Failure("Failed: Network connection for tcp:service:8102 failed:\n  Unix.Unix_error(Unix.ECONNREFUSED, \"connect\", \"\")")
benmandrew commented 1 year ago

Two new containers have been added:

  1. solver-worker for doing local solves
  2. scheduler-cap for generating the capability file needed by service to submit jobs to scheduler
benmandrew commented 1 year ago

The docker compose setup does not include a GitLab service container. The documentation for running the GitLab service locally has been moved to its own file doc/gitlab-dev.md due to doc/dev.md now being about running the docker compose rather than setting up each component manually, as it was before. There may be a better solution for this.

moyodiallo commented 1 year ago

Is this inspired from docs-ci https://github.com/ocurrent/ocaml-docs-ci/blob/main/docker-compose.yml ? Otherwise you could find some useful thing there too.