Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
364455b
feat: Use S3 node store with garage
BYK Dec 31, 2024
803bef3
lol, fix bash
BYK Dec 31, 2024
58b301c
moar bash
BYK Dec 31, 2024
bd414d5
lol
BYK Dec 31, 2024
a2ac10d
hate bash
BYK Dec 31, 2024
7b28dfb
fix moar bash
BYK Dec 31, 2024
4a6d337
Add healthcheck to garage service
BYK Dec 31, 2024
595ed68
revert +x
BYK Dec 31, 2024
99576bf
fix healthcheck, fix config
BYK Dec 31, 2024
2a55a40
add env var for garage size
BYK Dec 31, 2024
a29cf0b
use better compression level
BYK Dec 31, 2024
a0ae9b1
simpler garage config
BYK Jan 1, 2025
20e608b
Merge branch 'master' into byk/feat/s3-nodestore
BYK Jan 1, 2025
8d7c1ff
add migration support
BYK Jan 1, 2025
2809033
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Jul 20, 2025
0318e84
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Jul 31, 2025
3ab2d81
feat: use seaweedfs as nodestore backend (#3842)
aldy505 Aug 6, 2025
71b21a6
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Aug 6, 2025
7af258a
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Aug 13, 2025
9c1c324
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Aug 16, 2025
61e0684
chore: add swap for arm64 runners
aldy505 Aug 17, 2025
8db8b5c
ci: debug memory issues for arm64 runners
aldy505 Aug 17, 2025
ca22d67
ci: turn off swapfile first
aldy505 Aug 17, 2025
3a95a77
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Sep 3, 2025
75a9ca5
Merge remote-tracking branch 'origin/master' into byk/feat/s3-nodestore
aldy505 Sep 6, 2025
81cde28
feat: nodestore config update behind a prompt/flag
aldy505 Sep 6, 2025
5aa35db
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Sep 9, 2025
7eb223c
feat: set s3 lifecycle policy
aldy505 Sep 9, 2025
fa3fc92
fix: seaweed is a busybox
aldy505 Sep 9, 2025
ace9191
fix: try xml policy
aldy505 Sep 9, 2025
2f1575d
fix: go back to simplified json
aldy505 Sep 9, 2025
5753667
Revert "fix: go back to simplified json"
aldy505 Sep 9, 2025
27dce85
chore: reword debug lifecycle policy
aldy505 Sep 9, 2025
5369a3d
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Sep 12, 2025
639a35d
fix: don't pollute APPLY_AUTOMATIC_CONFIG_UPDATES variable
aldy505 Sep 13, 2025
95a4de2
Merge branch 'master' into byk/feat/s3-nodestore
aldy505 Sep 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ x-sentry-defaults: &sentry_defaults
<<: *depends_on-default
smtp:
<<: *depends_on-default
garage:
<<: *depends_on-default
snuba-api:
<<: *depends_on-default
symbolicator:
Expand Down Expand Up @@ -139,6 +141,7 @@ services:
kafka:
<<: *restart_policy
image: "confluentinc/cp-kafka:7.6.1"
user: root
environment:
# https://docs.confluent.io/platform/current/installation/docker/config-reference.html#cp-kakfa-example
KAFKA_PROCESS_ROLES: "broker,controller"
Expand Down Expand Up @@ -207,6 +210,14 @@ services:
interval: 10s
timeout: 10s
retries: 30
garage:
image: dxflrs/garage:v1.0.1
volumes:
- type: bind
read_only: true
source: ./garage.toml
target: /etc/garage.toml
- "sentry-garage:/var/lib/garage/"
snuba-api:
<<: *snuba_defaults
# Kafka consumer responsible for feeding events into Clickhouse
Expand Down Expand Up @@ -540,3 +551,4 @@ volumes:
sentry-kafka-log:
sentry-smtp-log:
sentry-clickhouse-log:
sentry-garage:
29 changes: 29 additions & 0 deletions garage.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "sqlite"

replication_factor = 1
# idk why rcp_ is needed without replication but ok
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
# This secret will not ever be used as we are in a single node setup
# so this static value is OK. Don't forget to change it if you ever
# decide to use garage in a multi-node setup.
rpc_secret = "28f2fc651d4f280cea95e166f9113fe589039f9711d6c4f461872c1c5aaf7dec"

compression_level = 2

[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage.localhost"

[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage.localhost"
index = "index.html"

[admin]
api_bind_addr = "0.0.0.0:3903"
metrics_token = "c6k30kKqovA5NoTfKxMVRmnKKVwd7jaF4OB2xshQVEA="
admin_token = "c6k30kKqovA5NoTfKxMVRmnKKVwd7jaF4OB2xshQVEA="
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ source install/ensure-relay-credentials.sh
source install/generate-secret-key.sh
source install/update-docker-images.sh
source install/build-docker-images.sh
source install/bootstrap-garage.sh
source install/bootstrap-snuba.sh
source install/upgrade-postgres.sh
source install/set-up-and-migrate-database.sh
Expand Down
25 changes: 25 additions & 0 deletions install/bootstrap-garage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
echo "${_group}Bootstrapping garage (node store)..."

$dc up --wait garage
garage="$dc exec garage /garage"

if [[ $($garage bucket list | tail -1 | awk '{print $1}') != 'nodestore' ]]; then
node_id=$($garage status | tail -1 | awk '{print $1}')
$garage layout assign -z dc1 -c 100G "$node_id"
$garage layout apply --version 1

$garage bucket create nodestore
key_info=$($garage key create nodestore-key | head -3 | tail -2)
key_id=$(echo "$key_info" | head -1 | awk '{print $3}')
key_secret=$(echo "$key_info" | tail -1 | awk '{print $3}')

$garage bucket allow --read --write --owner nodestore --key nodestore-key

sed -i -e "s/<GARAGE_KEY_ID>/$key_id/" $SENTRY_CONFIG_PY
sed -i -e "s/<GARAGE_SECRET_KEY>/$key_secret/" $SENTRY_CONFIG_PY
echo "Set Garage keys for SENTRY_NODESTORE_OPTIONS in $SENTRY_CONFIG_PY"
else
echo "Node store already exists, skipping..."
fi

echo "${_endgroup}"
6 changes: 4 additions & 2 deletions sentry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
ARG SENTRY_IMAGE
FROM ${SENTRY_IMAGE}

RUN pip install https://github.com/stayallive/sentry-nodestore-s3/archive/main.zip

COPY . /usr/src/sentry

RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then \
/usr/src/sentry/enhance-image.sh; \
fi
fi

RUN if [ -s /usr/src/sentry/requirements.txt ]; then \
echo "sentry/requirements.txt is deprecated, use sentry/enhance-image.sh - see https://develop.sentry.dev/self-hosted/#enhance-sentry-image"; \
pip install -r /usr/src/sentry/requirements.txt; \
fi
fi
19 changes: 19 additions & 0 deletions sentry/sentry.conf.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,25 @@ def get_internal_network():
# See https://develop.sentry.dev/self-hosted/experimental/errors-only/
SENTRY_SELF_HOSTED_ERRORS_ONLY = env("COMPOSE_PROFILES") != "feature-complete"

##############
# Node Store #
##############

SENTRY_NODESTORE = "sentry_nodestore_s3.S3PassthroughDjangoNodeStorage"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need Passthrough for fresh installs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is your original code, so I assume, yes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not assume anything about my original code 😅

SENTRY_NODESTORE_OPTIONS = {
"delete_through": True,
"write_through": False,
"read_through": True,
"compression": False, # we have compression enabled in Garage itself
"endpoint_url": "http://garage:3900",
"bucket_path": "nodestore",
"bucket_name": "nodestore",
"retry_attempts": 3,
"region_name": "garage",
"aws_access_key_id": "<GARAGE_KEY_ID>",
"aws_secret_access_key": "<GARAGE_SECRET_KEY>",
}

#########
# Redis #
#########
Expand Down
Loading