Skip to content

docker-compose: Drop redundant PRECISE_CODE_INTEL_UPLOAD_* settings - #1461

Merged
marcleblanc2 merged 1 commit into
mainfrom
remove-legacy-codeintel-upload-env
Nov 2, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
remove-legacy-codeintel-upload-env

Conversation

@bobheadxi

Copy link
Copy Markdown
Member

Follow-up to #1422. docker-compose.yaml still set PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore and PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 on five services that also load sourcegraph-uploads.env. A customer reading the file could reasonably think both sets of settings need changing to move to S3 or GCS. This removes the legacy lines so sourcegraph-uploads.env is the only object storage configuration in the compose file.

The removed values did nothing:

  • They are the built-in defaults: PRECISE_CODE_INTEL_UPLOAD_BACKEND defaults to blobstore (lsifuploadstore/config.go), and the endpoint defaults to http://blobstore:9000 outside the single-container deployment (deploy/endpoints.go).
  • When the legacy backend is blobstore, resolveLegacyCompatStorage uses the shared SOURCEGRAPH_UPLOAD_* config and keeps only the legacy bucket name, so the legacy endpoint was never used. All code-intel upload store consumers (frontend, precise and syntactic code intel workers, and worker jobs) go through this shim.

Resulting behavior is unchanged:

  • Default: bundled blobstore, lsif-uploads bucket, as before.
  • sourcegraph-uploads.env switched to S3/GCS: code-intel uploads go to the shared bucket under the lsif-uploads/ prefix, as before.
  • Existing deployments that set PRECISE_CODE_INTEL_UPLOAD_BACKEND=S3 or GCS in an override keep their dedicated bucket.

Search jobs already relied on these defaults; compose never set SEARCH_JOBS_UPLOAD_*.

Test plan

  • Parsed the compose file before and after: the only difference is these two variables removed from the five services, each of which still has env_file: sourcegraph-uploads.env.
  • CI.

The five services that set PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore and
PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 also load
sourcegraph-uploads.env, which is now the single place to configure object
storage. Both values are the built-in defaults, and when the legacy backend
is blobstore Sourcegraph uses the shared SOURCEGRAPH_UPLOAD_* config anyway.

Amp-Thread-ID: https://ampcode.com/threads/T-01a19e33-cddf-73da-ac2f-df86f60de809
Co-authored-by: Robert Lin <robert@sourcegraph.com>
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

@bobheadxi
bobheadxi marked this pull request as ready for review November 2, 2026 21:44
@bobheadxi
bobheadxi requested review from a team and marcleblanc2 November 2, 2026 21:45
@marcleblanc2
marcleblanc2 merged commit f97b7d7 into main Nov 2, 2026
3 checks passed
@marcleblanc2
marcleblanc2 deleted the remove-legacy-codeintel-upload-env branch November 2, 2026 21:55
marcleblanc2 added a commit to sourcegraph/deploy-sourcegraph-helm that referenced this pull request Nov 4, 2026
The hardcoded PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore and
PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 on
frontend, worker, precise-code-intel-worker, and
syntactic-code-intel-worker match Sourcegraph's built-in defaults, and
the legacy compat shim ignores the endpoint when the backend is
blobstore. SOURCEGRAPH_UPLOAD_* in *.env is now the only object storage
configuration in the chart.

They also rendered after *.env, so with blobstore.enabled they
overrode any PRECISE_CODE_INTEL_UPLOAD_* a user set there.

Follow-up to sourcegraph/deploy-sourcegraph-docker#1461.

Amp-Thread-ID: https://ampcode.com/threads/T-01a19e9e-5e4f-7408-9834-0de841fee3e4
Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2 added a commit to sourcegraph/deploy-sourcegraph-helm that referenced this pull request Nov 4, 2026
Follow-up to sourcegraph/deploy-sourcegraph-docker#1461, same cleanup
for the Helm chart.

