Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Stop building local images for Sentry services #834

Merged
merged 19 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
./install.sh
./test.sh
echo "Testing in-place upgrade"
# Also test plugin installation here
echo "sentry-auth-oidc" >> sentry/requirements.txt
./install.sh --minimize-downtime
./test.sh

Expand Down
11 changes: 5 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ x-restart-policy: &restart_policy
restart: unless-stopped
x-sentry-defaults: &sentry_defaults
<<: *restart_policy
build:
context: ./sentry
args:
- SENTRY_IMAGE
image: sentry-onpremise-local
image: "$SENTRY_IMAGE"
depends_on:
- redis
- postgres
Expand All @@ -21,7 +17,10 @@ x-sentry-defaults: &sentry_defaults
- snuba-replacer
- symbolicator
- kafka
entrypoint: "/etc/sentry/entrypoint.sh"
BYK marked this conversation as resolved.
Show resolved Hide resolved
command: ["run", "web"]
environment:
PYTHONUSERBASE: "/data/custom-packages"
SENTRY_CONF: "/etc/sentry"
SNUBA: "http://snuba-api:1218"
# Leaving the value empty to just pass whatever is set
Expand Down Expand Up @@ -219,7 +218,7 @@ services:
build:
context: ./cron
args:
BASE_IMAGE: "sentry-onpremise-local"
BASE_IMAGE: "$SENTRY_IMAGE"
command: '"0 0 * * * gosu sentry sentry cleanup --days $SENTRY_EVENT_RETENTION_DAYS"'
nginx:
<<: *restart_policy
Expand Down
2 changes: 0 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ echo "${_endgroup}"

echo "${_group}Building and tagging Docker images ..."
echo ""
# Build the sentry onpremise image first as it is needed for the cron image
$dc build --force-rm web
$dc build --force-rm
echo ""
echo "Docker images built."
Expand Down
5 changes: 0 additions & 5 deletions sentry/.dockerignore

This file was deleted.

7 changes: 0 additions & 7 deletions sentry/Dockerfile

This file was deleted.

16 changes: 16 additions & 0 deletions sentry/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

req_file="/etc/sentry/requirements.txt"
plugins_dir="/data/custom-packages"
checksum_file="$plugins_dir/.checksum"

if [[ -s "$req_file" ]] && ! cat "$req_file" | grep '^[^#[:space:]]' | shasum -s -c "$checksum_file" 2>/dev/null; then
echo "Installing additional dependencies..."
mkdir -p "$plugins_dir"
pip install --user -r "$req_file"
cat "$req_file" | grep '^[^#[:space:]]' | shasum > "$checksum_file"
echo ""
fi

source /docker-entrypoint.sh