-
Notifications
You must be signed in to change notification settings - Fork 569
add codeinsights-db deployment #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| # Description: TimescaleDB time-series database for code insights data. | ||
| # | ||
| # Disk: 128GB / persistent SSD | ||
| # Network: 1Gbps | ||
| # Liveness probe: 5432/TCP | ||
| # Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP | ||
| # Ports exposed to the public internet: none | ||
| # | ||
| VOLUME="$HOME/sourcegraph-docker/codeinsights-db-disk" | ||
| ./ensure-volume.sh $VOLUME 999 | ||
| docker run --detach \ | ||
| --name=codeinsights-db \ | ||
| --network=sourcegraph \ | ||
| --restart=always \ | ||
| --cpus=4 \ | ||
| --memory=2g \ | ||
| -e POSTGRES_PASSWORD=password \ | ||
| -e PGDATA=/var/lib/postgresql/data/pgdata \ | ||
| -v $VOLUME:/var/lib/postgresql/data/ \ | ||
| index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:f985af2fef860cc48be40ded864df025b8794b02b86e66cbc6c55bfe3c418831 | ||
|
|
||
| # Note: You should deploy this as a container, do not try to connect it to your external | ||
| # Postgres deployment (TimescaleDB is a bit special and most hosted Postgres deployments | ||
| # do not support TimescaleDB, the data here is akin to gitserver's data, where losing it | ||
| # would be bad but it can be rebuilt given enough time.) | ||
|
|
||
| echo "Deployed codeinsights-db service" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ services: | |
| - JAEGER_AGENT_HOST=jaeger | ||
| - PGHOST=pgsql | ||
| - CODEINTEL_PGHOST=codeintel-db | ||
| - CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres | ||
| - 'SRC_GIT_SERVERS=gitserver-0:3178' | ||
| - 'SRC_SYNTECT_SERVER=http://syntect-server:9238' | ||
| - 'SEARCHER_URL=http://searcher-0:3181' | ||
|
|
@@ -117,6 +118,7 @@ services: | |
| - GOMAXPROCS=4 | ||
| - PGHOST=pgsql | ||
| - CODEINTEL_PGHOST=codeintel-db | ||
| - CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres | ||
| - 'SRC_GIT_SERVERS=gitserver-0:3178' | ||
| - 'SRC_SYNTECT_SERVER=http://syntect-server:9238' | ||
| - 'SEARCHER_URL=http://searcher-0:3181' | ||
|
|
@@ -510,6 +512,30 @@ services: | |
| - sourcegraph | ||
| restart: always | ||
|
|
||
| # Description: TimescaleDB time-series database for code insights data. | ||
| # | ||
| # Disk: 128GB / persistent SSD | ||
| # Network: 1Gbps | ||
| # Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP | ||
| # Ports exposed to the public internet: none | ||
| # | ||
| # Note: You should deploy this as a container, do not try to connect it to your external | ||
| # Postgres deployment (TimescaleDB is a bit special and most hosted Postgres deployments | ||
| # do not support TimescaleDB, the data here is akin to gitserver's data, where losing it | ||
| # would be bad but it can be rebuilt given enough time.) | ||
| codeinsights-db: | ||
| container_name: codeinsights-db | ||
| image: "index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:f985af2fef860cc48be40ded864df025b8794b02b86e66cbc6c55bfe3c418831" | ||
| cpus: 4 | ||
| mem_limit: "2g" | ||
| environment: | ||
| - POSTGRES_PASSWORD=password | ||
| volumes: | ||
| - "codeinsights-db:/data/" | ||
| networks: | ||
| - sourcegraph | ||
| restart: always | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason we didn't add health checks here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no good reason I can think of, probably I just forgot to do it. |
||
|
|
||
| # Description: MinIO for storing LSIF uploads. | ||
| # | ||
| # Disk: 128GB / persistent SSD | ||
|
|
@@ -577,6 +603,7 @@ volumes: | |
| grafana: | ||
| pgsql: | ||
| codeintel-db: | ||
| codeinsights-db: | ||
| minio: | ||
| prometheus-v2: | ||
| redis-cache: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our other db's do not set a password (at least at the docker-compose YAML level), why do we set one here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our Postgres image we actually bake in this environment variable. We don't do it here because this is just a re-tagged TimescaleDB image.