Skip to content

Commit

Permalink
Merge pull request #326 from JaerongA/datajoint_pipeline
Browse files Browse the repository at this point in the history
fix: 🐛 specify docker path
  • Loading branch information
Thinh Nguyen authored Feb 6, 2024
2 parents fcd7e41 + f8d3cac commit e9c4eab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docker/cron_script.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Open up a crontab ('crontab -e') and add the following:
# 0 */4 * * * /path/to/cron_script.bash
# For debugging, run ./cron_script.bash -v

# Create a log file whenever the job gets run.
ROOT_LOG_DIR="/ceph/aeon/aeon/dj_store/logs"
mkdir -p "${ROOT_LOG_DIR}"
Expand All @@ -22,30 +21,31 @@ done
# Verbose option for debugging
print_verbose() {
if [ "$verbose" -eq 1 ]; then
echo "[DEBUG] $1 - $(date '+%Y-%m-%d %H:%M:%S')" >>"$LOG_FILE"
echo "[DEBUG] $1 - $(date '+%Y-%m-%d %H:%M:%S')"
fi
echo "[DEBUG] $1 - $(date '+%Y-%m-%d %H:%M:%S')" >> "$LOG_FILE"
}

print_verbose "Starting Ingestion..."
cd /nfs/nhome/live/aeon_db/aeon_mecha/docker/

print_verbose "Terminate running workers..."
docker-compose down >>"$LOG_FILE" 2>&1
/usr/local/bin/docker-compose down >> "$LOG_FILE" 2>&1
if [ $? -eq 0 ]; then
print_verbose "Workers terminated successfully."
else
print_verbose "Failed to terminate workers."
fi

if docker image inspect ghcr.io/sainsburywellcomecentre/aeon_mecha >/dev/null 2>&1; then
if /usr/bin/docker image inspect ghcr.io/sainsburywellcomecentre/aeon_mecha >/dev/null 2>&1; then
print_verbose "Removing existing aeon_mecha image..."
docker image rm ghcr.io/sainsburywellcomecentre/aeon_mecha >>"$LOG_FILE" 2>&1
/usr/bin/docker image rm ghcr.io/sainsburywellcomecentre/aeon_mecha >> "$LOG_FILE" 2>&1
fi

print_verbose "Restart workers..."
docker-compose up --detach >>"$LOG_FILE" 2>&1
/usr/local/bin/docker-compose up --detach >> "$LOG_FILE" 2>&1
if [ $? -eq 0 ]; then
print_verbose "Workers restarted successfully."
else
print_verbose "Failed to restart workers."
fi
fi

0 comments on commit e9c4eab

Please sign in to comment.