Repository navigation
docs/self-hosted: Use override files for Docker Compose executors, and --remove-orphans on every up - #2186
docs/self-hosted: Use override files for Docker Compose executors, and --remove-orphans on every up#2186marcleblanc2 wants to merge 2 commits into
Conversation
The Docker Compose executor page told customers to edit executor.docker-compose.yaml, which pins the executor image, so every upgrade meant a merge conflict or a hand-edited image tag. Show an override file for the same-machine and standalone cases instead, and make upgrades a tag checkout plus the same up command. Generated with an agent. Amp-Thread-ID: https://ampcode.com/threads/T-01a20e40-0e0d-7419-8fad-9e9cf5b37b66 Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
||
| Start Sourcegraph and the executor with the base file, the executor file, and your override file, in that order, from the `docker-compose` directory: | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
This passage says the same thing as:
Each fact has one home in the docs. Keep the passage on the page that owns the topic, and replace the others with a sentence and a link to it, so they cannot drift apart. Before writing a config snippet, search docs/ for the key and link to the existing one.
|
…mmand Without it, containers for services removed from the compose files, or left over from a Compose file the customer no longer passes, keep running after docker compose up. Generated with an agent. Amp-Thread-ID: https://ampcode.com/threads/T-01a20e40-0e0d-7419-8fad-9e9cf5b37b66 Co-authored-by: Amp <amp@ampcode.com>
The Docker Compose executors page told customers to edit
executor.docker-compose.yamlin their clone ofdeploy-sourcegraph-docker. That file pins the executor image to the release, so customers who edit it get merge conflicts on every upgrade, and the upgrade section told them to hand-edit the image tag.This change matches the main Docker Compose guidance:
Same machine as Sourcegraph: add an
executorservice to the existingdocker-compose.override.yaml, and pass the base file, the executor file, and the override file todocker compose. A callout warns that once the override configuresexecutor, every command needs the executor file too, or Compose fails withservice "executor" has neither an image nor a build context specified.Standalone machine: an
executor.docker-compose.override.yamlnext to the executor file that setsEXECUTOR_FRONTEND_URLand declares thesourcegraphnetwork.executor.docker-compose.yamljoins that network but does not declare it, so on its own it fails withservice "executor" refers to undefined network sourcegraph.Upgrades: check out the target tag and rerun the same
up -dcommand. If an override setsimage, remove it.The link to the compose file now points to
main, notmaster.Every
docker compose upcommand and mention underdocs/self-hostednow passes--remove-orphans, including the commands that start only some services (the databases,migrator) and thedb-only-migrate.docker-compose.yamlrestore step. Without it, containers for services that are no longer in the Compose files passed to the command keep running. The upgrade, configuration, and cloud-provider pages already used it.Test plan
deploy-sourcegraph-dockermainwith Docker Compose v2.40.3:docker compose -f docker-compose.yaml -f executors/executor.docker-compose.yaml -f <same-machine snippet> config: the executor keeps the image from the base file, gets the password andEXECUTOR_QUEUE_NAMESfrom the override, and keepsEXECUTOR_FRONTEND_URL=http://sourcegraph-frontend-0:3080.docker compose -f executor.docker-compose.yaml -f <standalone snippet> configpasses. Without thenetworksblock it fails with the undefined network error above.executors/executor.docker-compose.yamlwhile the override configuresexecutorgives the error quoted in the callout.EXECUTOR_QUEUE_NAME=(empty), and the snippets setEXECUTOR_QUEUE_NAMES. The executor's config validation only rejects the pair when both are non-empty.pnpm run check links --check-anchors --check-self-linksagainst the merge base: no new dead links.dev/check-hostnames.mjs: no findings.rg -n 'compose[^\n]*\bup\b' docs | rg -v remove-orphansnow matches only prose that isn't a command (the migrator's ownupcommand and an AWS install sentence).docker compose up --help(v2.40.3) lists--remove-orphans.