Skip to content

Allow deployment of multiple sets of services#289

Merged
PGijsbers merged 7 commits into
mainfrom
compose
Mar 25, 2026
Merged

Allow deployment of multiple sets of services#289
PGijsbers merged 7 commits into
mainfrom
compose

Conversation

@PGijsbers

Copy link
Copy Markdown
Contributor

Update the compose file to allow easy deployment of multiple sets of services:

  • ports are not bound by default, but through compose.ports.yaml
  • containers do not have a fixed name

@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR restructures the Docker Compose setup by extracting port mappings into a separate compose.ports.yaml file and renaming container/service identifiers from prefixed names (e.g., openml-python-rest-api, openml-test-database) to generic service names (e.g., python-api, database). Corresponding updates were made to the GitHub Actions test workflow, database configuration, test fixtures, and documentation to reference the new service names and use docker compose exec instead of docker exec.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the main objectives: ports are managed separately via compose.ports.yaml and containers use service names instead of fixed names for multiple deployments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'Allow deployment of multiple sets of services' accurately reflects the main objective of the changeset—enabling multiple concurrent service deployments by removing fixed container names and host port bindings.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch compose

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@8e62afb). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #289   +/-   ##
=======================================
  Coverage        ?   54.12%           
=======================================
  Files           ?       37           
  Lines           ?     1552           
  Branches        ?      135           
=======================================
  Hits            ?      840           
  Misses          ?      710           
  Partials        ?        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • In compose.yaml the docs service still exposes port 8000 while compose.ports.yaml also maps docs port 8000; when using both files together this will cause a port binding conflict, so consider removing the ports block from one of them (likely from compose.yaml to match the stated intent).
  • The updated documentation lists host URLs (e.g. localhost:8001, localhost:8002) without consistently calling out that these require running with compose.ports.yaml; consider explicitly tying those examples to the -f compose.yaml -f compose.ports.yaml invocation to avoid confusion.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `compose.yaml` the `docs` service still exposes port 8000 while `compose.ports.yaml` also maps `docs` port 8000; when using both files together this will cause a port binding conflict, so consider removing the `ports` block from one of them (likely from `compose.yaml` to match the stated intent).
- The updated documentation lists host URLs (e.g. `localhost:8001`, `localhost:8002`) without consistently calling out that these require running with `compose.ports.yaml`; consider explicitly tying those examples to the `-f compose.yaml -f compose.ports.yaml` invocation to avoid confusion.

## Individual Comments

### Comment 1
<location path="compose.ports.yaml" line_range="6-8" />
<code_context>
+    ports:
+      - "3306:3306"
+
+  docs:
+    ports:
+      - "8000:8000"
+
+  elasticsearch:
</code_context>
<issue_to_address>
**suggestion:** Having ports for `docs` here while they are also set in `compose.yaml` can cause confusion about which file controls exposure.

`docs` is the only service defining ports in both files, which makes the merge behavior of `docker compose -f compose.yaml -f compose.ports.yaml` unclear (and possibly redundant or overriding). Moving `docs` ports to only the ports overlay, like the other services, would clarify which file controls exposure.

Suggested implementation:

```
  docs:
    ports:
      - "8000:8000"

```

1. In `compose.yaml`, locate the `docs` service definition and remove its `ports:` section entirely.
2. After this change, `docs` will have its port exposure controlled exclusively by `compose.ports.yaml`, consistent with the other services that only define ports in the ports overlay.
</issue_to_address>

### Comment 2
<location path="docs/installation.md" line_range="24" />
<code_context>

 Information for a production deployment will follow, in a nutshell you need to configure the REST API to connect to a persistent database,
-which can be the one defined in `docker-compose.yaml` if has an appropriately mounted volume.
+which can be the one defined in `compose.yaml` if has an appropriately mounted volume.
</code_context>
<issue_to_address>
**issue (typo):** Missing subject in “if has an appropriately mounted volume”.

