Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 260119b

Browse files
authored
upgrades: Update docs (#53783)
1 parent f0b8264 commit 260119b

File tree

7 files changed

+206
-165
lines changed

7 files changed

+206
-165
lines changed

doc/admin/deploy/docker-compose/upgrade.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A [standard upgrade](../../updates/index.md#upgrade-types) occurs between a Sour
1010

1111
If you've [configured Docker Compose with a release branch](index.md#step-1-prepare-the-deployment-repository), please merge the upstream release tag for the next minor version into your `release` branch. In the following example, the release branch is being upgraded to v3.43.2.
1212

13-
```bash
13+
```sh
1414
# first, checkout the release branch
1515
git checkout release
1616
# fetch updates
@@ -34,7 +34,7 @@ For each conflict, you need to reconcile any customizations you made with the up
3434

3535
SSH into your instance and navigate to the appropriate folder:
3636

37-
```bash
37+
```sh
3838
# AWS
3939
cd /home/ec2-user/deploy-sourcegraph-docker/docker-compose
4040
# Azure, Digital Ocean, Google Cloud
@@ -43,38 +43,42 @@ cd /root/deploy-sourcegraph-docker/docker-compose
4343

4444
Download all the latest docker images to your local docker daemon:
4545

46-
```bash
47-
docker-compose pull --include-deps
46+
```sh
47+
$ docker-compose pull --include-deps
4848
```
4949

5050
Restart Docker Compose using the new minor version along with your customizations:
5151

52-
```bash
53-
docker-compose up -d --remove-orphans
52+
```sh
53+
$ docker-compose up -d --remove-orphans
5454
```
5555

5656
### Multi-version upgrades
5757

58+
If you are upgrading to **Sourcegraph 5.1 or later**, we encourage you to perform an [**automatic multi-version upgrade**](../../updates/automatic.md). The following instructions are still applicable, just the manual version of what automatic multi-version upgrade do for you now (and therefore is valuable information during a bumpy upgrade).
59+
60+
---
61+
5862
> **⚠️ Attention:** please see our [cautionary note](../../updates/index.md#best-practices) on upgrades, if you have any concerns about running a multiversion upgrade, please reach out to us at [[email protected]](emailto:[email protected]) for advisement.
5963
60-
To perform a multi-version upgrade on a Sourcegraph instance running on Docker compose follow the procedure below:
64+
To perform a **manual** multi-version upgrade on a Sourcegraph instance running on Docker compose follow the procedure below:
6165

6266
1. **Check Upgrade Readiness**:
6367
- Check the [upgrade notes](../../updates/docker_compose.md#docker-compose-upgrade-notes) for the version range you're passing through.
6468
- Check the `Site Admin > Updates` page to determine [upgrade readiness](../../updates/index.md#upgrade-readiness).
6569

6670
2. **Disable Connections to the Database**:
6771
- Run the following command in the directory containing your `docker-compose.yaml` file.
68-
```
69-
docker-compose stop && docker-compose up -d pgsql codeintel-db codeinsights-db
72+
```sh
73+
$ docker-compose stop && docker-compose up -d pgsql codeintel-db codeinsights-db
7074
```
7175
3. **Run Migrator with the `upgrade` command**:
7276
- The following procedure describes running migrator in brief, for more detailed instructions and available command flags see our [migrator docs](../../updates/migrator/migrator-operations.md#docker-compose).
7377
1. Set the migrator `image:` in your `docker-compose.yaml` to the **latest** release of `migrator`. **Example:**
7478
```yaml
75-
migrator:
76-
container_name: migrator
77-
image: 'index.docker.io/sourcegraph/migrator:5.0.4'
79+
migrator:
80+
container_name: migrator
81+
image: 'index.docker.io/sourcegraph/migrator:5.0.4'
7882
```
7983
> *Note: Always use the latest image version of migrator for migrator commands, except the startup command `up`*
8084
2. Set the migrator `command:` to `upgrade` you'll need to supply a `--to=` argument. **Example:**
@@ -83,7 +87,7 @@ To perform a multi-version upgrade on a Sourcegraph instance running on Docker c
8387
```
8488
> *Note: you may add the `--dry-run` flag to the `command:` to test things out before altering the dbs*
8589
3. Run migrator with `docker-compose up migrator` **Example:**
86-
```bash
90+
```sh
8791
$ ~/deploy-sourcegraph-docker/docker-compose/ docker-compose up migrator
8892
codeintel-db is up-to-date
8993
codeinsights-db is up-to-date
@@ -116,7 +120,6 @@ To perform a multi-version upgrade on a Sourcegraph instance running on Docker c
116120

117121
5. **Start your containers again**:
118122
- run `docker-compose up -d` in the folder containing your `docker-compose.yaml` file.
123+
```sh
124+
$ docker-compose up -d
119125
```
120-
docker-compose up -d
121-
```
122-

doc/admin/deploy/docker-single-container/index.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,24 @@ This is required to [collect debug data](../../pprof.md).
8686

8787
The docker run command for single-container Sourcegraph needs an additional publish flag to expose the debug port:
8888

89-
```bash script
90-
docker run --publish 7080:7080 --publish 127.0.0.1:3370:3370 --publish 127.0.0.1:6060:6060 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:5.0.6
89+
```sh
90+
$ docker run --publish 7080:7080 --publish 127.0.0.1:3370:3370 --publish 127.0.0.1:6060:6060 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:5.0.6
9191
```
9292

9393
If Sourcegraph is deployed to a remote server, then access via an SSH tunnel using a tool
9494
such as [sshuttle](https://github.com/sshuttle/sshuttle) is required to establish a secure connection.
9595
To access the remote server using `sshuttle` from your local machine:
9696

97-
```bash script
98-
sshuttle -r user@host 0/0
97+
```sh
98+
$ sshuttle -r user@host 0/0
9999
```
100100

101101
### Environment variables
102102

103103
Add the following to your docker run command:
104104

105-
```
106-
docker run [...]
105+
```sh
106+
$ docker run [...]
107107
-e (YOUR CODE)
108108
sourcegraph/server:5.0.6
109109
```
@@ -116,16 +116,16 @@ sourcegraph/server:5.0.6
116116
117117
Get the Docker container ID for Sourcegraph:
118118

119-
```bash
120-
docker ps
119+
```sh
120+
$ docker ps
121121
CONTAINER ID IMAGE
122122
d039ec989761 sourcegraph/server:VERSION
123123
```
124124

125125
Open a PostgreSQL interactive terminal:
126126

127-
```bash
128-
docker container exec -it d039ec989761 psql -U postgres sourcegraph
127+
```sh
128+
$ docker container exec -it d039ec989761 psql -U postgres sourcegraph
129129
```
130130

131131
Run your SQL query:
@@ -170,8 +170,8 @@ To perform a multi-version upgrade on a Sourcegraph instance running on Docker S
170170

171171
<p />
172172

173-
```bash
174-
docker run \
173+
```sh
174+
$ docker run \
175175
--rm \
176176
--name migrator_${SG_VERSION} \
177177
-e PGHOST='pgsql' \
@@ -209,8 +209,8 @@ Let `${PATH}` be the directory mounted into `/var/opt/sourcegraph` of your insta
209209

210210
For example, `${PATH}` is `~/.sourcegraph/data` in `-v ~/.sourcegraph/data:/var/opt/sourcegraph`.
211211

212-
```bash
213-
docker run --rm -it \
212+
```sh
213+
$ docker run --rm -it \
214214
-v ${PATH}/postgresql:/data/pgdata-${PG_VERSION} \
215215
-u 70 \
216216
-p 5432:5432 \
@@ -243,7 +243,7 @@ To achieve better performance, you can do any of the following:
243243

244244
- For better clone performance, clone the repository on your host machine and then [add it to Sourcegraph Server](../../repo/add.md#add-repositories-already-cloned-to-disk).
245245
- Try adding the `:delegated` suffix the data volume mount. [Learn more](https://github.com/docker/for-mac/issues/1592).
246-
```
246+
```sh
247247
--volume ~/.sourcegraph/data:/var/opt/sourcegraph:delegated
248248
```
249249

@@ -297,8 +297,8 @@ To test new development builds of Sourcegraph (triggered by commits to `main`),
297297

298298
> WARNING: `insiders` builds may be unstable, so back up Sourcegraph's data and config (usually `~/.sourcegraph`) beforehand.
299299
300-
```bash
301-
docker run --publish 7080:7080 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:insiders
300+
```sh
301+
$ docker run --publish 7080:7080 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:insiders
302302
```
303303

304304
To keep this up to date, run `docker pull sourcegraph/server:insiders` to pull in the latest image, and restart the container to access new changes.

0 commit comments

Comments
 (0)