Skip to content

Commit 20e608b

Browse files
committed
Merge branch 'master' into byk/feat/s3-nodestore
2 parents a0ae9b1 + 8c1653d commit 20e608b

File tree

5 files changed

+54
-41
lines changed

5 files changed

+54
-41
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,24 @@ jobs:
9494
path: |
9595
/var/lib/docker/volumes/sentry-postgres/_data
9696
/var/lib/docker/volumes/sentry-clickhouse/_data
97+
/var/lib/docker/volumes/sentry-kafka/_data
9798
9899
- name: Install ${{ env.LATEST_TAG }}
99-
run: ./install.sh
100+
env:
101+
SKIP_DB_MIGRATIONS: ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
102+
run: |
103+
# This is for the cache restore on Kafka to work in older releases
104+
docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
105+
./install.sh
100106
101107
- name: Prepare Docker Volume Caching
102108
run: |
103109
# Set permissions for docker volumes so we can cache and restore
104110
sudo chmod o+x /var/lib/docker
105111
sudo chmod -R o+rx /var/lib/docker/volumes
112+
# Set tar ownership for it to be able to read
113+
# From: https://github.com/actions/toolkit/issues/946#issuecomment-1726311681
114+
sudo chown root /usr/bin/tar && sudo chmod u+s /usr/bin/tar
106115
107116
- name: Save DB Volumes Cache
108117
if: steps.restore_cache.outputs.cache-hit != 'true'
@@ -112,12 +121,22 @@ jobs:
112121
path: |
113122
/var/lib/docker/volumes/sentry-postgres/_data
114123
/var/lib/docker/volumes/sentry-clickhouse/_data
124+
/var/lib/docker/volumes/sentry-kafka/_data
115125
116126
- name: Checkout current ref
117127
uses: actions/checkout@v4
118128

119129
- name: Install current ref
120-
run: ./install.sh
130+
run: |
131+
# This is for the cache restore on Kafka to work in older releases
132+
docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
133+
./install.sh
134+
135+
- name: Inspect failure
136+
if: failure()
137+
run: |
138+
docker compose ps
139+
docker compose logs
121140
122141
integration-test:
123142
if: github.repository_owner == 'getsentry'
@@ -192,19 +211,24 @@ jobs:
192211
path: |
193212
/var/lib/docker/volumes/sentry-postgres/_data
194213
/var/lib/docker/volumes/sentry-clickhouse/_data
214+
/var/lib/docker/volumes/sentry-kafka/_data
195215
196216
- name: Install self-hosted
197-
uses: nick-fields/retry@v3
198-
with:
199-
timeout_minutes: 10
200-
max_attempts: 3
201-
command: ./install.sh
217+
env:
218+
SKIP_DB_MIGRATIONS: ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
219+
run: |
220+
# This is for the cache restore on Kafka to work in older releases
221+
docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
222+
./install.sh
202223
203224
- name: Prepare Docker Volume Caching
204225
run: |
205226
# Set permissions for docker volumes so we can cache and restore
206227
sudo chmod o+x /var/lib/docker
207228
sudo chmod -R o+rx /var/lib/docker/volumes
229+
# Set tar ownership for it to be able to read
230+
# From: https://github.com/actions/toolkit/issues/946#issuecomment-1726311681
231+
sudo chown root /usr/bin/tar && sudo chmod u+s /usr/bin/tar
208232
209233
- name: Save DB Volumes Cache
210234
if: steps.restore_cache.outputs.cache-hit != 'true'
@@ -214,6 +238,7 @@ jobs:
214238
path: |
215239
/var/lib/docker/volumes/sentry-postgres/_data
216240
/var/lib/docker/volumes/sentry-clickhouse/_data
241+
/var/lib/docker/volumes/sentry-kafka/_data
217242
218243
- name: Integration Test
219244
run: |

install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ source install/check-minimum-requirements.sh
2424
# in order to determine whether or not the clickhouse version needs to be upgraded.
2525
source install/upgrade-clickhouse.sh
2626
source install/turn-things-off.sh
27-
source install/update-docker-volume-permissions.sh
2827
source install/create-docker-volumes.sh
2928
source install/ensure-files-from-examples.sh
3029
source install/check-memcached-backend.sh
Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
echo "${_group}Setting up / migrating database ..."
22

3-
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
4-
$dc up --wait postgres
3+
if [[ -z "${SKIP_DB_MIGRATIONS:-}" ]]; then
4+
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
5+
$dc up --wait postgres
56

6-
os=$($dc exec postgres cat /etc/os-release | grep 'ID=debian')
7-
if [[ -z $os ]]; then
8-
echo "Postgres image debian check failed, exiting..."
9-
exit 1
10-
fi
7+
os=$($dc exec postgres cat /etc/os-release | grep 'ID=debian')
8+
if [[ -z $os ]]; then
9+
echo "Postgres image debian check failed, exiting..."
10+
exit 1
11+
fi
1112

12-
# Using django ORM to provide broader support for users with external databases
13-
$dcr web shell -c "
13+
# Using django ORM to provide broader support for users with external databases
14+
$dcr web shell -c "
1415
from django.db import connection
1516
1617
with connection.cursor() as cursor:
1718
cursor.execute('ALTER TABLE IF EXISTS sentry_groupedmessage DROP CONSTRAINT IF EXISTS sentry_groupedmessage_project_id_id_515aaa7e_uniq;')
1819
cursor.execute('DROP INDEX IF EXISTS sentry_groupedmessage_project_id_id_515aaa7e_uniq;')
1920
"
2021

21-
if [[ -n "${CI:-}" || "${SKIP_USER_CREATION:-0}" == 1 ]]; then
22-
$dcr web upgrade --noinput --create-kafka-topics
23-
echo ""
24-
echo "Did not prompt for user creation. Run the following command to create one"
25-
echo "yourself (recommended):"
26-
echo ""
27-
echo " $dc_base run --rm web createuser"
28-
echo ""
22+
if [[ -n "${CI:-}" || "${SKIP_USER_CREATION:-0}" == 1 ]]; then
23+
$dcr web upgrade --noinput --create-kafka-topics
24+
echo ""
25+
echo "Did not prompt for user creation. Run the following command to create one"
26+
echo "yourself (recommended):"
27+
echo ""
28+
echo " $dc_base run --rm web createuser"
29+
echo ""
30+
else
31+
$dcr web upgrade --create-kafka-topics
32+
fi
2933
else
30-
$dcr web upgrade --create-kafka-topics
34+
echo "Skipped DB migrations due to SKIP_DB_MIGRATIONS=$SKIP_DB_MIGRATIONS"
3135
fi
32-
3336
echo "${_endgroup}"

install/update-docker-volume-permissions.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

install/wrap-up.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,3 @@ else
2828
echo "-----------------------------------------------------------------"
2929
echo ""
3030
fi
31-
32-
# TODO(getsentry/self-hosted#2489)
33-
if docker volume ls | grep -qw sentry-zookeeper; then
34-
docker volume rm sentry-zookeeper
35-
fi

0 commit comments

Comments
 (0)