Skip to content

Commit 019d372

Browse files
hubertdeng123BYK
andauthored
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 e07445d. 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](https://github.com/getsentry/vroom/pull/601/files/a23a4e395269ca39fd9bd93ecf902cb42530b5cd) worked as the entrypoint script did this at the start of every container instance. --------- Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
1 parent e07445d commit 019d372

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SNUBA_IMAGE=getsentry/snuba:nightly
1414
RELAY_IMAGE=getsentry/relay:nightly
1515
SYMBOLICATOR_IMAGE=getsentry/symbolicator:nightly
1616
TASKBROKER_IMAGE=getsentry/taskbroker:nightly
17-
VROOM_IMAGE=getsentry/vroom:a8e9e04
17+
VROOM_IMAGE=getsentry/vroom:nightly
1818
HEALTHCHECK_INTERVAL=30s
1919
HEALTHCHECK_TIMEOUT=1m30s
2020
HEALTHCHECK_RETRIES=10

docker-compose.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ services:
131131
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
132132
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
133133
command:
134-
[
135-
"postgres",
136-
"-c",
137-
"max_connections=${POSTGRES_MAX_CONNECTIONS:-100}",
138-
]
134+
["postgres", "-c", "max_connections=${POSTGRES_MAX_CONNECTIONS:-100}"]
139135
environment:
140136
POSTGRES_HOST_AUTH_METHOD: "trust"
141137
volumes:
@@ -511,10 +507,10 @@ services:
511507
environment:
512508
SENTRY_KAFKA_BROKERS_PROFILING: "kafka:9092"
513509
SENTRY_KAFKA_BROKERS_OCCURRENCES: "kafka:9092"
514-
PROFILES_DIR: "/var/lib/sentry-profiles"
510+
SENTRY_BUCKET_PROFILES: file:///var/vroom/sentry-profiles
515511
SENTRY_SNUBA_HOST: "http://snuba-api:1218"
516512
volumes:
517-
- sentry-vroom:/var/lib/sentry-profiles
513+
- sentry-vroom:/var/vroom/sentry-profiles
518514
depends_on:
519515
kafka:
520516
<<: *depends_on-healthy
@@ -529,13 +525,12 @@ services:
529525
BASE_IMAGE: "$VROOM_IMAGE"
530526
entrypoint: "/entrypoint.sh"
531527
environment:
532-
PROFILES_DIR: "/var/lib/sentry-profiles"
533528
# Leaving the value empty to just pass whatever is set
534529
# on the host system (or in the .env file)
535530
SENTRY_EVENT_RETENTION_DAYS:
536-
command: '"0 0 * * * find $PROFILES_DIR -type f -mtime +$SENTRY_EVENT_RETENTION_DAYS -delete"'
531+
command: '"0 0 * * * find /var/vroom/sentry-profiles -type f -mtime +$SENTRY_EVENT_RETENTION_DAYS -delete"'
537532
volumes:
538-
- sentry-vroom:/var/lib/sentry-profiles
533+
- sentry-vroom:/var/vroom/sentry-profiles
539534
profiles:
540535
- feature-complete
541536

install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ source install/update-docker-images.sh
3838
source install/build-docker-images.sh
3939
source install/bootstrap-snuba.sh
4040
source install/upgrade-postgres.sh
41+
source install/ensure-correct-permissions-profiles-dir.sh
4142
source install/set-up-and-migrate-database.sh
4243
source install/geoip.sh
4344
source install/setup-js-sdk-assets.sh
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# TODO: Remove this after the next hard-stop
4+
5+
echo "${_group}Ensuring correct permissions on profiles directory ..."
6+
$dcr --no-deps --entrypoint /bin/bash --user root vroom -c 'chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles'
7+
echo "${_endgroup}"

optional-modifications/patches/external-kafka/docker-compose.yml.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@
120120
+ SENTRY_KAFKA_SASL_MECHANISM: ${KAFKA_SASL_MECHANISM:-}
121121
+ SENTRY_KAFKA_SASL_USERNAME: ${KAFKA_SASL_USERNAME:-}
122122
+ SENTRY_KAFKA_SASL_PASSWORD: ${KAFKA_SASL_PASSWORD:-}
123-
SENTRY_BUCKET_PROFILES: file://localhost//var/lib/sentry-profiles
123+
SENTRY_BUCKET_PROFILES: file:///var/vroom/sentry-profiles
124124
SENTRY_SNUBA_HOST: "http://snuba-api:1218"
125125
volumes:
126-
- sentry-vroom:/var/lib/sentry-profiles
126+
- sentry-vroom:/var/vroom/sentry-profiles
127127
- depends_on:
128128
- kafka:
129129
- <<: *depends_on-healthy

0 commit comments

Comments
 (0)