Skip to content

Commit 76ea424

Browse files
authored
pure-docker: move pure-docker to ./pure-docker (#454)
This change will require additional actions for users using the pure-docker deployment option upgrading past 3.30.x - Please refer to https://docs.sourcegraph.com/admin/updates/pure_docker for more details.
1 parent a7f22c6 commit 76ea424

36 files changed

Lines changed: 119 additions & 83 deletions

README.md

Lines changed: 24 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,36 @@
1-
# Pure-Docker Sourcegraph cluster deployment reference
1+
# Sourcegraph with Docker Compose
22

3-
[![sourcegraph: search](https://img.shields.io/badge/sourcegraph-search-brightgreen.svg)](https://sourcegraph.com/github.com/sourcegraph/deploy-sourcegraph-docker)
3+
[![sourcegraph: search](https://img.shields.io/badge/sourcegraph-search-brightgreen.svg)](https://sourcegraph.com/github.com/sourcegraph/deploy-sourcegraph-docker) [![Build status](https://badge.buildkite.com/e60f9ffcafd68882d3db6fe5e33567e3a111d391a554d50d82.svg)](https://buildkite.com/sourcegraph/deploy-sourcegraph-docker)
44

5-
There are two recommended ways to deploy Sourcegraph:
5+
This repository is the deployment reference for [deploying Sourcegraph with Docker Compose](https://docs.sourcegraph.com/admin/install/docker-compose).
66

7-
- [Single-machine Docker deployment](https://docs.sourcegraph.com/admin/install/docker)
8-
- [Multi-machine Kubernetes deployment](https://docs.sourcegraph.com/admin/install/kubernetes_cluster)
7+
> 🚨 IMPORTANT: When upgrading Sourcegraph, please check [upgrading docs](https://docs.sourcegraph.com/admin/updates/docker_compose) to check if any manual migrations are necessary.
8+
>
9+
> The `master` branch tracks development. Use the branch of this repository corresponding to the
10+
> version of Sourcegraph you wish to deploy, e.g. `git checkout 3.19`.
911
10-
But what if your organization wants a multi-machine deployment without using Kubernetes? What if you use a different container management platform, for example? This project aims to solve that, by providing a pure-Docker deployment option.
12+
For product and [pricing](https://about.sourcegraph.com/pricing/) information, visit
13+
[about.sourcegraph.com](https://about.sourcegraph.com) or [contact
14+
us](https://about.sourcegraph.com/contact/sales) for more information. If you're just starting out,
15+
we recommend running Sourcegraph as a [single Docker
16+
container](https://docs.sourcegraph.com/#quickstart-guide) or using [Docker
17+
Compose](https://docs.sourcegraph.com/admin/install/docker-compose). Migrating to Sourcegraph on
18+
Kubernetes is easy later.
1119

12-
The goal is that anyone using a container management platform other than Kubernetes (Netflix's [Titus](https://netflix.github.io/titus/), Apache's [Mesos](http://mesos.apache.org/documentation/latest/docker-containerizer/), etc.) would be able to use this repository as a reference for how to deploy Sourcegraph.
20+
## Is Docker Compose the right deployment type for me?
1321

14-
## Deploying
22+
Please see [our docs](https://docs.sourcegraph.com/admin/install) for comparisons of deployment types and our resource estimator.
1523

16-
First clone the repository, then:
24+
## Contributing
1725

18-
```bash
19-
./deploy.sh
20-
```
26+
We've made our deployment configurations open source to better serve our customers' needs. If there is anything we can do to make deploying Sourcegraph easier just [open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph-docker&title=%5Bdeploy-sourcegraph-docker%5D) or a pull request and we will respond promptly!
2127

22-
Visit http://localhost:3080 to visit the running Sourcegraph instance!
23-
24-
## Tearing down the deployment
25-
26-
```bash
27-
./teardown.sh
28-
```
29-
30-
## System topology
31-
32-
To understand the system topology:
33-
34-
1. Look at `deploy.sh` to get an overview of services.
35-
2. Every service (`deploy-*.sh`) has documentation inline indicating:
36-
- What the service does / provides.
37-
- What ports the service exposes.
38-
- What other services it talks to (see environment variables).
39-
40-
## Service system requirements
41-
42-
Every service (`deploy-*.sh`) documents inline what the system requirements are (CPU/Memory/Disk allocation). For example, [the frontend service](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/f01b97a397138dd76e5f5ed45b2574b9a2e70cd1/deploy-frontend.sh#L6-L9).
43-
44-
## Scaling / replicas
45-
46-
To scale the cluster deployment, you will need to:
47-
48-
1. Deploy more instances of `gitserver`, `indexed-search`, `searcher` and `symbols` services as desired.
49-
2. [Configure the `frontend` and `frontend-internal` to communicate with the new instances.](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/f01b97a397138dd76e5f5ed45b2574b9a2e70cd1/deploy-frontend.sh#L31-L34)
50-
3. You're done! You do not need to configure or restart any other services.
51-
52-
## Metrics and Tracing
53-
54-
This deployment comes with metrics and tracing built-in. See [metrics and tracing](metrics-and-tracing.md) for details.
55-
56-
## Configuring HTTPS
57-
58-
See https://docs.sourcegraph.com/admin/nginx#nginx-for-other-sourcegraph-clusters-e-g-pure-docker
59-
60-
## Configuring SSH cloning
61-
62-
1. Ensure your **Site admin** > **External services** code host configuration is configured to use SSH. For example, by setting the [`gitURLType`](https://docs.sourcegraph.com/admin/site_config/all#giturltype-string-enum) field to `"ssh"`. You may still need to configure an access token or other codehost authentication method in order for Sourcegraph to discover your repositories.
63-
64-
Alternatively, you may use the `OTHER` codehost type under **External services**, which allows you to directly specify Git repository URLs for cloning.
65-
66-
2. Provide your `gitserver` instances with your SSH / Git configuration (usually just `.ssh/id_rsa`, `.ssh/id_rsa.pub`, and `.ssh/known_hosts` -- but you can also provide other files like `.netrc`, `.gitconfig`, etc. if needed) by mounting it into the `sourcegraph` users home directory in the `gitserver` containers. For example, by adding the following flag:
67-
68-
```
69-
-v ~/my-sourcegraph-ssh-config/.ssh:/home/sourcegraph/.ssh
70-
```
71-
72-
All future Git cloning operations will use the credentials configured there.
73-
74-
If you wish, you can test that cloning with your configuration is working by performing the clone in a gitserver container shell, e.g. first acquire shell access:
75-
76-
```
77-
$ docker exec -it gitserver-0 sh
78-
```
28+
## Questions & Issues
7929

80-
Then try cloning the repository:
30+
[Open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph&template=deploy-sourcegraph.md&title=%5Bdeploy-sourcegraph%5D) or contact us (support@sourcegraph.com), we are happy to help!
8131

82-
```
83-
$ git clone ssh://git@myhost.com/my/repo /tmp/my-repo
84-
```
85-
## Questions & Issues
32+
## Pure-Docker Sourcegraph cluster deployment reference
8633

87-
[Open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph-docker&template=deploy-sourcegraph-docker.md&title=%5Bdeploy-sourcegraph-docker%5D) or contact us (support@sourcegraph.com), we are happy to help!
34+
What if your organization wants a multi-machine deployment without using Kubernetes?
35+
What if you use a different container management platform, for example?
36+
Anyone using a container management platform other than Kubernetes (Netflix's [Titus](https://netflix.github.io/titus/), Apache's [Mesos](http://mesos.apache.org/documentation/latest/docker-containerizer/), etc.) can use our [Pure-Docker Sourcegraph cluster deployment reference](./pure-docker/README.md) to deploy Sourcegraph.

RELEASING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release guide
22

3+
**This is the guide for releasing the [Pure-Docker Sourcegraph deployment reference](./pure-docker/README.md).**
4+
The docker-compose release is done entirely via the [Sourcegraph release tool](https://about.sourcegraph.com/handbook/engineering/distribution/tools/release).
5+
36
## Branching/tagging scheme
47

58
Just like deploy-sourcegraph, we use version branches and version tags. We _additionally_ have a second set which is customer-replication branches and version tags:

pure-docker/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Pure-Docker Sourcegraph cluster deployment reference
2+
3+
## Deploying
4+
5+
First clone the repository, then:
6+
7+
```bash
8+
./deploy.sh
9+
```
10+
11+
Visit http://localhost:3080 to visit the running Sourcegraph instance!
12+
13+
## Tearing down the deployment
14+
15+
```bash
16+
./teardown.sh
17+
```
18+
19+
## System topology
20+
21+
To understand the system topology:
22+
23+
1. Look at `deploy.sh` to get an overview of services.
24+
2. Every service (`deploy-*.sh`) has documentation inline indicating:
25+
- What the service does / provides.
26+
- What ports the service exposes.
27+
- What other services it talks to (see environment variables).
28+
29+
## Service system requirements
30+
31+
Every service (`deploy-*.sh`) documents inline what the system requirements are (CPU/Memory/Disk allocation). For example, [the frontend service](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/f01b97a397138dd76e5f5ed45b2574b9a2e70cd1/deploy-frontend.sh#L6-L9).
32+
33+
## Scaling / replicas
34+
35+
To scale the cluster deployment, you will need to:
36+
37+
1. Deploy more instances of `gitserver`, `indexed-search`, `searcher` and `symbols` services as desired.
38+
2. [Configure the `frontend` and `frontend-internal` to communicate with the new instances.](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/f01b97a397138dd76e5f5ed45b2574b9a2e70cd1/deploy-frontend.sh#L31-L34)
39+
3. You're done! You do not need to configure or restart any other services.
40+
41+
## Metrics and Tracing
42+
43+
This deployment comes with metrics and tracing built-in. See [metrics and tracing](metrics-and-tracing.md) for details.
44+
45+
## Configuring HTTPS
46+
47+
See https://docs.sourcegraph.com/admin/nginx#nginx-for-other-sourcegraph-clusters-e-g-pure-docker
48+
49+
## Configuring SSH cloning
50+
51+
1. Ensure your **Site admin** > **External services** code host configuration is configured to use SSH. For example, by setting the [`gitURLType`](https://docs.sourcegraph.com/admin/site_config/all#giturltype-string-enum) field to `"ssh"`. You may still need to configure an access token or other codehost authentication method in order for Sourcegraph to discover your repositories.
52+
53+
Alternatively, you may use the `OTHER` codehost type under **External services**, which allows you to directly specify Git repository URLs for cloning.
54+
55+
2. Provide your `gitserver` instances with your SSH / Git configuration (usually just `.ssh/id_rsa`, `.ssh/id_rsa.pub`, and `.ssh/known_hosts` -- but you can also provide other files like `.netrc`, `.gitconfig`, etc. if needed) by mounting it into the `sourcegraph` users home directory in the `gitserver` containers. For example, by adding the following flag:
56+
57+
```
58+
-v ~/my-sourcegraph-ssh-config/.ssh:/home/sourcegraph/.ssh
59+
```
60+
61+
All future Git cloning operations will use the credentials configured there.
62+
63+
If you wish, you can test that cloning with your configuration is working by performing the clone in a gitserver container shell, e.g. first acquire shell access:
64+
65+
```
66+
$ docker exec -it gitserver-0 sh
67+
```
68+
69+
Then try cloning the repository:
70+
71+
```
72+
$ git clone ssh://git@myhost.com/my/repo /tmp/my-repo
73+
```
74+
## Questions & Issues
75+
76+
[Open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph-docker&template=deploy-sourcegraph-docker.md&title=%5Bdeploy-sourcegraph-docker%5D) or contact us (support@sourcegraph.com), we are happy to help!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ docker run --detach \
3131
-p 0.0.0.0:80:80 \
3232
-p 0.0.0.0:443:443 \
3333
-v $VOLUME:/caddy-storage \
34-
--mount type=bind,source="$(pwd)"/caddy/builtins/http.Caddyfile,target=/etc/caddy/Caddyfile \
34+
--mount type=bind,source="$(pwd)"/../caddy/builtins/http.Caddyfile,target=/etc/caddy/Caddyfile \
3535
index.docker.io/caddy/caddy:alpine@sha256:ef2f47730caa12cb7d0ba944c048b8e48f029d5e0ff861840fa2b8f1868e1966
3636

0 commit comments

Comments
 (0)