object-storage: add new 'sourcegraph' bucket#1747
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
62b42a0 to
419e336
Compare
| <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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
is this actually the default? I feel like this can't be defaulted as the name is globally unique
There was a problem hiding this comment.
| - `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) |
There was a problem hiding this comment.
feels weird to default to some AWS region 🤔 if anything I'd expect that it does metadata server discovery to find the right region
There was a problem hiding this comment.
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
| - `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"}>` |
There was a problem hiding this comment.
can we use instance roles too? I feel like within GKE it should not be required to set this explicitly. 🤔
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
should we even have that? I wonder if anyone really uses this.
There was a problem hiding this comment.
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
See https://github.com/sourcegraph/sourcegraph/pull/11613, https://github.com/sourcegraph/sourcegraph/pull/11614
Closes https://linear.app/sourcegraph/issue/SVC-2259/sourcegraphobjects-on-prem-guidance