The sentence reads “which can be the one defined in `compose.yaml` if has an appropriately mounted volume.” It’s missing a subject; please change it to “if it has an appropriately mounted volume.”
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread compose.ports.yaml
Comment thread docs/installation.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
compose.yaml (1)

15-23: Consider moving docs port mapping to compose.ports.yaml for consistency.

The docs service retains its port mapping (8000:8000) directly in compose.yaml, while other services have their ports extracted to compose.ports.yaml. This creates an inconsistency with the PR's stated objective that "ports are not bound to the host network by default."

If the intent is to allow multiple deployments without port conflicts, the docs service should follow the same pattern.

♻️ Proposed fix

In compose.yaml:

   docs:
     profiles: ["all"]
-    ports:
-      - "8000:8000"
     build:

The port mapping is already present in compose.ports.yaml.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@compose.yaml` around lines 15 - 23, The docs service in compose.yaml
currently contains a ports mapping ("8000:8000") which is inconsistent with the
refactor that centralizes port bindings in compose.ports.yaml; remove the ports
key from the docs service in compose.yaml and ensure compose.ports.yaml contains
the docs service entry with the "8000:8000" mapping (or the intended
host-unbound alternative) so all services follow the same ports extraction
pattern and avoid host port binding by default.
compose.ports.yaml (1)

6-8: Duplicate port mapping for docs service.

The docs service already has ports: ["8000:8000"] defined in compose.yaml (lines 17-18). When using both files together (-f compose.yaml -f compose.ports.yaml), this port mapping will be duplicated. While Docker Compose handles this gracefully by merging, it creates unnecessary redundancy.

Consider either:

  1. Removing the docs port mapping from compose.yaml to keep all port mappings in compose.ports.yaml, or
  2. Removing the docs section from this file since it's already exposed.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@compose.ports.yaml` around lines 6 - 8, The compose.ports.yaml file
duplicates the "docs" service port mapping already present in compose.yaml
(ports "8000:8000"); remove the redundancy by either deleting the "ports" entry
for the docs service from compose.yaml and keeping it in compose.ports.yaml, or
remove the entire "docs" service block from compose.ports.yaml so the docs
service is only defined once; ensure after the change that the "docs" service
has a single ports mapping ("8000:8000") when both files are merged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@compose.ports.yaml`:
- Around line 6-8: The compose.ports.yaml file duplicates the "docs" service
port mapping already present in compose.yaml (ports "8000:8000"); remove the
redundancy by either deleting the "ports" entry for the docs service from
compose.yaml and keeping it in compose.ports.yaml, or remove the entire "docs"
service block from compose.ports.yaml so the docs service is only defined once;
ensure after the change that the "docs" service has a single ports mapping
("8000:8000") when both files are merged.

In `@compose.yaml`:
- Around line 15-23: The docs service in compose.yaml currently contains a ports
mapping ("8000:8000") which is inconsistent with the refactor that centralizes
port bindings in compose.ports.yaml; remove the ports key from the docs service
in compose.yaml and ensure compose.ports.yaml contains the docs service entry
with the "8000:8000" mapping (or the intended host-unbound alternative) so all
services follow the same ports extraction pattern and avoid host port binding by
default.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6d239e9b-680b-4370-870e-425af5281e8d

📥 Commits

Reviewing files that changed from the base of the PR and between 8e62afb and d8822bd.

📒 Files selected for processing (7)
  • .github/workflows/tests.yml
  • compose.ports.yaml
  • compose.yaml
  • docs/contributing/contributing.md
  • docs/installation.md
  • src/config.toml
  • tests/conftest.py

@PGijsbers PGijsbers changed the title Update compose file Allow deployment of multiple sets of services Mar 25, 2026
@PGijsbers PGijsbers merged commit f77c4a8 into main Mar 25, 2026
9 checks passed
@PGijsbers PGijsbers deleted the compose branch March 25, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant