-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaily_report_script.sh
More file actions
executable file
·50 lines (41 loc) · 1.28 KB
/
daily_report_script.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Daily pipeline script for feature-engineering service
# Runs feature engineering pipeline AND report generation
# Should be scheduled to run daily via cron
set -e
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Load environment variables from .env if exists
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
# Create virtualenv if it doesn't exist
if [ ! -d ".venv" ]; then
echo "Creating virtual environment..."
python -m venv .venv
fi
# Activate virtualenv
if [ -d ".venv" ]; then
source .venv/bin/activate
elif [ -d "venv" ]; then
source venv/bin/activate
else
echo "ERROR: No virtualenv found"
exit 1
fi
# Install dependencies
pip install -q -e .
# 1. Run feature engineering pipeline
echo "========================================"
echo "Step 1: Running feature pipeline..."
echo "========================================"
python -m src.pipeline.run "$@"
# 2. Run daily report generation
echo "========================================"
echo "Step 2: Running daily report..."
echo "========================================"
python -m src.features.daily_report "$@"
echo "========================================"
echo "Daily pipeline complete!"
echo "========================================"