diff --git a/.env b/.env index 483f3748751..2e488dd5aaf 100644 --- a/.env +++ b/.env @@ -20,6 +20,7 @@ TASKBROKER_IMAGE=ghcr.io/getsentry/taskbroker:nightly VROOM_IMAGE=ghcr.io/getsentry/vroom:nightly UPTIME_CHECKER_IMAGE=ghcr.io/getsentry/uptime-checker:nightly LAUNCHPAD_IMAGE=ghcr.io/getsentry/launchpad:nightly +CHARTCUTERIE_IMAGE=ghcr.io/getsentry/chartcuterie:nightly HEALTHCHECK_INTERVAL=30s HEALTHCHECK_TIMEOUT=1m30s HEALTHCHECK_RETRIES=10 diff --git a/.github/ISSUE_TEMPLATE/release.yml b/.github/ISSUE_TEMPLATE/release.yml index 13d31e431a3..182e45901db 100644 --- a/.github/ISSUE_TEMPLATE/release.yml +++ b/.github/ISSUE_TEMPLATE/release.yml @@ -18,6 +18,7 @@ body: - [ ] [`uptime-checker`](https://github.com/getsentry/uptime-checker/actions/workflows/release.yml) - [ ] [`taskbroker`](https://github.com/getsentry/taskbroker/actions/workflows/release.yml) - [ ] [`launchpad`](https://github.com/getsentry/launchpad/actions/workflows/release.yml) + - [ ] [`chartcuterie`](https://github.com/getsentry/chartcuterie/actions/workflows/release.yml) - [ ] Release self-hosted. - [ ] [Prepare the `self-hosted` release](https://github.com/getsentry/self-hosted/actions/workflows/release.yml) (_replace with publish issue repo link_). - [ ] Check to make sure the new release branch in self-hosted includes the appropriate CalVer images. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e24bdca5251..b1809c345d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,8 +45,8 @@ jobs: matrix: os: [ubuntu-24.04, ubuntu-24.04-arm] container_engine: ['docker'] # TODO: add 'podman' into the list - compose_profiles: ['feature-complete', 'errors-only'] - name: ${{ format('integration test{0}{1}{2}', matrix.os == 'ubuntu-24.04-arm' && ' (arm64)' || '', matrix.container_engine == 'podman' && ' (podman)' || '', matrix.compose_profiles == 'errors-only' && ' (errors-only)' || '') }} + compose_profiles: ['feature-complete', 'errors-only', 'errors-only,chartcuterie'] + name: ${{ format('integration test{0}{1}{2}', matrix.os == 'ubuntu-24.04-arm' && ' (arm64)' || '', matrix.container_engine == 'podman' && ' (podman)' || '', matrix.compose_profiles != 'feature-complete' && format(' ({0})', matrix.compose_profiles) || '' ) }} env: REPORT_SELF_HOSTED_ISSUES: 0 SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }} diff --git a/action.yaml b/action.yaml index 49416a571ff..0906c4b2458 100644 --- a/action.yaml +++ b/action.yaml @@ -53,13 +53,11 @@ runs: exit 1 fi - # `COMPOSE_PROFILES` may only be `feature-complete` or `errors-only` - if [[ "$COMPOSE_PROFILES" != "" && "$COMPOSE_PROFILES" != "feature-complete" && "$COMPOSE_PROFILES" != "errors-only" ]]; then - echo "COMPOSE_PROFILES must be either unset, or set to either 'feature-complete' or 'errors-only'." - exit 1 - else - echo "COMPOSE_PROFILES=$COMPOSE_PROFILES" >> ${{ github.action_path }}/.env - fi + # Compose profiles can be anything at this point + echo "COMPOSE_PROFILES=$COMPOSE_PROFILES" >> ${{ github.action_path }}/.env + + # Cleanup compose profile string, it must not contains commas. Therefore we replace it with dashes. + echo "COMPOSE_PROFILES_CLEAN=${COMPOSE_PROFILES//,/-}" >> "$GITHUB_ENV" - name: Cleanup runner image shell: bash @@ -123,9 +121,9 @@ runs: id: restore_cache_sentry uses: BYK/docker-volume-cache-action/restore@0efa5cf5178c9906cb46ed8d1a357df8fd6b1a06 with: - key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }} + key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }} restore-keys: | - key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }} + key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }} volumes: | sentry-postgres @@ -134,9 +132,9 @@ runs: id: restore_cache_snuba uses: BYK/docker-volume-cache-action/restore@0efa5cf5178c9906cb46ed8d1a357df8fd6b1a06 with: - key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }} + key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }} restore-keys: | - key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }} + key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }} volumes: | sentry-clickhouse @@ -145,10 +143,10 @@ runs: id: restore_cache_kafka uses: BYK/docker-volume-cache-action/restore@0efa5cf5178c9906cb46ed8d1a357df8fd6b1a06 with: - key: db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }} + key: db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }} restore-keys: | - db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }} - db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }} + db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }} + db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }} volumes: | sentry-kafka @@ -226,7 +224,7 @@ runs: npm ci - name: Setup required Emerge Tools files - if: inputs.compose_profiles == 'feature-complete' + if: contains(inputs.compose_profiles, 'feature-complete') shell: bash run: | set -euo pipefail diff --git a/docker-compose.yml b/docker-compose.yml index f5593891047..0b603cd78a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -852,7 +852,13 @@ services: <<: *depends_on-healthy profiles: - feature-complete - + chartcuterie: + <<: [*restart_policy, *pull_policy] + image: "$CHARTCUTERIE_IMAGE" + environment: + CHARTCUTERIE_CONFIG: "http://web:9000/_chartcuterie-config.js" + profiles: + - chartcuterie volumes: # These store application data that should persist across restarts. sentry-data: diff --git a/install/update-docker-images.sh b/install/update-docker-images.sh index 34ddf484b6b..1ce5f89165e 100644 --- a/install/update-docker-images.sh +++ b/install/update-docker-images.sh @@ -24,4 +24,8 @@ $CONTAINER_ENGINE pull ${VROOM_IMAGE} || true $CONTAINER_ENGINE pull ${UPTIME_CHECKER_IMAGE} || true $CONTAINER_ENGINE pull ${LAUNCHPAD_IMAGE} || true +if [[ "$COMPOSE_PROFILES" == *"chartcuterie"* ]]; then + $CONTAINER_ENGINE pull ${CHARTCUTERIE_IMAGE} || true +fi + echo "${_endgroup}" diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 3514c5cca1a..64b6fa127c6 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -6,7 +6,7 @@ set -eu OLD_VERSION="${CRAFT_OLD_VERSION:-${1:-}}" NEW_VERSION="${CRAFT_NEW_VERSION:-${2:-}}" -sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\|SYMBOLICATOR\|TASKBROKER\|VROOM\|UPTIME_CHECKER\|LAUNCHPAD\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env +sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\|SYMBOLICATOR\|TASKBROKER\|VROOM\|UPTIME_CHECKER\|LAUNCHPAD\|CHARTCUTERIE\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env sed -i -e "s/^# Self-Hosted Sentry.*/# Self-Hosted Sentry $NEW_VERSION/" README.md [ -z "$OLD_VERSION" ] || echo "Previous version: $OLD_VERSION" diff --git a/sentry/sentry.conf.example.py b/sentry/sentry.conf.example.py index 6d1312ffa42..077d965686c 100644 --- a/sentry/sentry.conf.example.py +++ b/sentry/sentry.conf.example.py @@ -93,7 +93,7 @@ def get_internal_network(): # `COMPOSE_PROFILES` to `errors-only`. # # See https://develop.sentry.dev/self-hosted/optional-features/errors-only/ -SENTRY_SELF_HOSTED_ERRORS_ONLY = env("COMPOSE_PROFILES") != "feature-complete" +SENTRY_SELF_HOSTED_ERRORS_ONLY = "errors-only" in env("COMPOSE_PROFILES") # When running in an air-gapped environment, set this to True to entirely disable # external network calls and features that require Internet connectivity. @@ -448,6 +448,27 @@ def get_internal_network(): } ) +################ +# Chartcuterie # +################ + +# Chartcuterie is a service that generates charts outside browser environment. +# It is used pretty much to create charts for metric alerts for Slack integration. +# At the time of writing, there are no other use case that depends on Chartcuterie. +# +# To enable it, add `chartcuterie` to `COMPOSE_PROFILES` in your `.env` file. +# An example would be: +# ```env +# COMPOSE_PROFILES=feature-complete,chartcuterie +# ``` + +if "chartcuterie" in env("COMPOSE_PROFILES"): + SENTRY_FEATURES["organizations:metric-alert-chartcuterie"] = True + SENTRY_OPTIONS["chart-rendering.enabled"] = True + SENTRY_OPTIONS["chart-rendering.chartcuterie"] = { + "url": "http://chartcuterie:9090" + } + ####################### # MaxMind Integration # #######################