Skip to content

Commit 2809033

Browse files
authored
Merge branch 'master' into byk/feat/s3-nodestore
2 parents 8d7c1ff + a2447aa commit 2809033

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1125
-437
lines changed

.env

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ SENTRY_EVENT_RETENTION_DAYS=90
99
SENTRY_BIND=9000
1010
# Set SENTRY_MAIL_HOST to a valid FQDN (host/domain name) to be able to send emails!
1111
# SENTRY_MAIL_HOST=example.com
12-
SENTRY_IMAGE=getsentry/sentry:nightly
13-
SNUBA_IMAGE=getsentry/snuba:nightly
14-
RELAY_IMAGE=getsentry/relay:nightly
15-
SYMBOLICATOR_IMAGE=getsentry/symbolicator:nightly
16-
VROOM_IMAGE=getsentry/vroom:nightly
12+
SENTRY_IMAGE=ghcr.io/getsentry/sentry:nightly
13+
SNUBA_IMAGE=ghcr.io/getsentry/snuba:nightly
14+
RELAY_IMAGE=ghcr.io/getsentry/relay:nightly
15+
SYMBOLICATOR_IMAGE=ghcr.io/getsentry/symbolicator:nightly
16+
TASKBROKER_IMAGE=ghcr.io/getsentry/taskbroker:nightly
17+
VROOM_IMAGE=ghcr.io/getsentry/vroom:nightly
18+
UPTIME_CHECKER_IMAGE=ghcr.io/getsentry/uptime-checker:nightly
1719
HEALTHCHECK_INTERVAL=30s
1820
HEALTHCHECK_TIMEOUT=1m30s
1921
HEALTHCHECK_RETRIES=10

