Skip to content

executors: Declare the sourcegraph network in the executor compose file - #1511

Open
marcleblanc2 wants to merge 1 commit into
mainfrom
marc/executor-standalone-network
Open

marcleblanc2 wants to merge 1 commit into
mainfrom
marc/executor-standalone-network

Conversation

@marcleblanc2

Copy link
Copy Markdown
Contributor

docker-compose/executors/executor.docker-compose.yaml puts the executor service on the sourcegraph network but doesn't declare that network. Only the base docker-compose.yaml declares it. So the standalone command in the executors README fails:

$ docker compose -f executor.docker-compose.yaml up -d
service "executor" refers to undefined network sourcegraph: invalid compose project

This change declares the network at the end of the executor file, the same way db-only-migrate.docker-compose.yaml does. 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 run up):

  • docker compose -f executor.docker-compose.yaml config from docker-compose/executors: failed with the error above before this change, and passes after it. The executor joins network executors_sourcegraph.
  • docker compose -f docker-compose.yaml -f executors/executor.docker-compose.yaml config from docker-compose: the executor and sourcegraph-frontend-0 are both on docker-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.

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>
@github-actions

Copy link
Copy Markdown

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