Skip to content

object-storage: add new 'sourcegraph' bucket#1747

Draft
bobheadxi wants to merge 2 commits intomainfrom
new-sourcegraph-bucket
Draft

object-storage: add new 'sourcegraph' bucket#1747
bobheadxi wants to merge 2 commits intomainfrom
new-sourcegraph-bucket

Conversation

@bobheadxi
Copy link
Copy Markdown
Member

@bobheadxi bobheadxi commented Apr 10, 2026

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sourcegraph-docs Ready Ready Preview, Comment Apr 10, 2026 11:34pm

Request Review

<Callout type="warning">
Starting in [Sourcegraph 7.2](https://sourcegraph.com/changelog/releases/7.2), self-hosted Sourcegraph instances using S3 or
GCS object storage should now provision an additional bucket named
[`sourcegraph`](#sourcegraph-bucket). Sourcegraph currently reports a warning
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this to me sounds like it has to be called sourcegraph in GCS/S3 but the namespace of bucket names is global IIRC so only one project can ever claim this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah - all the other backends have a default name 🤔

I think the default is more for blobstore for anything else, but the existing docs all explicitly mention the default. I think for non-blobstore I'll just tweak the wording here

Set the following environment variables to target an S3 bucket for shared Sourcegraph uploads.

- `SOURCEGRAPH_UPLOAD_BACKEND=S3`
- `SOURCEGRAPH_UPLOAD_BUCKET=sourcegraph` (default)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this actually the default? I feel like this can't be defaulted as the name is globally unique

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- `SOURCEGRAPH_UPLOAD_AWS_SESSION_TOKEN=<your session token>` (optional)
- `SOURCEGRAPH_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` (optional; set to use EC2 metadata API over static credentials)
- `SOURCEGRAPH_UPLOAD_AWS_USE_PATH_STYLE=false` (optional)
- `SOURCEGRAPH_UPLOAD_AWS_REGION=us-east-1` (default)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels weird to default to some AWS region 🤔 if anything I'd expect that it does metadata server discovery to find the right region

Copy link
Copy Markdown
Member Author

@bobheadxi bobheadxi Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all copy-pasta from existing docs 😅 https://sourcegraph.com/docs/self-hosted/external-services/object-storage#using-s3-1

But yeah good callouts, I'll see what I can find

Comment on lines +50 to +54
- `SOURCEGRAPH_UPLOAD_BACKEND=GCS`
- `SOURCEGRAPH_UPLOAD_BUCKET=sourcegraph` (default)
- `SOURCEGRAPH_UPLOAD_GCP_PROJECT_ID=<my project id>`
- `SOURCEGRAPH_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE=</path/to/file>`
- `SOURCEGRAPH_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE_CONTENT=<{"my": "content"}>`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use instance roles too? I feel like within GKE it should not be required to set this explicitly. 🤔

Copy link
Copy Markdown
Member Author

@bobheadxi bobheadxi Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's what we do in Cloud

will add as an option

- `SOURCEGRAPH_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE=</path/to/file>`
- `SOURCEGRAPH_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE_CONTENT=<{"my": "content"}>`

### Automatically provision the `sourcegraph` bucket
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we even have that? I wonder if anyone really uses this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard-required for blobstore (i.e. you can't turn it off) but yeah, not sure either. Currently it doesn't seem like significant complexity to retain

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.

2 participants