|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -# Load SSH agent since this is no longer done by default on the cluster |
4 | | -eval "$(ssh-agent -s)" |
5 | | -ssh-add ~/.ssh/id_rsa |
6 | | - |
7 | | -# Set locale environment variables |
8 | | -export LC_CTYPE=C.UTF-8 |
9 | | -export LC_COLLATE=C.UTF-8 |
10 | | -export LC_TIME=C.UTF-8 |
11 | | -export LC_MESSAGES=C.UTF-8 |
12 | | -export LC_MONETARY=C.UTF-8 |
13 | | -export LC_PAPER=C.UTF-8 |
14 | | -export LC_MEASUREMENT=C.UTF-8 |
15 | | -export LANG=C.UTF-8 |
16 | | - |
17 | | -# Load required modules |
18 | | -module load LibTIFF/4.6.0-GCCcore-13.3.0 |
19 | | -module load Miniconda3/24.7.1-0 |
20 | | - |
21 | | -# Initialize conda if needed |
22 | | -source ~/.bashrc 2>/dev/null || true |
23 | | - |
24 | | -# Activate conda environment for dashboard operations |
25 | | -conda activate mosquito-alert-monitor 2>/dev/null || { |
26 | | - echo "WARNING: Failed to activate conda environment mosquito-alert-monitor" |
27 | | -} |
| 3 | +# Drop-in status update script that calls the monitor project |
| 4 | +# This script NEVER fails the calling job and provides dashboard integration |
| 5 | + |
| 6 | +JOB_NAME="${1:-weather-unknown}" |
| 7 | +STATUS="${2:-unknown}" |
| 8 | +DURATION="${3:-0}" |
| 9 | +PROGRESS="${4:-0}" |
| 10 | +LOG_MESSAGE="${5:-Weather job status update}" |
| 11 | + |
| 12 | +# Use the robust monitor script if available |
| 13 | +MONITOR_SCRIPT="$HOME/research/mosquito-alert-model-monitor/scripts/update_job_status.sh" |
| 14 | + |
| 15 | +if [ -f "$MONITOR_SCRIPT" ]; then |
| 16 | + echo "📊 Updating dashboard via monitor project..." |
| 17 | + "$MONITOR_SCRIPT" "$JOB_NAME" "$STATUS" "$DURATION" "$PROGRESS" "$LOG_MESSAGE" |
| 18 | +else |
| 19 | + echo "⚠️ Monitor project not found - skipping dashboard update" |
| 20 | +fi |
| 21 | + |
| 22 | +# ALWAYS exit successfully so calling jobs continue |
| 23 | +exit 0 |
28 | 24 |
|
29 | 25 |
|
30 | 26 | # scripts/update_weather_status.sh |
|
0 commit comments