Skip to content

Commit

Permalink
Take some actions to avoid unhealthy containers (getsentry#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre authored Jan 7, 2022
1 parent 8cdae78 commit 7eb16f3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ x-healthcheck-defaults: &healthcheck_defaults
# https://github.com/moby/moby/issues/39388
# https://github.com/getsentry/self-hosted/issues/1000
interval: 30s
timeout: 5s
timeout: 60s
retries: 5
start_period: 10s
x-sentry-defaults: &sentry_defaults
Expand Down
13 changes: 8 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
#!/usr/bin/env bash
set -e

# Pre-pre-flight? 🤷
if [[ -n "$MSYSTEM" ]]; then
echo "Seems like you are using an MSYS2-based system (such as Git Bash) which is not supported. Please use WSL instead.";
exit 1
fi

umask 002

source "$(dirname $0)/install/_lib.sh" # does a `cd .../install/`, among other things

source dc-detect-version.sh
# Pre-flight. No impact yet.
source parse-cli.sh
source check-latest-commit.sh
source dc-detect-version.sh
source error-handling.sh
source check-latest-commit.sh
source check-minimum-requirements.sh

# Let's go! Start impacting things.
source turn-things-off.sh
source create-docker-volumes.sh
source ensure-files-from-examples.sh
source generate-secret-key.sh
source replace-tsdb.sh
source update-docker-images.sh
source build-docker-images.sh
source turn-things-off.sh
source set-up-zookeeper.sh
source install-wal2json.sh
source bootstrap-snuba.sh
Expand Down
3 changes: 3 additions & 0 deletions install/_lib.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set -euo pipefail
test "${DEBUG:-}" && set -x

# Override any user-supplied umask that could cause problems, see #1222
umask 002

# Thanks to https://unix.stackexchange.com/a/145654/108960
log_file="sentry_install_log-`date +'%Y-%m-%d_%H-%M-%S'`.txt"
exec &> >(tee -a "$log_file")
Expand Down
4 changes: 4 additions & 0 deletions install/dc-detect-version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
echo "${_group}Initializing Docker Compose ..."

# Some environments still use `docker-compose` even for Docker Compose v2.
dc_base="$(docker compose version &> /dev/null && echo 'docker compose' || echo 'docker-compose')"
if [[ "$(basename $0)" = "install.sh" ]]; then
Expand All @@ -6,3 +8,5 @@ else
dc="$dc_base --ansi never"
fi
dcr="$dc run --rm"

echo "${_endgroup}"

0 comments on commit 7eb16f3

Please sign in to comment.