166 Commits

Author SHA1 Message Date
Reinaldy Rafli
ebace8c662
fix: grep seaweedfs bucket name instead of using awk (#4076)
* fix: grep seaweedfs bucket name instead of using awk

Closes https://github.com/getsentry/self-hosted/issues/4075

* fix: inverted logic gate

* chore: file permission
2025-12-03 11:57:54 +00:00
Copilot
c9aa6268f5
Add dcx shortcut for docker compose exec with HTTP proxy env vars (#4067)
* Initial plan

* Add dcep shortcut for docker compose exec with http proxy

Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

* Quote environment variable values in dcep shortcut

Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

* Rename dcep to dcx (docker compose exec shortcut)

Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

* Move dcx after if/else block and use exec_proxy_args for DRY

Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

* Remove exec_proxy_args and inline proxy flags in dcx

Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

* Add exec_proxy_args variable and use it in dcx definition

Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

* Use $dcx shortcut in bootstrap-s3-profiles.sh

Co-authored-by: aldy505 <7274326+aldy505@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
Co-authored-by: Reinaldy Rafli <github@reinaldyrafli.com>
Co-authored-by: aldy505 <7274326+aldy505@users.noreply.github.com>
2025-11-28 09:48:01 +00:00
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
5a670d1c5f
fix: ensure seaweedfs lifecycle policy is set correctly (#4040) 2025-11-28 07:23:21 +07:00
Reinaldy Rafli
60da8f6eb0
fix: geoip standalone script should check on CONTAINER_ENGINE variable first (#3982) 2025-10-15 20:31:03 +07:00
Amin Vakil
da1f546bfb
Remove symbolicator volume once (#3994)
* Remove sentry-symbolicator only if it exists

* Remove unnecessary volume remove force flag
2025-10-11 07:07:40 +07:00
Amin Vakil
e1f003313e
Remove symbolicator external volume (#3992)
* Remove symbolicator volume creation command

* Remove symbolicator volume

* Create sentry-symbolicator on docker compose up

* Pass volume name to remove_command

* Remove sentry-symbolicator from unit test
2025-10-10 09:14:41 +07:00
Klemens Böswirth
2d11de51e5
fix: logic error in s3 install script (#3965) 2025-09-26 14:13:59 +00:00
Mark Story
0ffcf0e126
chore(tasks) Remove reference to celery (#3962) 2025-09-25 00:44:49 +01:00
Amin Vakil
18b7a4d1cc
Respect uppercase proxy variables (#3949)
* Respect uppercase proxy variables

* Put http_proxy first
2025-09-23 21:01:30 +07:00
Moroine Bentefrit
8fc3efac78
fix: install behind a proxy (#3944)
Updated the s3cmd installation command to include proxy environment variables.
2025-09-19 14:07:51 +00:00
Reinaldy Rafli
a222e3f8de
fix: able to setup nodestore multiple times (#3940)
* fix: able to setup nodestore multiple times

* fix(test): chmod issues
2025-09-16 15:01:13 +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
Reinaldy Rafli
2e7a3ff7ad
feat: install script to migrate sentry.conf.py config to use pgbouncer (#3898) 2025-09-12 21:02:59 +07:00
Reinaldy Rafli
ce45294491
chore(deps): bump clickhouse to 25.3 (#3878)
* chore(deps): bump clickhouse to 25.3

* fix: wrong volume path for clickhouse default password:
2025-09-12 07:39:27 +07:00
Reinaldy Rafli
de2139890d
fix: ensuring vroom permission should be skipped on errors-only (#3911)
* fix: ensuring vroom permission should be skipped on errors-only

* feat: enable swap on all runners

* feat: don't exit on install script
2025-09-02 21:35:33 +07:00
Frederik Spang
2862432828
Add pgbouncer (#3884)
* Add patch for pgbouncer

* pgcat over pgbouncer

* Add patch for .env file

* Apply patches and add initial pgcat tolm file

* feat: hardcode pgcat image

* Fixes from review

* Align usernames defaults

* Remove postgres from default depends_on; Covered by pgcat by extension

* Set user and password - pgcat maybe doesnt support host auth trust

* Pool name maybe has to match, for some reason

* Use healthcheck from pgcat PR

* Reduce pool size, leave some for healthchecks and other clients running

* Start pgcat for bash scripts with postgres

* Update docker-compose.yml

* Use pgbouncer

* Revert to TRUST method
2025-08-23 20:18:13 +07:00
Iven Schlenther
657a685cbe
fix(enhancement): search for permissions on docker container instead of host and combine it in one command for performance enhancement (#3890)
* fix(enhancement): ensure correct ownership check before setting permissions of profiles

* fix(enhancement): search for permissions on docker container instead of host and combine it in one command for performance enhancement

Resolves #3882

* fix(enhancement): search for permissions on docker container instead of host
2025-08-19 19:39:04 +01:00
Amin Vakil
0f606d28b8
Set minimum bash version to 4.4.0 (#3873) 2025-08-14 11:41:49 +00:00
Kamil Monicz
2b549baee7
fix(scripts): use env to find bash interpreter (#3861) 2025-08-10 07:48:47 +07:00
Iven Schlenther
a36deff0af
fix(enhancement): ensure correct ownership check before setting permissions of profiles (#3855) 2025-08-06 10:44:23 +01:00
Daniel Bunte
abe34d09ed
feat(install): Adds support for podman(compose) (#3673) 2025-07-22 13:58:07 +00:00
Burak Yigit Kaya
433eed8fb7
ref(js-assets): Simplify how we call nginx container (#3761) 2025-06-18 04:47:23 +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
Nikita Korolev
0730d8c8c7
add shellcheck action to lint bash scripts (#3710)
* add shellcheck action to lint bash scripts

* fix some shellcheck warnings

---------

Co-authored-by: ds <ds@local>
Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
2025-06-13 08:52:47 +00:00
anthony sottile
ed04842604
remove index workaround (#3730)
a hard stop is in place with this so it can be removed now
2025-06-03 20:56:16 +00: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
Amin Vakil
6b4487f032
Use dc variable in clickhouse step (#3658) 2025-04-12 18:30:25 +03:00
Amin Vakil
53412bbefb
Fix STANDALONE_COMPOSE_VERSION variable setting (#3654) 2025-04-12 18:29:38 +03:00
Kliachin Aleksei
ae05091f9f
Minimum requirements for 'errors-only' profile (#3634)
Using the [errors-only](https://develop.sentry.dev/self-hosted/experimental/errors-only/) profile, fewer resources are required. About 2 times.
2025-03-27 09:14:02 +00:00
Reinaldy Rafli
d350bd4b7d
fix: js-sdk directory/file permission should be set correctly (#3616) 2025-03-18 12:26:48 +00:00
Brett Higgins
979f219355
Fix unbound variable error in install script (#3601) 2025-03-06 10:46:16 +00:00
Amin Vakil
d08a6d9b66
Add --short to docker-compose version (#3605) 2025-03-06 10:45:47 +00:00
Burak Yigit Kaya
e86d185145
ref: Less complicated docker compose detection (#3604)
With #3595, we now check both `docker-compose` and `docker compose` versions so this patch removes the implicit fallback to `docker-compose` for `$dc_base` and makes it explicit.
2025-03-05 12:25:50 -08:00
Amin Vakil
d885dd331f
Use docker-compose if version is gte docker compose (#3595)
Fixes #3587 

This PR tries to use docker-compose if its version is greater than docker compose.
2025-03-03 13:16:31 +00:00
Reinaldy Rafli
ee3cbf0f91
feat: merge .env and .env.custom file during installation (#3564)
Closes https://github.com/getsentry/self-hosted/issues/3558
2025-02-04 12:41:12 +00:00
Burak Yigit Kaya
559e732468
breaking: Upgrade min Compose version to 2.23.2 (#3535)
In this version, there's a new `--pull` argument for `docker compose run` which we will start leveraging, especially with `sentry-admin` command.

Should come with a slight speed boost.
2025-01-16 21:45:07 +00:00
Burak Yigit Kaya
3913a9f0c7
ci: Even better cache keys and granular caching (#3534)
Just starting up services for Snuba or Sentry migrations takes up to a minute sometimes and we do this even when there are no migrations, just because one of the Sentry or Snuba migrations change. This patch splits the caches up so only the necessary one runs, saving further time. It also uses the `LATEST_TAG` as the cache key for upgrade tests as the image versions or data will never change for a certain tag once it is release.
2025-01-16 10:10:14 -08:00
Burak Yigit Kaya
f21b16d0ec
ci: Use generic Docker volume cache action (#3524)
See https://github.com/BYK/docker-volume-cache-action
2025-01-14 14:09:11 -08:00
Reinaldy Rafli
b439c67e17
docs: include regular env file on wrap-up (#3523) 2025-01-12 20:00:52 +00:00
Burak Yigit Kaya
f97a5e2390
ci: Faster and smarter backup/restore tests (#3516)
From
```
================== 11 passed, 4 warnings in 762.35s (0:12:42) ==================
```

to
```
================== 11 passed, 4 warnings in 343.58s (0:05:43) ==================
```
2025-01-11 21:59:13 +00:00
Burak Yigit Kaya
8c1653dc4a
ci: Skip DB ops during install completely on cache hit (#3496)
Follow up to #3488

A new record: 2m 8s for installing self-hosted:
![image](https://github.com/user-attachments/assets/7cc6409d-5388-49ba-ad87-b7a1e99c9acc)
2024-12-31 13:26:22 -08:00
Hubert Deng
8653327bc1
chore: Remove everything zookeeper (#3499) 2024-12-31 18:53:14 +00:00
Burak Yigit Kaya
282410abff
ref(snuba): Combine bootstrap & migrate for faster bootstrap (#3491)
I think we split these actions in the past due to some lack of options for them to work together properly. Right now looks like `bootstrap` would automatically migrate and propagates the `force` flag.
2024-12-24 02:05:22 +03:00
Burak Yigit Kaya
ad39dabdf0
ref(geoip): Remove geoipupdate from compose (#3490)
`geoipupdate` is not used by any other service nor it is needed for any
service to run. Moreover, it is a one-shot command, causing
`docker compose up --wait` to fail when it exits with a non-zero status.
This happens when one has not yet set up their credentials and they may
choose to never do this.

This PR removes `geoipupdate` from the `docker-compose.yml` file and
moves the command directly into the geoip related script. One may run
this whenever they want to update their GeoIP database.

This PR needs an accompanying docs change.
2024-12-23 14:32:17 -08:00
Burak Yigit Kaya
49e30a7356
fix: Use js.sentry-cdn.com for JS SDK downloads (#3417)
Since we download JS SDKs in a for loop which invokes a separate docker container for each `curl` run, we seem to be triggering some sort of a DoS protection. And rightfully so as the old method causes TCP and TLS churn although we advertise we support HTTP/1.1 and HTTP/2.

This patch does a few things:

1. Uses `curl`s globbing support to download all files in one go, maxing TCP and TLS reuse. This should fix the DoS protection
2. Uses `curl`'s `--compress` option to make things even more efficient
3. Uses `curl`'s `--create-dirs` to save 1 docker container run per version for creating the directory
4. Removes the `-I` `HEAD` checks in favor of a `-f` fail option combined with `|| true` which makes curl fail and not write the output on a non-200 response while still allowing the script to succeed
5. To make sure the above approach works, it adds a file size test, requiring all downloaded files to be larger than 1kB
2024-11-07 12:25:53 +00:00
Reinaldy Rafli
2a7abf215e
fix(loader): provide js sdk assets from 4.x (#3415)
Hopefully fixes https://github.com/getsentry/sentry/issues/22715#issuecomment-2458066842

### 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.
2024-11-07 10:11:07 +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
joshuarli
3cf323843a
fix: more leeway for minimum RAM (#3290)
more generous leeway
2024-08-23 12:32:52 -07:00
Hubert Deng
b6de547e45
Mandate minimum requirements for ram/cpu (#3275) 2024-08-17 12:26:50 -07:00