You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consolidated instructions for configuring external object storage (#932)
Updating our existing external object storage documentation to cover
both use cases (precise index upload and search jobs). This PR is mostly
structural reorganization of the existing content spread across two doc
pages for improved readability/ discoverability.
## Pull Request approval
You will need to get your PR approved by at least one member of the
Sourcegraph team. For reviews of docs formatting, styles, and component
usage, please tag the docs team via the #docs Slack channel.
Copy file name to clipboardExpand all lines: docs/admin/external_services/object_storage.mdx
+52-5Lines changed: 52 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,21 @@
1
1
# Using a managed object storage service (S3 or GCS)
2
2
3
-
By default, Sourcegraph will use a `sourcegraph/blobstore` server bundled with the instance to temporarily store code graph indexes uploaded by users.
3
+
By default, Sourcegraph will use a `sourcegraph/blobstore` server bundled with the instance to temporarily store [code graph indexes](../../code-search/code-navigation/precise_code_navigation) uploaded by users as well as the results of [search jobs](../../code-search/types/search-jobs).
4
4
5
5
You can alternatively configure your instance to instead store this data in an S3 or GCS bucket. Doing so may decrease your hosting costs as persistent volumes are often more expensive than the same storage space in an object store service.
6
6
7
-
To target a managed object storage service, you will need to set a handful of environment variables for configuration and authentication to the target service. **If you are running a sourcegraph/server deployment, set the environment variables on the server container. Otherwise, if running via Docker-compose or Kubernetes, set the environment variables on the `frontend`, `worker`, and `precise-code-intel-worker` containers.**
7
+
## Code Graph Indexes
8
+
9
+
To target a managed object storage service for storing [code graph index uploads](../../code-search/code-navigation/precise_code_navigation), you will need to set a handful of environment variables for configuration and authentication to the target service.
10
+
11
+
- If you are running a `sourcegraph/server` deployment, set the environment variables on the server container
12
+
- If you are running via Docker-compose or Kubernetes, set the environment variables on the `frontend`, `worker`, and `precise-code-intel-worker` containers
8
13
9
14
### Using S3
10
15
11
16
To target an S3 bucket you've already provisioned, set the following environment variables. Authentication can be done through [an access and secret key pair](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) (and optional session token), or via the EC2 metadata API.
12
17
13
-
**_Warning:_** Remember never to commit aws access keys in git. Consider using a secret handling service offered by your cloud provider.
18
+
<Callouttype="warning"> Never commit AWS access keys in Git. You should consider using a secret handling service offered by your cloud provider. </Callout>
**_Note:_**If a non-default region is supplied, ensure that the subdomain of the endpoint URL (_the `AWS_ENDPOINT` value_) matches the target region.
29
+
<Callouttype="note"> If a non-default region is supplied, ensure that the subdomain of the endpoint URL (_the `AWS_ENDPOINT` value_) matches the target region. </Callout>
25
30
26
-
> NOTE: You don't need to set the `PRECISE_CODE_INTEL_UPLOAD_AWS_ACCESS_KEY_ID` environment variable when using `PRECISE_CODE_INTEL_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` because role credentials will be automatically resolved. Attach the IAM role to the EC2 instances hosting the `frontend`, `worker`, and `precise-code-intel-worker` containers in a multi-node environment.
31
+
<Callouttype="tip"> You don't need to set the `PRECISE_CODE_INTEL_UPLOAD_AWS_ACCESS_KEY_ID` environment variable when using `PRECISE_CODE_INTEL_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` because role credentials will be automatically resolved. Attach the IAM role to the EC2 instances hosting the `frontend`, `worker`, and `precise-code-intel-worker` containers in a multi-node environment. </Callout>
27
32
28
33
29
34
### Using GCS
@@ -42,3 +47,45 @@ If you would like to allow your Sourcegraph instance to control the creation and
42
47
43
48
-`PRECISE_CODE_INTEL_UPLOAD_MANAGE_BUCKET=true`
44
49
-`PRECISE_CODE_INTEL_UPLOAD_TTL=168h` (default)
50
+
51
+
## Search Job Results
52
+
53
+
To target a third party managed object storage service for storing [search job results](../../code-search/types/search-jobs), you must set a handful of environment variables for configuration and authentication to the target service.
54
+
55
+
- If you are running a `sourcegraph/server` deployment, set the environment variables on the server container
56
+
- If you are running via Docker-compose or Kubernetes, set the environment variables on the `frontend` and `worker` containers
57
+
58
+
### Using S3
59
+
60
+
Set the following environment variables to target an S3 bucket you've already provisioned. Authentication can be done through [an access and secret key pair](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) (and optionally through session token) or via the EC2 metadata API.
61
+
62
+
<Callouttype="warning"> Never commit AWS access keys in Git. You should consider using a secret handling service offered by your cloud provider.</Callout>
<Callouttype="note"> If a non-default region is supplied, ensure that the subdomain of the endpoint URL (the `AWS_ENDPOINT` value) matches the target region.</Callout>
74
+
75
+
<Callouttype="tip"> You don't need to set the `SEARCH_JOBS_UPLOAD_AWS_ACCESS_KEY_ID` environment variable when using `SEARCH_JOBS_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` because role credentials will be automatically resolved.</Callout>
76
+
77
+
### Using GCS
78
+
79
+
Set the following environment variables to target a GCS bucket you've already provisioned. Authentication is done through a service account key, either as a path to a volume-mounted file or the contents read in as an environment variable payload.
If you would like to allow your Sourcegraph instance to control the creation and lifecycle configuration management of the target buckets, set the following environment variables:
Copy file name to clipboardExpand all lines: docs/code-search/types/search-jobs.mdx
+1-39Lines changed: 1 addition & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,45 +40,7 @@ Search Jobs requires an object storage to store the results of your search jobs.
40
40
By default, Search Jobs stores results using our bundled `blobstore` service.
41
41
If the `blobstore` service is deployed, and you want to use it to store results from Search Jobs, you don't need to configure anything.
42
42
43
-
To use a third party managed object storage service, you must set a handful of environment variables for configuration and authentication to the target service.
44
-
45
-
- If you are running a `sourcegraph/server` deployment, set the environment variables on the server container
46
-
- If you are running via Docker-compose or Kubernetes, set the environment variables on the `frontend` and `worker` containers
47
-
48
-
### Using S3
49
-
50
-
Set the following environment variables to target an S3 bucket you've already provisioned. Authentication can be done through [an access and secret key pair](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) (and optionally through session token) or via the EC2 metadata API.
51
-
52
-
<Callouttype="tip"> Never commit AWS access keys in Git. You should consider using a secret handling service offered by your cloud provider.</Callout>
<Callouttype="note"> If a non-default region is supplied, ensure that the subdomain of the endpoint URL (the `AWS_ENDPOINT` value) matches the target region.</Callout>
64
-
65
-
<Callouttype="note"> You don't need to set the `SEARCH_JOBS_UPLOAD_AWS_ACCESS_KEY_ID` environment variable when using `SEARCH_JOBS_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` because role credentials will be automatically resolved.</Callout>
66
-
67
-
### Using GCS
68
-
69
-
Set the following environment variables to target a GCS bucket you've already provisioned. Authentication is done through a service account key, either as a path to a volume-mounted file or the contents read in as an environment variable payload.
If you would like to allow your Sourcegraph instance to control the creation and lifecycle configuration management of the target buckets, set the following environment variables:
80
-
81
-
-`SEARCH_JOBS_UPLOAD_MANAGE_BUCKET=true`
43
+
To use a third party managed object storage service, see instructions in [externalizing object storage](../../admin/external_services/object_storage#search-job-results).
0 commit comments