Four templates still set `PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore`
and `PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000` under
`{{ if .Values.blobstore.enabled }}`: `frontend`, `worker`,
`precise-code-intel-worker`, and `syntactic-code-intel-worker`. A
customer reading the templates could reasonably think both
`PRECISE_CODE_INTEL_UPLOAD_*` and `SOURCEGRAPH_UPLOAD_*` need changing
to move to S3 or GCS. This removes the legacy lines so
`SOURCEGRAPH_UPLOAD_*` in `*.env` is the only object storage
configuration in the chart, matching the `external-object-storage`
examples.

The removed values did nothing:

- They are the built-in defaults: `PRECISE_CODE_INTEL_UPLOAD_BACKEND`
defaults to `blobstore`
([lsifuploadstore/config.go](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/codeintel/shared/lsifuploadstore/config.go?L31)),
and the endpoint defaults to `http://blobstore:9000` outside the
single-container deployment
([deploy/endpoints.go](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/conf/deploy/endpoints.go)).
- When the legacy backend is `blobstore`,
[`resolveLegacyCompatStorage`](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/object/sourcegraphobjects/backcompat.go?L20-L44)
uses the shared `SOURCEGRAPH_UPLOAD_*` config and keeps only the legacy
bucket name, so the legacy endpoint was never read.

## Impact on existing deployments

- **Default (bundled blobstore):** no change. The rendered env loses two
variables whose values equal the compiled-in defaults, so pods restart
on upgrade (env changed) but behave identically: bundled blobstore,
`lsif-uploads` bucket.
- **`blobstore.enabled: false` with `SOURCEGRAPH_UPLOAD_*` in `*.env`
(the documented path):** no change at all. The removed block never
rendered for these deployments, so the manifests are byte-identical.
- **`blobstore.enabled: true` with `SOURCEGRAPH_UPLOAD_BACKEND=S3|GCS`
in `*.env`:** no change. Code-intel uploads already went to the shared
bucket under the `lsif-uploads/` prefix via the compat shim, and still
do.
- **`blobstore.enabled: true` with
`PRECISE_CODE_INTEL_UPLOAD_BACKEND=S3|GCS` in `*.env`:** behaviour fix,
one upgrade later. The chart's hardcoded `blobstore` rendered *after*
`*.env`, and Kubernetes takes the last duplicate env name, so these
overrides were silently ignored and uploads went to the bundled
blobstore. On the upgrade to this chart, Helm's three-way merge deletes
every env entry with those names, the `*.env` override included, so the
live Deployments carry neither value and runtime behaviour is unchanged
(the deleted values equal the built-in defaults). On the *next* `helm
upgrade`, even one with no changes, the override is rendered once, takes
effect, and uploads switch to the dedicated bucket the customer
configured. Before that second upgrade, make sure the bucket exists and
is reachable, or move the settings to `SOURCEGRAPH_UPLOAD_*`, or remove
them. Running a second `helm upgrade` straight away makes the switch
happen at a known time. Existing uploads in the bundled blobstore are
not migrated. Verified on a kind cluster by @bobheadxi's agent, see the
comment below.

## Impact on new deployments

None beyond less to read. The `external-object-storage` examples already
disable blobstore and set only `SOURCEGRAPH_UPLOAD_*`.

## Test plan

- `helm lint` and `helm unittest ./charts/sourcegraph` pass (218 tests,
12 snapshots).
- `helm template` of `origin/main` vs this branch with default values:
the only difference is the two variables removed from the three services
that render by default (`syntactic-code-intel-worker` is disabled by
default).
- `helm template --set
frontend.env.PRECISE_CODE_INTEL_UPLOAD_BACKEND.value=S3` on
`origin/main` renders `S3` followed by a second `blobstore` entry; on
this branch it renders `S3` once.
- CI.

---------

Co-authored-by: Amp <amp@ampcode.com>
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.

4 participants