Skip to content
New issue

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

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

Already on GitHub? # to your account

shutdown before start to avoid race conditions #260

Merged
merged 4 commits into from
Dec 23, 2022
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
8 changes: 4 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
AIRBYTE_DESTINATION_HASURA_URL: ${AIRBYTE_DESTINATION_HASURA_URL?}
AIRBYTE_FORCE_SETUP: ${FAROS_AIRBYTE_FORCE_SETUP:-false}
AIRBYTE_URL: ${AIRBYTE_URL?}
FAROS_EMAIL: ${FAROS_EMAIL}
FAROS_EMAIL: ${FAROS_EMAIL:-}
FAROS_INIT_VERSION: ${FAROS_INIT_VERSION:-}
FAROS_START_SOURCE: ${FAROS_START_SOURCE:-}
HASURA_URL: ${HASURA_URL?}
Expand All @@ -41,9 +41,9 @@ services:
N8N_DB_NAME: ${N8N_DB_NAME?}
healthcheck:
test: ["CMD", "psql", "-d", "postgres://${FAROS_CONFIG_DB_USER?}:${FAROS_CONFIG_DB_PASSWORD?}@${FAROS_CONFIG_DB_HOST?}:${FAROS_CONFIG_DB_PORT?}/${N8N_DB_NAME?}", "-c", "SELECT 1"]
interval: 15s
timeout: 5s
start_period: 30s
interval: 5s
timeout: 2s
start_period: 10s
retries: 5

# Airbyte
Expand Down
9 changes: 8 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ function parseFlags() {
}

main() {
RUNNING=$(docker compose ps -q --status=running | wc -l)
if [ "$RUNNING" -gt 0 ]; then
printf "Faros CE is still running. \n"
printf "You can stop it with the stop.sh command. \n"
exit 1
fi

parseFlags "$@"
EMAIL_FILE=".faros-email"
if [[ -n "$email_override" ]]; then
Expand Down Expand Up @@ -86,7 +93,7 @@ main() {

if ((run_cli)); then
CONTAINER_EXIT_CODE=$(docker wait faros-community-edition-faros-init-1)
if [ "$CONTAINER_EXIT_CODE" != 0 ]; then
if [ "$CONTAINER_EXIT_CODE" -gt 0 ]; then
printf "An error occured during the initialization of Faros CE.\n"
printf "For troubleshooting help, you can bring this log on our Slack workspace:\n"
printf "https://community.faros.ai/docs/slack \n"
Expand Down
5 changes: 5 additions & 0 deletions stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
thomas-gerber marked this conversation as resolved.
Show resolved Hide resolved

# only services in the compose file will be stopped
docker compose down
exit