-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Use S3 node store with seaweedfs #3498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
364455b
803bef3
58b301c
bd414d5
a2ac10d
7b28dfb
4a6d337
595ed68
99576bf
2a55a40
a29cf0b
a0ae9b1
20e608b
8d7c1ff
2809033
0318e84
3ab2d81
71b21a6
7af258a
9c1c324
61e0684
8db8b5c
ca22d67
3a95a77
75a9ca5
81cde28
5aa35db
7eb223c
fa3fc92
ace9191
2f1575d
5753667
27dce85
5369a3d
639a35d
95a4de2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
BYK marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
replication_factor = 1 | ||
# idk why rcp_ is needed without replication but ok | ||
rpc_bind_addr = "[::]:3901" | ||
rpc_public_addr = "127.0.0.1:3901" | ||
BYK marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# 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=" |
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" | ||
BYK marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
$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 | ||
BYK marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
echo "Set Garage keys for SENTRY_NODESTORE_OPTIONS in $SENTRY_CONFIG_PY" | ||
else | ||
echo "Node store already exists, skipping..." | ||
fi | ||
|
||
echo "${_endgroup}" |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need Passthrough for fresh installs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is your original code, so I assume, yes. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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>", | ||
} | ||
BYK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
######### | ||
# Redis # | ||
######### | ||
|
Uh oh!
There was an error while loading. Please reload this page.