.github/ISSUE_TEMPLATE/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ body:
1515
- [ ] [`snuba`](https://github.com/getsentry/snuba/actions/workflows/release.yml)
1616
- [ ] [`symbolicator`](https://github.com/getsentry/symbolicator/actions/workflows/release.yml)
1717
- [ ] [`vroom`](https://github.com/getsentry/vroom/actions/workflows/release.yaml)
18+
- [ ] [`taskbroker`](https://github.com/getsentry/taskbroker/actions/workflows/release.yml)
1819
- [ ] Release self-hosted.
1920
- [ ] [Prepare the `self-hosted` release](https://github.com/getsentry/self-hosted/actions/workflows/release.yml) (_replace with publish issue repo link_).
2021
- [ ] Check to make sure the new release branch in self-hosted includes the appropriate CalVer images.

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ updates:
66
interval: daily
77
open-pull-requests-limit: 0 # only security updates
88
reviewers:
9-
- "@getsentry/open-source"
9+
- "@getsentry/dev-infra"
1010
- "@getsentry/security"
1111

1212
- package-ecosystem: "github-actions"
@@ -15,5 +15,5 @@ updates:
1515
# Check for updates to GitHub Actions every week
1616
interval: "weekly"
1717
reviewers:
18-
- "@getsentry/open-source"
18+
- "@getsentry/dev-infra"
1919
- "@getsentry/security"

.github/workflows/enforce-license-compliance.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
enforce-license-compliance:
11+
if: github.repository_owner == 'getsentry'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: 'Enforce License Compliance'

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Get auth token
2323
id: token
24-
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
24+
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
2525
with:
2626
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
2727
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
@@ -49,7 +49,7 @@ jobs:
4949
- uses: actions/checkout@v4
5050
with:
5151
fetch-depth: 0
52-
- uses: getsentry/action-release@v1
52+
- uses: getsentry/action-release@v3
5353
env:
5454
SENTRY_ORG: self-hosted
5555
SENTRY_PROJECT: installer

.github/workflows/shellcheck.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: "ShellCheck"
3+
on:
4+
push:
5+
paths:
6+
- "**.sh"
7+
branches: [master]
8+
pull_request:
9+
paths:
10+
- "**.sh"
11+
branches: [master]
12+
13+
jobs:
14+
shellcheck:
15+
name: ShellCheck
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Repository checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Run ShellCheck
24+
run: |
25+
git diff --name-only -z `git merge-base origin/master HEAD` -- \
26+
install/_lib.sh \
27+
'optional-modifications/**.sh' \
28+
'scripts/**.sh' \
29+
unit-test.sh \
30+
'workstation/**.sh' \
31+
| xargs -0 -r -- \
32+
shellcheck \
33+
--shell=bash \
34+
--format=json1 \
35+
--external-sources \
36+
| jq -r '
37+
.comments
38+
| map(.level |= if ([.] | inside(["info", "style"])) then "notice" else . end)
39+
| .[] as $note
40+
| "::\($note.level) file=\($note.file),line=\($note.line),endLine=\($note.endLine),col=\($note.column),endColumn=\($note.endColumn)::[SC\($note.code)] \($note.message)"
41+
' \
42+
| grep . >&2 && exit 1
43+
44+
exit 0

.github/workflows/test.yml

Lines changed: 14 additions & 226 deletions
Original file line numberDiff line numberDiff line change
@@ -19,250 +19,38 @@ defaults:
1919
run:
2020
shell: bash
2121
jobs:
22-
e2e-test:
23-
if: github.repository_owner == 'getsentry'
24-
runs-on: ubuntu-22.04
25-
name: "Sentry self-hosted end-to-end tests"
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
with:
30-
path: self-hosted
31-
32-
- name: End to end tests
33-
uses: getsentry/action-self-hosted-e2e-tests@main
34-
with:
35-
project_name: self-hosted
36-
3722
unit-test:
3823
if: github.repository_owner == 'getsentry'
39-
runs-on: ubuntu-22.04
40-
name: "unit tests"
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
os: [ubuntu-24.04, ubuntu-24.04-arm]
28+
name: ${{ matrix.os == 'ubuntu-24.04-arm' && 'unit tests (arm64)' || 'unit tests' }}
4129
steps:
4230
- name: Checkout
4331
uses: actions/checkout@v4
4432

45-
- name: Unit Tests
46-
run: ./unit-test.sh
47-
48-
upgrade-test:
49-
if: github.repository_owner == 'getsentry'
50-
runs-on: ubuntu-22.04
51-
name: "Sentry upgrade test"
52-
env:
53-
REPORT_SELF_HOSTED_ISSUES: 0
54-
steps:
55-
- name: Get latest self-hosted release version
56-
run: |
57-
LATEST_TAG=$(curl -s https://api.github.com/repos/getsentry/self-hosted/releases/latest | jq -r '.tag_name')
58-
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
59-
60-
- name: Checkout latest release
61-
uses: actions/checkout@v4
62-
with:
63-
ref: ${{ env.LATEST_TAG }}
64-
6533
- name: Get Compose
66-
run: |
67-
# Docker Compose v1 is installed here, remove it
68-
sudo rm -f "/usr/local/bin/docker-compose"
69-
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
70-
sudo mkdir -p "/usr/local/lib/docker/cli-plugins"
71-
sudo curl -L https://github.com/docker/compose/releases/download/v2.26.0/docker-compose-`uname -s`-`uname -m` -o "/usr/local/lib/docker/cli-plugins/docker-compose"
72-
sudo chmod +x "/usr/local/lib/docker/cli-plugins/docker-compose"
73-
74-
- name: Prepare Docker Volume Caching
75-
id: cache_key
76-
run: |
77-
# Set permissions for docker volumes so we can cache and restore
78-
sudo chmod o+x /var/lib/docker
79-
sudo chmod -R o+rwx /var/lib/docker/volumes
80-
source .env
81-
SENTRY_IMAGE_SHA=$(docker buildx imagetools inspect $SENTRY_IMAGE --format "{{println .Manifest.Digest}}")
82-
echo "SENTRY_IMAGE_SHA=$SENTRY_IMAGE_SHA" >> $GITHUB_OUTPUT
83-
SNUBA_IMAGE_SHA=$(docker buildx imagetools inspect $SNUBA_IMAGE --format "{{println .Manifest.Digest}}")
84-
echo "SNUBA_IMAGE_SHA=$SNUBA_IMAGE_SHA" >> $GITHUB_OUTPUT
85-
86-
- name: Restore DB Volumes Cache
87-
id: restore_cache
88-
uses: actions/cache/restore@v4
89-
with:
90-
key: db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}-${{ steps.cache_key.outputs.SNUBA_IMAGE_SHA }}
91-
restore-keys: |
92-
db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}
93-
db-volumes-v4-
94-
path: |
95-
/var/lib/docker/volumes/sentry-postgres/_data
96-
/var/lib/docker/volumes/sentry-clickhouse/_data
97-
/var/lib/docker/volumes/sentry-kafka/_data
34+
uses: ./get-compose-action
9835

99-
- name: Install ${{ env.LATEST_TAG }}
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
106-
107-
- name: Prepare Docker Volume Caching
108-
run: |
109-
# Set permissions for docker volumes so we can cache and restore
110-
sudo chmod o+x /var/lib/docker
111-
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
115-
116-
- name: Save DB Volumes Cache
117-
if: steps.restore_cache.outputs.cache-hit != 'true'
118-
uses: actions/cache/save@v4
119-
with:
120-
key: ${{ steps.restore_cache.outputs.cache-primary-key }}
121-
path: |
122-
/var/lib/docker/volumes/sentry-postgres/_data
123-
/var/lib/docker/volumes/sentry-clickhouse/_data
124-
/var/lib/docker/volumes/sentry-kafka/_data
125-
126-
- name: Checkout current ref
127-
uses: actions/checkout@v4
128-
129-
- name: Install current ref
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
36+
- name: Unit Tests
37+
run: ./unit-test.sh
14038

14139
integration-test:
14240
if: github.repository_owner == 'getsentry'
143-
runs-on: ubuntu-22.04
144-
name: integration test ${{ matrix.compose_version }} - customizations ${{ matrix.customizations }}
41+
runs-on: ${{ matrix.os }}
14542
strategy:
146-
fail-fast: false
14743
matrix:
148-
customizations: ["disabled", "enabled"]
149-
compose_version: ["v2.19.0", "v2.26.0"]
150-
include:
151-
- compose_version: "v2.19.0"
152-
compose_path: "/usr/local/lib/docker/cli-plugins"
153-
- compose_version: "v2.26.0"
154-
compose_path: "/usr/local/lib/docker/cli-plugins"
44+
os: [ubuntu-24.04, ubuntu-24.04-arm]
45+
name: ${{ matrix.os == 'ubuntu-24.04-arm' && 'integration test (arm64)' || 'integration test' }}
15546
env:
156-
COMPOSE_PROJECT_NAME: self-hosted-${{ strategy.job-index }}
15747
REPORT_SELF_HOSTED_ISSUES: 0
15848
SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }}
15949
steps:
16050
- name: Checkout
16151
uses: actions/checkout@v4
16252

163-
- name: Setup dev environment
164-
run: |
165-
pip install -r requirements-dev.txt
166-
echo "PY_COLORS=1" >> "$GITHUB_ENV"
167-
### pytest-sentry configuration ###
168-
if [ "$GITHUB_REPOSITORY" = "getsentry/self-hosted" ]; then
169-
echo "PYTEST_SENTRY_DSN=$SELF_HOSTED_TESTING_DSN" >> $GITHUB_ENV
170-
echo "PYTEST_SENTRY_TRACES_SAMPLE_RATE=0" >> $GITHUB_ENV
171-
172-
# This records failures on master to sentry in order to detect flakey tests, as it's
173-
# expected that people have failing tests on their PRs
174-
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
175-
echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV
176-
fi
177-
fi
178-
179-
- name: Get Compose
180-
run: |
181-
# Always remove `docker compose` support as that's the newer version
182-
# and comes installed by default nowadays.
183-
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
184-
# Docker Compose v1 is installed here, remove it
185-
sudo rm -f "/usr/local/bin/docker-compose"
186-
sudo rm -f "${{ matrix.compose_path }}/docker-compose"
187-
sudo mkdir -p "${{ matrix.compose_path }}"
188-
sudo curl -L https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-`uname -s`-`uname -m` -o "${{ matrix.compose_path }}/docker-compose"
189-
sudo chmod +x "${{ matrix.compose_path }}/docker-compose"
190-
191-
- name: Prepare Docker Volume Caching
192-
id: cache_key
193-
run: |
194-
# Set permissions for docker volumes so we can cache and restore
195-
sudo chmod o+x /var/lib/docker
196-
sudo chmod -R o+rwx /var/lib/docker/volumes
197-
source .env
198-
SENTRY_IMAGE_SHA=$(docker buildx imagetools inspect $SENTRY_IMAGE --format "{{println .Manifest.Digest}}")
199-
echo "SENTRY_IMAGE_SHA=$SENTRY_IMAGE_SHA" >> $GITHUB_OUTPUT
200-
SNUBA_IMAGE_SHA=$(docker buildx imagetools inspect $SNUBA_IMAGE --format "{{println .Manifest.Digest}}")
201-
echo "SNUBA_IMAGE_SHA=$SNUBA_IMAGE_SHA" >> $GITHUB_OUTPUT
202-
203-
- name: Restore DB Volumes Cache
204-
id: restore_cache
205-
uses: actions/cache/restore@v4
206-
with:
207-
key: db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}-${{ steps.cache_key.outputs.SNUBA_IMAGE_SHA }}
208-
restore-keys: |
209-
db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}
210-
db-volumes-v4-
211-
path: |
212-
/var/lib/docker/volumes/sentry-postgres/_data
213-
/var/lib/docker/volumes/sentry-clickhouse/_data
214-
/var/lib/docker/volumes/sentry-kafka/_data
215-
216-
- name: Install self-hosted
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
223-
224-
- name: Prepare Docker Volume Caching
225-
run: |
226-
# Set permissions for docker volumes so we can cache and restore
227-
sudo chmod o+x /var/lib/docker
228-
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
232-
233-
- name: Save DB Volumes Cache
234-
if: steps.restore_cache.outputs.cache-hit != 'true'
235-
uses: actions/cache/save@v4
236-
with:
237-
key: ${{ steps.restore_cache.outputs.cache-primary-key }}
238-
path: |
239-
/var/lib/docker/volumes/sentry-postgres/_data
240-
/var/lib/docker/volumes/sentry-clickhouse/_data
241-
/var/lib/docker/volumes/sentry-kafka/_data
242-
243-
- name: Integration Test
244-
run: |
245-
docker compose up --wait
246-
if [ "${{ matrix.compose_version }}" = "v2.19.0" ]; then
247-
pytest --reruns 3 --cov --junitxml=junit.xml _integration-test/ --customizations=${{ matrix.customizations }}
248-
else
249-
pytest --cov --junitxml=junit.xml _integration-test/ --customizations=${{ matrix.customizations }}
250-
fi
251-
252-
- name: Inspect failure
253-
if: failure()
254-
run: |
255-
docker compose ps
256-
docker compose logs
257-
258-
- name: Upload coverage to Codecov
259-
uses: codecov/codecov-action@v5
260-
with:
261-
token: ${{ secrets.CODECOV_TOKEN }}
262-
slug: getsentry/self-hosted
263-
264-
- name: Upload test results to Codecov
265-
if: ${{ !cancelled() }}
266-
uses: codecov/test-results-action@v1
53+
- name: Use action from local checkout
54+
uses: './'
26755
with:
268-
token: ${{ secrets.CODECOV_TOKEN }}
56+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
exclude: '\.patch$'
12
repos:
23
- repo: local
34
hooks:
@@ -11,7 +12,6 @@ repos:
1112
args: [-w, -d]
1213
files: .*\.sh
1314
stages: [commit, merge-commit, push, manual]
14-
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
1616
rev: v4.3.0
1717
hooks:

0 commit comments

Comments
 (0)