Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Conversation

@emidoots
Copy link
Member

This PR adds the Code Insights TimescaleDB deployment, which will be used to
store time series data for tracking insights about code. For more information
on what this will be used for, see https://github.com/sourcegraph/sourcegraph/issues/17218

TimescaleDB is a plugin for Postgres which extends it to support time series
data storage. We only use the OSS version, and so deploying it is always free
(and their non-free version supports our use case anyway.)

People deploying Sourcegraph should use this deployment and not try to deploy
TimescaleDB as a plugin in their Postgres deployment for a few reasons:

  1. TimescaleDB only supports specific Postgres versions, e.g. not Postgres 13
    yet.
  2. TimescaleDB should have isolated resources from the rest of Sourcegraph, so
    as to prevent Code Insights from interfering with other Sourcegraph features
    in general.

Signed-off-by: Stephen Gutekanst stephen@sourcegraph.com

Checklist

This PR adds the Code Insights TimescaleDB deployment, which will be used to
store time series data for tracking insights about code. For more information
on what this will be used for, see https://github.com/sourcegraph/sourcegraph/issues/17218

TimescaleDB is a plugin for Postgres which extends it to support time series
data storage. We only use the OSS version, and so deploying it is always free
(and their non-free version supports our use case anyway.)

People deploying Sourcegraph should use this deployment and not try to deploy
TimescaleDB as a plugin in their Postgres deployment for a few reasons:

1. TimescaleDB only supports specific Postgres versions, e.g. not Postgres 13
   yet.
2. TimescaleDB should have isolated resources from the rest of Sourcegraph, so
   as to prevent Code Insights from interfering with other Sourcegraph features
   in general.

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
@emidoots
Copy link
Member Author

Note:

  • I based this on codeintel-db, so as to make sure I captured the needed non-root overlays.
  • The postgres.conf included here comes from TimescaleDB itself, I included comments in the ConfigMap about differences and how to use timescaledb-tune to generate a good config file.

Questions:

@pecigonzalo
Copy link
Contributor

What do I need to do to land this on https://github.com/sourcegraph/deploy-sourcegraph-dot-com/ ? I am out of touch with how we do this today.

dot-com uses CloudSQL, so it needs to be added as an extension through Terraform but it seems like it's not supported on CloudSQL, RDS, etc. This could be a problem for our Cloud and for certain customers using external services for their DB, unless we require this service to be run as a pod.

timescale/timescaledb#65

Should I also send a PR to https://github.com/sourcegraph/deploy-sourcegraph-core ?

Not a requirement as that project is parked. If you want to do it low-prio, sure!

@emidoots
Copy link
Member Author

@pecigonzalo As I noted in the description, I think people should deploy this as a pod (including us on sourcegraph.com) and not as an extension in their other Postgres deployment or similar. I will see about sending docs to make this very explicit/clear.

We will also only be storing the insights data here, so data loss will be minimal (just insights) should someone fail to backup the pods disks.

@emidoots
Copy link
Member Author

Once I merge this, what is the process for getting this into the dot-com repo? Do I perform a git merge, does Robert's tooling do that automatically, something else, etc?

@ggilmore
Copy link
Contributor

ggilmore commented Feb 16, 2021

@slimsag Yes, a git merge will be necessary. https://about.sourcegraph.com/handbook/engineering/deployments#merging-upstream-deploy-sourcegraph-into-deploy-sourcegraph-dot-com

Amongst other things that I can think of, you'll need to make sure that the dot-com deployment manifests specify the prod namespace.

Stephen Gutekanst added 2 commits February 16, 2021 14:45
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
@emidoots emidoots enabled auto-merge (squash) February 16, 2021 22:07
Stephen Gutekanst and others added 2 commits February 16, 2021 15:16
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants