107 Commits

Author SHA1 Message Date
Tony Xiao
84ebc583de
fix(profiling): Ingest profile file path (#4060)
* fix(profiling): Ingest profile file path

`ingest-profiles` is now using vroomrs to ingest profiles instead of writing
through vroom. For self-hosted, we need to make sure filestore for profiles is
properly configured so vroom can find the ingested profiles.

* feat: move profiling data to seaweedfs

* feat: review from Sentry

* Apply suggestions from code review

Co-authored-by: Burak Yigit Kaya <byk@sentry.io>

* ref: volume migration tests

* ref: execute file creation from vroom container

* fix: brainfart

* debug

* hack

* more debug

* now I know what I'm missing out

* explicitly state feature complete

* try to pull vroom image

* should only run when COMPOSE_PROFILES is feature complete

* using run invoked weed instead of empty shell

* execute the upload script from vroom container

* execute apt command as root

* gonna sleep

* missing endgroup

* missing sh

* directly execute s3cmd and do 'wc' outside out the container

* why did other test start failing

* manual cleanup

* vroom is not a persistent volume

* what about not removing the seaweed volume

---------

Co-authored-by: Reinaldy Rafli <github@reinaldyrafli.com>
Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
2025-11-28 14:30:28 +07:00
Klemens Böswirth
4f6caf7a13
fix(install): add migrate-pgbouncer.sh to install.sh (#4030) 2025-11-10 17:37:12 +00:00
Burak Yigit Kaya
84f904f7a1
feat: Use S3 node store with seaweedfs (#3498)
* feat: Use S3 node store with garage

* lol, fix bash

* moar bash

* lol

* hate bash

* fix moar bash

* Add healthcheck to garage service

Co-authored-by: Reinaldy Rafli <aldy505@proton.me>

* revert +x

* fix healthcheck, fix config

* add env var for garage size

* use better compression level

* simpler garage config

* add migration support

* feat: use seaweedfs as nodestore backend (#3842)

* feat: seaweedfs as s3 nodestore backend

* fix: 'server' was missing for seaweed

* feat: remove minimum volume free space

* feat: specify hostname on ip

* fix: grpc port on seaweed should be `-{service}.port.grpc` instead of `-{service}.grpcPort`

* fix: wrong access key & secret key; use localhost for internal comms

* fix: create index directory

* test: add sentry-seaweedfs volume into expected volumes

* debug: aaaaaaaaaaaaaaaaaaaaaaarrrrggggggghhhhhhhhhhhhhhh

* test: correct ordering for expected volumes

* chore: seaweedfs healthcheck to multiple urls

See https://stackoverflow.com/a/14578575/3153224

* chore: add swap for arm64 runners

* ci: debug memory issues for arm64 runners

* ci: turn off swapfile first

Turns out the arm64 runners already have 3GB of swap

* feat: nodestore config update behind a prompt/flag

* feat: set s3 lifecycle policy

* fix: seaweed is a busybox

* fix: try xml policy

* fix: go back to simplified json

* Revert "fix: go back to simplified json"

This reverts commit 2f1575dfe33db6f781b09d09b01f5382716b8826.

* chore: reword debug lifecycle policy

* fix: don't pollute APPLY_AUTOMATIC_CONFIG_UPDATES variable

---------

Co-authored-by: Reinaldy Rafli <github@reinaldyrafli.com>
2025-09-13 07:48:56 +07:00
Hubert Deng
019d372df2
Revert "fix(vroom): Explicitly set PROFILES_DIR for upcoming change" (#3760)
* Revert "fix(vroom): Explicitly set PROFILES_DIR for upcoming change (#3759)"

This reverts commit e07445d6be41793165316a3e077ebec343740530.

It also very importantly changes where we mount the profiles volume which fixes the issue. Our theory is as follows:

1. Vroom Dockerfile had a line doing `mkdirp /var/lib/sentry-profiles` at image build time. This makes the directory owned by `root`
2. When we mount over that directory, and change permissions we can store the permissions changes _in_ the directory but not the directory itself
3. So when we start the vroom image with the new mount, the contents are owned by `vroom` but the main directory is still owned by `root`. This is also why [this approach](a23a4e3952) worked as the entrypoint script did this at the start of every container instance.

---------

Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
2025-06-17 21:26:01 +01:00
Dominik Jakielski
031a1f1093
Add missing lib script to sentry-admin.sh (#3693)
Sentry Admin Script always fail because of missing import of lib script.

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
2025-05-19 08:24:57 +00:00
Hubert Deng
8653327bc1
chore: Remove everything zookeeper (#3499) 2024-12-31 18:53:14 +00:00
Reinaldy Rafli
5910c02cc4
ref: allow hosted js sdk bundles (#3365)
* ref: allow hosted js sdk bundles


---------

Co-authored-by: Burak Yigit Kaya <ben@byk.im>
2024-10-07 16:03:28 -07:00
Michal Kuffa
534a874c0b
Remove cdc and wal2json and use the default postgres entrypoint (#3260)
* Remove cdc and wal2json and use the default postgres entrypoint

* Remove the last bits of wal2json install

* Remove read-only postgres volume bind
2024-08-12 09:12:37 -07:00
Hubert Deng
a6cb076910
Use general kafka topic creation in self-hosted (#3121)
* use general kafka topic creation
2024-06-12 15:37:15 -07:00
Hubert Deng
67382fd2ab
Upgrade clickhouse to 23.8 (#3009)
* upgrade clickhouse
2024-05-06 09:22:03 -07:00
Hubert Deng
6db528d71a
Bump kafka and zookeeper versions (#2988)
* bump kafka and zookeeper versions
2024-04-30 12:32:22 -07:00
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