Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
618027e
WIP - Working version using Relay for event ingestion.
RaduW Mar 30, 2020
8cc2621
Changes from code review, still needs work on authentication informat…
RaduW Apr 3, 2020
7c630fa
generate Relay credentials at install time
RaduW Apr 6, 2020
2c7052f
generate Relay credentials at install time
RaduW Apr 6, 2020
5a1248f
increase travis timeout until the web service responds
RaduW Apr 6, 2020
c239ece
update web check to the login url
RaduW Apr 6, 2020
a8dd78d
set user when generating credentials (to fix linux installations)
RaduW Apr 7, 2020
e1b9047
fix sed command line to work both on Mac & Linux
RaduW Apr 7, 2020
a80c0be
WIP - back to login url
RaduW Apr 7, 2020
f607bf6
WIP
RaduW Apr 7, 2020
391fd18
WIP - dump container logs in travis
RaduW Apr 7, 2020
4182534
WIP
RaduW Apr 7, 2020
51ba14a
WIP
RaduW Apr 7, 2020
06296ae
WIP
RaduW Apr 7, 2020
61d9479
WIP
RaduW Apr 7, 2020
671bdb4
WIP
RaduW Apr 8, 2020
e232d18
pairing with radu: move back to binds, fix perms problems
untitaker Apr 8, 2020
f011054
make the credential file readable by everybody
RaduW Apr 8, 2020
ac0578d
fix small problems, add more messages
RaduW Apr 8, 2020
dd947ca
more messages to verify everything is ok
RaduW Apr 8, 2020
a566d5b
and more messages to verify everything is ok
RaduW Apr 8, 2020
c897937
minor cleanup
RaduW Apr 8, 2020
54d07a5
Merge branch 'master' into feat/add-relay
RaduW Apr 8, 2020
9482746
Merge branch 'master' into feat/add-relay
BYK Apr 23, 2020
7049363
Update install.sh
RaduW Apr 24, 2020
b2be9fa
Update nginx/nginx.conf
RaduW Apr 24, 2020
6474eed
Forward all store-like endpoints to Relay.
RaduW Apr 24, 2020
6209b0d
fix nginx version to 1.16
RaduW Apr 24, 2020
8255460
Make public-key regex more flexible
RaduW Apr 24, 2020
4fb7745
Remove debug messages
RaduW Apr 24, 2020
63b5e95
Remove redundant "credentials not generated" message
BYK Apr 24, 2020
fa1b666
Merge branch 'master' into feat/add-relay
BYK Apr 24, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ data/
sentry/sentry.conf.py
sentry/config.yml
sentry/requirements.txt
relay/credentials.json
27 changes: 25 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,15 @@ services:
- 'sentry-symbolicator:/data'
web:
<< : *sentry_defaults
ports:
- '9000:9000/tcp'
cron:
<< : *sentry_defaults
command: run cron
worker:
<< : *sentry_defaults
command: run worker
ingest-consumer:
<< : *sentry_defaults
command: run ingest-consumer --all-consumer-types
post-process-forwarder:
<< : *sentry_defaults
# Increase `--commit-batch-size 1` below to deal with high-load environments.
Expand All @@ -161,6 +162,28 @@ services:
args:
BASE_IMAGE: 'sentry-onpremise-local'
command: '"0 0 * * * gosu sentry sentry cleanup --days $SENTRY_EVENT_RETENTION_DAYS"'
nginx:
ports:
- '9000:80/tcp'
image: "nginx:1.16"
volumes:
- type: bind
read_only: true
source: ./nginx
target: /etc/nginx
depends_on:
- web
- relay
relay:
image: "us.gcr.io/sentryio/relay:latest"
command: 'run --config /etc/relay'
volumes:
- type: bind
source: ./relay
target: /etc/relay
depends_on:
- kafka
- redis
volumes:
sentry-data:
external: true
Expand Down
24 changes: 24 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ MIN_RAM=2400 # MB

SENTRY_CONFIG_PY='sentry/sentry.conf.py'
SENTRY_CONFIG_YML='sentry/config.yml'
RELAY_CONFIG_YML='relay/config.yml'
RELAY_CREDENTIALS_JSON='relay/credentials.json'
SENTRY_EXTRA_REQUIREMENTS='sentry/requirements.txt'

DID_CLEAN_UP=0
Expand Down Expand Up @@ -171,6 +173,28 @@ if [ "$SENTRY_DATA_NEEDS_MIGRATION" ]; then
"mkdir -p /tmp/files; mv /data/* /tmp/files/; mv /tmp/files /data/files; chown -R sentry:sentry /data"
fi


if [ ! -f "$RELAY_CREDENTIALS_JSON" ]; then
echo ""
echo "Generating Relay credentials..."

$dcr --user $(id -u) relay --config /etc/relay credentials generate --overwrite
chmod a+r $RELAY_CREDENTIALS_JSON
CREDENTIALS=$(sed -n 's/^.*"public_key"[[:space:]]*:[[:space:]]*"\([a-zA-Z0-9_-]\{1,\}\)".*$/\1/p' "$RELAY_CREDENTIALS_JSON")
CREDENTIALS="SENTRY_RELAY_WHITELIST_PK = [\"$CREDENTIALS\"]"

if grep -xq SENTRY_RELAY_WHITELIST_PK "$SENTRY_CONFIG_PY"; then
>&2 echo "FAIL: SENTRY_RELAY_WHITELIST_PK already exists in $SENTRY_CONFIG_PY, please replace with:"
>&2 echo ""
>&2 echo " $CREDENTIALS"
>&2 echo ""
exit 1
fi

echo "" >> "$SENTRY_CONFIG_PY"
echo "$CREDENTIALS" >> "$SENTRY_CONFIG_PY"
fi

cleanup

echo ""
Expand Down
47 changes: 47 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

sendfile on;

keepalive_timeout 65;

upstream relay {
server relay:3000;
}

upstream sentry {
server web:9000;
}

server {
listen 80;
# use the docker DNS server to resolve ips for relay and sentry containers
resolver 127.0.0.11 ipv6=off;
client_max_body_size 100M;
location /api/store/ {
proxy_pass http://relay;
}
location ~ ^/api/[1-9]\d*/ {
proxy_pass http://relay;
}
location / {
proxy_pass http://sentry;
}
}
}
13 changes: 13 additions & 0 deletions relay/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
relay:
upstream: "http://web:9000/"
host: 0.0.0.0
port: 3000
#logging:
# # Available logging levels: TRACE, DEBUG, INFO, WARN, ERROR
# level: WARN
processing:
enabled: true
kafka_config:
- {name: "bootstrap.servers", value: "kafka:9092"}
redis: redis://redis:6379
1 change: 1 addition & 0 deletions sentry/sentry.conf.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,4 @@

# BITBUCKET_CONSUMER_KEY = 'YOUR_BITBUCKET_CONSUMER_KEY'
# BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET'