Use one shared OpenSearch and Elasticsearch container for all projects - #129
Open
peterjaap wants to merge 1 commit into
Open
Use one shared OpenSearch and Elasticsearch container for all projects#129peterjaap wants to merge 1 commit into
peterjaap wants to merge 1 commit into
Conversation
…jects Previously the global docker-compose was generated with one search container per requested version, giving each version its own container, container name, volumes, and version-derived host port (e.g. 9259 for OpenSearch 2.19). Now MageBox runs at most one OpenSearch and one Elasticsearch container for the whole machine, shared across every project: - Fixed host ports: OpenSearch 9200, Elasticsearch 9500 (distinct so both engines can run at once). - Unversioned service names (opensearch/elasticsearch), container names (magebox-opensearch/magebox-elasticsearch), and volumes (opensearch_data, opensearch_plugins, ...). - When projects request different versions, the global default version wins, otherwise the highest requested version is used. The container is provisioned with the largest memory any project requests. GetOpenSearchPort/GetElasticsearchPort now return the fixed ports and drop the version argument; the version->port helpers are removed. Status, service-name matching, `magebox new`, and `magebox check` are updated to the fixed names/ports. Docs (ports, config-options, search guide, opensearch service) updated to match. Claude-Session: https://claude.ai/code/session_01TysGzdAeGf96J3WvTKFrht
peterjaap
marked this pull request as ready for review
July 6, 2026 12:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MageBox now runs one shared OpenSearch container and one shared Elasticsearch container for the whole machine, instead of one container per requested version.
Previously the global compose file was generated per search version — each version got its own container, container name, volumes, and a version-derived host port (OpenSearch
9259for 2.19, Elasticsearch9657for 7.17, etc.). Different projects on different versions each spun up a separate search container.Behavior now
9200, Elasticsearch9500(distinct so both engines can run simultaneously).opensearch/elasticsearch, containermagebox-opensearch/magebox-elasticsearch, volumesopensearch_data/opensearch_plugins(and ES equivalents).magebox config) wins; otherwise the highest requested version is used. The container is provisioned with the largestmemoryany project requests.GetOpenSearchPort/GetElasticsearchPortnow return the fixed ports and drop the version argument; the old version→port helpers are removed.magebox status, service-name matching,magebox new, andmagebox checkupdated to the fixed names/ports.Migration note
Existing environments have per-version search containers/volumes (
magebox-opensearch-2.19,opensearch219_data). After this change MageBox generates the new unversionedmagebox-opensearchcontainer with a freshopensearch_datavolume; the old containers/volumes become orphaned and the search index needs a reindex. Search data is rebuildable, so no real data loss.Tests
TestSelectSearchService— version selection (single / highest / global-default-wins / largest-memory).TestGenerateGlobalServices_SharedSearchContainer— two projects on different OpenSearch versions + one Elasticsearch collapse to exactly one container per engine on the fixed ports.make lintclean, fullgo test ./...green.Docs updated:
reference/ports.md,reference/config-options.md,guide/search.md,services/opensearch.md.https://claude.ai/code/session_01TysGzdAeGf96J3WvTKFrht