Repository navigation
executors: Declare the sourcegraph network in the executor compose file - #1511
Open
marcleblanc2 wants to merge 1 commit into
Open
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
The executor service joins the sourcegraph network, but only the base docker-compose.yaml declared it. Run on a standalone machine, as the executors README says, docker compose failed with 'service "executor" refers to undefined network sourcegraph'. Generated with an agent. Amp-Thread-ID: https://ampcode.com/threads/T-01a20e40-0e0d-7419-8fad-9e9cf5b37b66 Co-authored-by: Amp <amp@ampcode.com>
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.
docker-compose/executors/executor.docker-compose.yamlputs theexecutorservice on thesourcegraphnetwork but doesn't declare that network. Only the basedocker-compose.yamldeclares it. So the standalone command in the executors README fails:This change declares the network at the end of the executor file, the same way
db-only-migrate.docker-compose.yamldoes. No service, volume, port, or environment variable names change.When the executor file is combined with the base file, Compose merges the two declarations, so the executor still joins the same network as the Sourcegraph containers.
Related docs PR: sourcegraph/docs#2186. Its standalone override example declares the same network, which works with or without this change.
Test plan
Docker Compose v2.40.3, with
config(the orb has no Docker daemon to runup):docker compose -f executor.docker-compose.yaml configfromdocker-compose/executors: failed with the error above before this change, and passes after it. The executor joins networkexecutors_sourcegraph.docker compose -f docker-compose.yaml -f executors/executor.docker-compose.yaml configfromdocker-compose: the executor andsourcegraph-frontend-0are both ondocker-compose_sourcegraph.docker compose -f docker-compose.yaml config -q: still passes. CI only validates this base file, so it doesn't check the executor file.