96 Commits

Author SHA1 Message Date
Chad Whitacre
faef482109
Check memcached backend in Django (#2778)
Bail if using old memcached backend
2024-02-08 22:15:19 +00:00
Hubert Deng
a6d46a900b
Upgrade Postgres to 14 (#2074)
* add postgres upgrade script, this is included in the install script and automatically upgrades users from PG 9.6 to 14
2023-04-11 17:15:13 -07:00
Benedikt Franke
ec4f416c26
Reference paths relative to project root (#1800)
* Reference paths relative to the current script or project root

Before this PR:
- some scripts change the current working directory and use relative paths
- different approaches are taken to know which directory a script is running in
- paths are sometimes relative, sometimes absolute, sometimes traversing directories

After this PR:
- scripts do neither change nor care much about the current working directory
- a unified approach determines the directory of the current script
- paths are always relative to the project root

This should resolve an issue I already tried to fix with https://github.com/getsentry/self-hosted/pull/1798,
where the contents of `./sentry` were not copied
into the built container image,
thus `enhance-image.sh` did not apply.

Co-authored-by: Amin Vakil <info@aminvakil.com>
2023-02-17 09:59:48 -08:00
Ethan Smith
6b9306a17c
Add pre-commit config (#1738) 2022-10-21 13:46:35 -07:00
Burak Yigit Kaya
54ca9b0817
ref: Remove unused scripts and code (#1710) 2022-10-05 20:39:20 +00:00
Ethan Smith
d298f66a0e
Error monitoring of the self-hosted installer (#1679)
This is the MVP of error monitoring of the self-hosted installer. We have:
- Added a prompt for users to opt into error reporting
- Rewritten the traceback code to give a full stack trace
- Hooked up sending errors to our self-hosted instance

Fixes #740

Co-authored-by: Chad Whitacre <chadwhitacre@sentry.io>
Co-authored-by: hubertdeng123 <hubertdeng123@gmail.com>
2022-09-13 10:25:38 -07:00
Chad Whitacre
ddbf7cd2d0
Add ARM support (#1538)
Co-authored-by: Ethan Smith <ethan.smith@sentry.io>
2022-07-08 19:03:52 -07:00
Chad Whitacre
f1fa49d09d
Clean up relay credentials generation (#1289)
Admin override based on external contributor approvals
2022-02-03 17:39:00 -05:00
Chad Whitacre
7eb16f348d
Take some actions to avoid unhealthy containers (#1241) 2022-01-07 09:00:02 -05:00
Elan Ruusamäe
8cdae78e40
Install: setup umask (#1222) 2022-01-05 10:51:41 -05:00
Amin Vakil
6c26bce20d
Fix reset.sh docker-compose call (#1215)
Co-authored-by: Matti Paksula <matti.paksula@iki.fi>
2021-12-22 08:59:45 -05:00
Amin Vakil
3c060fc8d8
Check for latest commit before install.sh (#1186) 2021-12-06 15:41:13 -05:00
Filippo Pacifici
8dc84600c5
feat(cdc): Prepare the self hosted environment for the Change Data Capture pipeline (#938)
We will use Change Data Capture to stream WAL updates from postgres into clickhouse so that features like issue search will be able to join event data and metadata (from postgres) through Snuba.

This requires the followings:

A logical replicaiton plugin to be installed in postgres (https://github.com/getsentry/wal2json)
A service to run that streams from the replication log to Kafka (https://github.com/getsentry/cdc)
Datasets in Snuba.
This PR is preparing postgres to stream updates via the replication log.
The idea is to

download the the replication log plugin binary during install.sh
mount a volume with the binary when starting postgres
providing a new entrypoint to postgres that ensures everything is correctly configured.
There is a difference between how this is set up and how we do the same in the development environment.
In the development environment we download the library from the entrypoint itself and store it in a persistent volume, so we do not have to download it every time.
Unfortunately this does not work here as the postgres image is postgres:9.6 while it is postgres:9.6-alpine. This one does not come with either wget or curl. I don't think installing that in the entrypoint would be a good idea, so the download happens in install.sh. I actually think this way is safer so we never depend on connectivity for postgres to start properly.
2021-05-24 17:51:36 -07:00
Chad Whitacre
a0a86e400f
Finish the refactor (#908) 2021-03-30 10:23:49 -04:00
Chad Whitacre
7e7401a668
Refactor most of the rest (#903) 2021-03-30 10:21:05 -04:00
Chad Whitacre
f086157548
Clean up the refactor (#907)
- Use source appropriately (needed for config to propagate properly)
- Standardize group/endgroup line-spacing
- Clean up envvar defaults
2021-03-30 12:21:30 +03:00
Chad Whitacre
568f9052b5
Factor out a few more things (#906) 2021-03-29 17:28:39 -04:00
Chad Whitacre
cf4f21c039
Fix a regression with unset envvars (#905) 2021-03-29 17:41:20 +03:00
Chad Whitacre
a868b09044
Factor out volume creation (#901) 2021-03-26 15:04:54 -04:00
Chad Whitacre
0ce7856117
Refactor relay config (#900) 2021-03-26 10:06:04 -04:00
ktmitton
ae0251d1a8
Fixed CPU soft limit check (#885) 2021-03-12 13:09:20 +00:00
Dmitry Dygalo
26f11c425c
fix: Typo in the "recommended minimum CPU cores" message (#855) 2021-02-11 14:20:19 +00:00
Burak Yigit Kaya
a1c0c1fd0c
ref: Stop building local images for Sentry services (#834)
We used to build local images for Sentry services to be able to
include required plugins in the image. With this change we instead
do this in a custom entrypoint script and use the volume `/data`
to store the plugins permanently.

This should resolve many issues people have around building local
images and pushing them to places like private repositories or swarm
clusters.

This is not 100% compatible with the old way but it should still be
a mostly transparent change to many folks.
2021-02-04 12:15:59 +00:00
Burak Yigit Kaya
ab5b867474
ref(requirements): Add min CPU requirement, relax soft RAM (#844)
* ref(requirements): Add min CPU requirement, relax soft RAM

Adds minimum of 4 CPU cores requirement as anything below will perform quite poorly even on lower loads. Relaxes the soft RAM requirement from 8000 MB to 7800 MB as even when there is 8 GB RAM installed, the system reserves some of it to itself and under reports the amount.

* pass on CI with soft limit
2021-02-01 16:41:12 +03:00
arusa
2da7e84024
Change MIN_RAM_HARD from 4000 to 3800 (#840)
On machines with 4gb the available memory is often a little bit lower than 4000
2021-01-29 08:14:56 -05:00
Burak Yigit Kaya
ee53f18ad0
breaking: Remove Python 2 support (#833) 2021-01-20 15:28:14 +00:00
Chad Whitacre
612a14c63c
Add some structure to logging with ::group:: (#827) 2021-01-19 17:30:07 -05:00
Burak Yigit Kaya
640e7fe290
ci(test): Fix 'pool is closed' errors (#826)
Fixes #823. In `install.sh` we build a local sentry image that is used by many services from using the build context under the `./sentry` directory. To avoid building this image multiple times, we also give it a specific name which is referred from multiple services. The issue is, we also run `docker-compose build --parallel` which creates a race condition when building this image as `docker-compose` doesn't check whether the image is already there or not. This is the root cause of all these random failures: an unsurprising race condition.
2021-01-19 20:43:27 +00:00
Burak Yigit Kaya
f2f1e77622
feat: Add Python 2 deprecation warning (w/ style) (#812)
* feat: Add Python 2 deprecation warning (w/ style)

* ensure successful exit

* always succeed at the end

* try again; set +x
2021-01-14 20:04:48 +03:00
Chad Whitacre
8d6893f0bf
Source install/geoip.sh, to work in more envs (#809) 2021-01-13 11:28:00 -05:00
Chad Whitacre
e7ec11aa3b
Bump RAM requirement in install.sh (#803)
* Bump RAM requirement in install.sh

* Hard requirement vs. soft recommendation
2021-01-08 10:36:34 -05:00
Chad Whitacre
a623e72e7e
Integrate with MaxMind out of the box (#766)
Integrate with MaxMind out of the box
2020-12-14 11:56:04 -05:00
Burak Yigit Kaya
f885eceaec
ref(py3): Remove SENTRY_PYTHON3 and -py3 versons (#764)
This is in preparation to make the PY3 version the default for Docker images and self-hosted. It is part **4/5**:

1. ~~Add `-py2` variants for the Python 2 build tags and introduce the `SENTRY_PYTHON2` env variable usage~~ (getsentry/sentry#22460)
2. ~~Switch getsentry/onpremise to Python 3 by default*, introducing the `SENTRY_PYTHON2` env var for Py2 builds via the `-py2` suffix~~ (getsentry/onpremise#763)
3. ~~Move the unsuffixed version of the builds to Python 3~~ (getsentry/sentry#22466)
4. **Remove the `SENTRY_PYTHON3` env var support and `-py3` prefix usage from getsentry/onpremise**
5. Remove tagging of `-py3` builds from getsentry/sentry
2020-12-05 01:46:20 +03:00
Burak Yigit Kaya
06fb0d75de
ref(py3): Make PY3 the default*, add SENTRY_PYTHON (#763)
This is in preparation to make the PY3 version the default* for Docker images and self-hosted. It is part **2/5**:

1. ~~Add `-py2` variants for the Python 2 build tags and introduce the `SENTRY_PYTHON2` env variable usage~~ (getsentry/sentry#22460)
2. __Switch getsentry/onpremise to Python 3 by default*, introducing the `SENTRY_PYTHON2` env var for Py2 builds via the `-py2` suffix__
3. Move the unsuffixed version of the builds to Python 3
4. Remove the `SENTRY_PYTHON3` env var support and `-py3` prefix usage from getsentry/onpremise
5. Remove tagging of `-py3` builds from here

_* this will only happen when item 3 above gets landed_
2020-12-04 22:43:36 +03:00
Burak Yigit Kaya
bee98fd897
fix(install): Disable the script on git-bash (#741)
We kept getting issue reports that we traced down to `git-bash` which doesn't seem to play nice with Docker for Windows with bind mounts. This PR uses the existence of `$MSYSTEM` to detect `git-bash` and exit early with a relevant message.

Co-authored-by: Chad Whitacre <chadwhitacre@sentry.io>
2020-11-17 20:35:55 +03:00
Burak Yigit Kaya
2a1a171233
fix(install): Increase stop timeout to 60 seconds (#731)
This is to ensure clean shutdown of Celery, with fully drained queues. This is needed as versions may change the event format and not be backwards compatible. FWIW this is a hacky workaround without a strong guarantee that the queues will be empty. Ideally we'd shutdown everything first, spin up the workers and check for queues being drained every second or so.
2020-10-29 23:30:43 +03:00
Burak Yigit Kaya
1399be6a68
feat(py3): Add Python 3 support via SENTRY_PYTHON3 env variable (#702) 2020-10-14 21:54:55 +03:00
Burak Yigit Kaya
e333dbd56a
fix(install): Only use .env for fallbacks
This fixes a serious bug in install.sh where it ignored externaly set env variable values such as `SENTRY_IMAGE` in favor of the ones defined in `.env`, essentially making all our e2e tests usless.
2020-10-03 01:30:56 +03:00
Anton Ovchinnikov
0a4b2ad033
fix(install): Check that all ingest topics exist (#686)
Probably this is not needed anymore after https://github.com/getsentry/sentry/pull/20984 is merged, but just in case
2020-09-25 20:54:52 +03:00
Burak Yigit Kaya
74464695ec
fix(docker): Lower docker version to 19.03.6 (#682)
Fixes #689.
2020-09-23 00:17:21 +03:00
Burak Yigit Kaya
ce8538e83f
fix(ingest-consumer): Create the missing Kafka topics (#685)
Fixes #683, supercedes #684.
2020-09-23 00:04:42 +03:00
Burak Yigit Kaya
49dbeabb2b
ci(gcb): Drop Docker version to 19.03.8 as that's the latest on GCB 2020-09-15 20:19:58 +03:00
Burak Yigit Kaya
f8a2e48ed6
build(docker): Bump min Docker & Compose versions (#676)
We need `docker-compose ps -a` for CI so we were already using 1.24.1, this aligns the rest with that.

For Docker, there are a bunch of network-related fixes in 19.03.12 and prior (DNS fallback and IPv6 advertising) that we'd like to have to see if they are going to fix some reported connectivity issues w/ onpremise.
2020-09-15 19:40:42 +03:00
Bruno Bronosky
5631d45115
fix(install): Use proper bash testing (#673)
Fixes https://github.com/getsentry/onpremise/issues/672

I split this PR up into 4 commits. The first one is the bare minimum for the issue. The rest are just consistency corrections that we neckbeards at irc://chat.freenode.net/%23bash would always make.
2020-09-14 23:19:20 +03:00
Lyn Nagara
9b9066fc02
feat(snuba): Run new migration system (#663)
This is for the onpremise release on Sept 15th.

The new migration system has a migration to handle recreating the
transaction table if the old one is present, we no longer need to do
this in `install.sh`.
2020-09-08 21:17:55 +03:00
Tomasz Kontusz
e293a0fc97
fix(install): Don't use getopt for options parsing (#660)
The code assumed GNU getopt, which is not the default on many platforms, notably OSX.

Fixes #656, and replaces #659.
2020-09-07 11:04:43 +03:00
Tomasz Kontusz
1a9b45fb9f
EditorConfig and indentation fixes (#650)
EditorConfig based on conversation in https://github.com/getsentry/onpremise/pull/615#discussion_r477338006, and with the indentation fixes.

This PR will probably conflict with everything, but at least the code is a little bit more consistent :-D
2020-08-31 14:40:52 +03:00
Kevin Waddle
175ad09057
install: Add flag to skip create user prompt during install (#646)
Fixes #611.
2020-08-27 18:32:20 +03:00
Tomasz Kontusz
627c366f27
install: Keep relay available while upgrading (#615)
This continues on the ideas from #607. By "downtime" here I mean "not accepting events" - web, smtp and background processes are out of scope.

This PR adds a `--minimize-downtime` option to install.sh. This options changes the behaviour of the script by:
1. keeping nginx and relay running until the very end,
2. disabling cleanup on exit and failure,
3. explicitly reloading nginx configuration,
4. and starting the whole cluster at the end.

The results are promising: no downtime if relay version doesn't change, and only a second when it does. So far this was only tested with a curl loop, so I'm still not sure if Relay flushes the events to Sentry before getting recreated by `$dc up`.
2020-08-27 18:02:33 +03:00
Burak Yigit Kaya
fb125a1e4c
fix(install): TSDB migration should not create invalid config file (#631)
Fixes #624
2020-08-17 18:31:15 +03:00