-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·114 lines (97 loc) · 3.13 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·114 lines (97 loc) · 3.13 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# MLflow Tutorial Setup Script
# This script helps you set up the MLflow tutorial environment
set -e # Exit on error
echo "================================="
echo " MLflow Tutorial Setup Script"
echo "================================="
echo ""
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
if [ "$2" = "success" ]; then
echo -e "${GREEN}✓${NC} $1"
elif [ "$2" = "error" ]; then
echo -e "${RED}✗${NC} $1"
elif [ "$2" = "info" ]; then
echo -e "${YELLOW}ℹ${NC} $1"
else
echo " $1"
fi
}
# Check Python version
print_status "Checking Python version..." "info"
python_version=$(python3 --version 2>&1 | awk '{print $2}')
print_status "Python version: $python_version" "success"
# Check if pip is installed
print_status "Checking pip..." "info"
if command -v pip3 &> /dev/null; then
pip_version=$(pip3 --version | awk '{print $2}')
print_status "pip version: $pip_version" "success"
else
print_status "pip not found. Please install pip." "error"
exit 1
fi
# Ask user if they want to create a virtual environment
echo ""
read -p "Do you want to create a virtual environment? (recommended) [y/N]: " create_venv
if [[ $create_venv =~ ^[Yy]$ ]]; then
print_status "Creating virtual environment..." "info"
python3 -m venv venv
print_status "Virtual environment created" "success"
print_status "Activating virtual environment..." "info"
source venv/bin/activate
print_status "Virtual environment activated" "success"
echo ""
print_status "To activate the virtual environment in the future, run:" "info"
echo " source venv/bin/activate"
echo ""
fi
# Install dependencies
print_status "Installing dependencies from requirements.txt..." "info"
pip3 install -r requirements.txt
if [ $? -eq 0 ]; then
print_status "Dependencies installed successfully" "success"
else
print_status "Failed to install dependencies" "error"
exit 1
fi
# Verify MLflow installation
print_status "Verifying MLflow installation..." "info"
mlflow_version=$(python3 -c "import mlflow; print(mlflow.__version__)" 2>&1)
if [ $? -eq 0 ]; then
print_status "MLflow version: $mlflow_version" "success"
else
print_status "MLflow installation verification failed" "error"
exit 1
fi
# Create necessary directories
print_status "Creating necessary directories..." "info"
mkdir -p data
print_status "Directories created" "success"
echo ""
echo "================================="
echo " Setup Complete!"
echo "================================="
echo ""
print_status "You can now run the tutorial:" "info"
echo ""
echo " 1. Run all components:"
echo " python run_all.py"
echo ""
echo " 2. Run individual components:"
echo " python 1_tracking.py"
echo " python 2_projects.py"
echo " python 3_models.py"
echo " python 4_model_registry.py"
echo ""
echo " 3. Start MLflow UI (in a separate terminal):"
echo " mlflow ui"
echo " Then visit: http://localhost:5000"
echo ""
print_status "See QUICKSTART.md for detailed instructions" "info"
echo ""