59 Commits

Author SHA1 Message Date
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
Chad Whitacre
67f70915b5
fix(env): Read and set .env in install.sh, portably (#626)
h/t https://unix.stackexchange.com/a/79077

Fixes #622, cf. #600 

cc: @NullIsNot0
2020-08-17 16:16:06 +03:00
Tomasz Kontusz
35ad7dc477
feat: Only stop the cluster after building images (#614)
This reduces downtime for users with custom Dockerfiles. Fixes #607.
2020-08-03 23:32:56 +03:00
Burak Yigit Kaya
094d8e38a3
fix(install): Read and set .env in install.sh (#600)
Fixes #597.
2020-07-17 15:29:55 +03:00
Burak Yigit Kaya
4f39b57a53
install(clickhouse): Ensure we have the newest transactions table (#594)
See getsentry/sentry#19882 and getsentry/sentry/#19883.

Fixes #587.
2020-07-15 20:37:51 +03:00
Burak Yigit Kaya
75fe6c073b
fix(ingest): Fix Relay auth issues and add e2e event ingestion test (#578)
This is a long-needed test that tests the whole pipeline from Nginx, Relay, to Kafka, and Snuba. The final missing piece is testing the Symbolicator integration.

This PR is also a follow up to #576 as it didn't solve the Relay issues fully (the earlier fix was a coincidence or is not as reliable as it seemed).

Fixes #486 (finally?).
2020-07-13 13:07:05 +03:00
Burak Yigit Kaya
73213bc51f
ref(relay): Remove PK and rely on INTERNAL_IPS (#572)
This patch adds `INTERNAL_IPS` definition to `sentry.conf.py` by sniffing the network from eth0 and relies on this for trusted Relays instead of the ALLOWLISTED PKs. This removes the necessity of syncing Relay PKs to `sentry.conf.py`.

This PR needs getsentry/sentry#19798 to work.
2020-07-10 23:53:50 +03:00
Mike Purvis
96889a6175
Add volumed-out config directory for symbolicator. (#566)
I would like to be able to customize the configuration for my Sentry 10 symbolicator instance, which this change allows me to easily do.

See related: https://github.com/getsentry/symbolicator/issues/245

Co-authored-by: Burak Yigit Kaya <ben@byk.im>
2020-07-08 20:42:33 +03:00
strange-developer
e75e6f1dee
fix(zookeeper): cp: cannot create regular file (#552)
Hi,

I've been through quite a few different ways of implementing this fix and settled on creating a variable to store the output of checking whether the zookeeper copy target folder exists and copying the snapshot file based on the copy target folder existing. I've ran quite a few manual tests for each option as well. Currently the PR sits on Option 3 from the below options.

**Option 1**
Judging from the [Jira issue](https://issues.apache.org/jira/browse/ZOOKEEPER-3056), it seems like the work around for zookeeper upgrades could be omitted entirely since the issue relates to upgrades from v3.4.10 to v3.5.4. I've tested removing the zookeeper workaround entirely and that install ran smoothly on a clean install of Sentry (no existing data) as well as an install of Sentry that currently has very minimal amount of log entries (roughly 100 log entries). Could we possibly remove the workaround entirely? 

**Option 2**
The second option was to simply add a check to the currently [existing line](https://github.com/getsentry/onpremise/blob/master/install.sh#L178) of whether the copy target folder exists and perform the snapshot file copy only if the copy target folder exists. This is the least amount of code and possibly the simpler fix while also setting the `ZOOKEEPER_SNAPSHOT_TRUST_EMPTY` env var to `true`, however, some unnecessary calculations will be done to determine the `ZOOKEEPER_LOG_FILE_COUNT` and `ZOOKEEPER_SNAPSHOT_FILE_COUNT`.

**Option 3**
I've created a variable to store whether the copy target folder exists and proceed with the zookeeper upgrade workaround only if the copy target folder exists. This means that if the copy target folder does not exist, the env var `ZOOKEEPER_SNAPSHOT_TRUST_EMPTY` will not be set.

Fixes #547.

Co-authored-by: chamirb <chamirb@globalkinetic.com>
2020-06-29 16:16:42 +03:00
Burak Yigit Kaya
c2120aafc9
fix(zookeeper): Temp ZK fix should run in detached mode (#525)
Fixes #519.
2020-06-02 19:45:07 +03:00
Burak Yigit Kaya
83160e8bdb
fix(gcb): We need to pull SENTRY_IMAGE on GCB
Follow up to #514.
2020-05-25 10:18:18 +03:00
Burak Yigit Kaya
3e7df7be17
fix(install): Skip pull when SENTRY_IMAGE is set (#514)
This also uses SENTRY_VERSION instead of hard-coding `:latest` as the tag when pulling (follow up to #509).
2020-05-25 01:11:19 +03:00
Burak Yigit Kaya
fe1f23f10f
fix(zk): Fix zookeper upgrade to 5.5.0 (#511)
Fixes the "logs found but no snapshot" error when upgrading from a
short-lived older version. Fixes #472.

See https://issues.apache.org/jira/browse/ZOOKEEPER-3056.
2020-05-24 23:52:30 +03:00
Lyn Nagara
29c6ef58ad
feat(snuba): Skip snuba migrate task (#495) 2020-05-18 09:16:30 +03:00
Markus Unterwaditzer
adda25ee23
feat: Instruct users to migrate TSDB (#430)
Tested this in a Ubuntu VM. The output of `date` is not too pretty but at least localized (so D/M vs M/D is not confusing)

## What is the TSDB migration?

We're effectively deprecating all TSDB backends but `sentry.tsdb.redissnuba.RedisSnubaTSDB`. We cannot reasonably support any other backend due to the fact that we would have to reimplement each of the backends in Relay, which is written in a different language. Also, like with deprecating mysql support, we don't really have the capacity to support things we do not use ourselves.

## Migration

`install.sh` should rewrite your configuration automatically and define a cutover date such that no data is lost. Before the cutover date, data is written to two backends at once, Redis and Snuba, and read from one, Redis. After the cutover date, event-related metrics will be read from Snuba which matches what we have on sentry.io.

## Manual migration guide for TSDB

In case `install.sh` is unable to migrate your files you will be given basic instructions on the console that essentially tell you to completely delete all TSDB config and paste the new, standard one. If for some reason you cannot say goodbye to your existing TSDB config, please create a new issue in this repo and cc @untitaker on it.
2020-05-12 12:02:40 +02:00
Mohamed Laradji
45320c6e86
fix(install.sh): skip checking for sse4 2 flag if kvm was detected (#485)
This PR disables checking for the SSE4.2 flag, which may not be present if the server is running in a VM even if SSE4.2 is in fact available to use (ClickHouse/ClickHouse#20). The KVM check was obtained from a [comment](https://github.com/ClickHouse/ClickHouse/issues/20#issuecomment-226849297) in that issue.

If SSE4.2 is not actually available in the VM, then the installation script may fail in an unpredictable way. Perhaps we can add a keyword argument to the script to let the user decide if they want to skip the check.
2020-05-09 23:10:08 +03:00
Burak Yigit Kaya
024024b198
ref(relay): More robust Relay credentials setting (#470)
This patch does two things:

1. Separate creating of Relay credentials from syncing them to Sentry config
2. Has a more flexible Relay credentials check and sync: look for the quoted public key in the config file, if it is there, assume this must be correctly set as it is very unlikely to have that random key in a different context with quotes around. The second one is to allow having other whitelisted relay keys by using an append method when adding the new key.
2020-05-04 21:44:34 +03:00
Burak Yigit Kaya
8c053b661a
feat(relay): Use a simpler hack for credentials (#452) 2020-04-27 21:35:59 +03:00
Burak Yigit Kaya
ecccb211aa
fix(relay): Fix failed to write credentials (#450) 2020-04-27 20:54:59 +03:00
Radu Woinaroski
e97da7c56f
feat(relay): Add Relay to onpremise installation (#421)
Co-Authored-By: Burak Yigit Kaya <byk@sentry.io>
2020-04-24 15:31:59 +03:00
Burak Yigit Kaya
b2076eaeed
ref(install): Reduce noise on docker-compose pull (#442) 2020-04-24 15:13:38 +03:00
Rob Nieuwenhuizen
3e0ca482c2
Make secret key generation idempotent (#390)
Only generate secret key if not set
2020-02-25 16:08:13 +03:00
Vernon Hockney
ce5834b8cf
fix(install): Update exit status and fix premature exit (#375)
Update exit -1 to exit 1 in line with best practices
Fixes premature exit of the script when checking for sse42 support. The
script would exit before displaying the reason for failure to the user.
2020-02-03 21:01:12 +03:00
Amphaal
cd1f9e811e
Check SSE4.2 compatibility before installation (#361)
Fixes #358.
2020-01-29 16:29:38 +03:00
Burak Yigit Kaya
1292a125b8
fix(install): Remove unnecessary infinite loop from snuba bootst… (#354)
With getsentry/snuba#709 merged, we no longer need to randomly try forever creating Kafka topics, which were a prerequisite for creating Clickhouse tables. This patch also removes the preceding (and obsolete) `docker-compose up` statement which was used to "speed up" the `snuba bootstrap` command in the hopes to fix it.
2020-01-21 22:56:45 +03:00
Burak Yigit Kaya
b8405fca76
build(compose): Bump required compose version (#353)
With #343, we added the `--parallel` flag which only got introduced in `docker-compose` `1.23.0` (source https://medium.com/schkn/parallelize-your-docker-compose-build-8ac653e3e596 as Docker docs themselves don't really mention these) so bumping the minimum required version.

Fixes #351.
2020-01-21 22:56:04 +03:00
Burak Yigit Kaya
70674e252a
fix(data-migration): Make sure to chown the /data folder on sentry (#336)
Fixes #334.
2020-01-13 22:25:27 +03:00
Burak Yigit Kaya
a655b4799c
feat(build): Enable parallel builds for docker-compose (#343) 2020-01-12 18:53:54 +03:00
Burak Yigit Kaya
d6951a2c32
fix(install): Fix secret key gen on BSD (#338)
Fixes #330.
2020-01-10 12:34:36 +03:00
Simon Golms
bc23448141 fix(install): support for Windows and Git Bash (#335)
Fixes #329.
2020-01-09 22:55:20 +03:00
Burak Yigit Kaya
753683d3d6
ref(install): Remove manual eventstream backfill (#318)
This became obsolete thanks to getsentry/sentry#16226
2020-01-03 23:28:43 +03:00
Burak Yigit Kaya
1d33ae6b04
fix(migration): Move Snuba bootstrapping before DB upgrade (#317)
Since we are [moving the eventstream into a proper db migration](https://github.com/getsentry/sentry/pull/16226), we need Snuba and its friends ready at the time of `sentry upgrade` command. This patch does exactly that.

Co-authored-by: Lyn Nagara <lyn.nagara@gmail.com>
2020-01-03 22:52:22 +03:00
Burak Yigit Kaya
4a82e9fa1d
feat(logs): Cleaner logs w/o ANSI sequences (#316) 2020-01-03 22:06:33 +03:00
Burak Yigit Kaya
629ee07c79
feat(install): Add automatic logs to install script (#312)
This change makes the install script create a new install log file, `sentry_install_log-<ISO_TIMESTAMP>.txt`, for each run and records all the output there for future reference.
2020-01-03 13:17:35 +03:00
Burak Yigit Kaya
3dfc01ec2d
fix(upgrade): Fix upgrade instructions and script (#304) 2019-12-30 23:07:42 +03:00
Burak Yigit Kaya
ba67058070
feat(upgrade): Add automatic Snuba migration for upgrades (#292)
Upgrades existing events from last `$SENTRY_EVENT_RETENTION_DAYS`
to Snuba automatically. Relies on getsentry/sentry#15934.
2019-12-09 21:33:02 +03:00
Burak Yigit Kaya
3c9e8c28ff
fix(sentry-data): Don't migrate when not needed (#297)
With this patch, `./install.sh` becomes safer as it won't recursively move things under `/data/file`. It also won't try to migrate an empty volume.
2019-12-09 21:18:43 +03:00
Burak Yigit Kaya
4af4ecfd0e
fix(install): Don't run migrations in interactive mode (#296)
This should fix the GCB failures.
2019-12-06 23:21:54 +03:00