This repository was archived by the owner on Dec 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
176 lines (142 loc) · 5.33 KB
/
setup.sh
File metadata and controls
176 lines (142 loc) · 5.33 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/bash
set -e
echo "=========================================="
echo "Gillies Workshop Hackathon 2025 Setup"
echo "=========================================="
echo ""
# Color codes 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() {
echo -e "${GREEN}[INFO]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if running on a CUDA-enabled system
print_status "Checking CUDA availability..."
if ! command -v nvidia-smi &> /dev/null; then
print_warning "nvidia-smi not found. Make sure you're running on a GPU instance."
else
nvidia-smi
print_status "CUDA detected successfully!"
fi
# Install Miniconda if not already installed
if ! command -v conda &> /dev/null; then
print_status "Miniconda not found. Installing Miniconda..."
# Check if miniconda3 directory exists but conda is not in PATH
if [ -d "$HOME/miniconda3" ]; then
print_warning "Miniconda directory exists but conda not in PATH. Removing old installation..."
rm -rf "$HOME/miniconda3"
fi
# Download Miniconda installer
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
# Install Miniconda
bash /tmp/miniconda.sh -b -p $HOME/miniconda3
# Initialize conda
eval "$($HOME/miniconda3/bin/conda shell.bash hook)"
conda init bash
# Clean up
rm /tmp/miniconda.sh
print_status "Miniconda installed successfully!"
else
print_status "Miniconda already installed."
eval "$(conda shell.bash hook)"
fi
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
# Create conda environment
ENV_NAME="hackathon"
print_status "Creating conda environment: $ENV_NAME..."
if conda env list | grep -q "^$ENV_NAME "; then
print_warning "Environment $ENV_NAME already exists. Removing it..."
conda env remove -n $ENV_NAME -y
fi
# Create environment with Python 3.13 (compatible with RAPIDS)
conda create -n $ENV_NAME python=3.13 -y
print_status "Conda environment created successfully!"
# Activate the environment
print_status "Activating conda environment..."
source activate $ENV_NAME
# Install uv for faster pip installs
print_status "Installing uv (fast Python package installer)..."
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
print_status "uv installed successfully!"
# Upgrade pip
print_status "Upgrading pip..."
pip install --upgrade pip
# Install RAPIDS packages from NVIDIA PyPI using uv
print_status "Installing RAPIDS packages with uv (this may take several minutes)..."
uv pip install \
--extra-index-url=https://pypi.nvidia.com \
"cudf-cu13==25.10.*" \
"dask-cudf-cu13==25.10.*" \
"cuml-cu13==25.10.*" \
"cugraph-cu13==25.10.*" \
"nx-cugraph-cu13==25.10.*" \
"cuxfilter-cu13==25.10.*" \
"cucim-cu13==25.10.*" \
"pylibraft-cu13==25.10.*" \
"raft-dask-cu13==25.10.*" \
"cuvs-cu13==25.10.*"
print_status "RAPIDS packages installed successfully!"
# Install honeybee-ml
print_status "Installing honeybee-ml..."
uv pip install honeybee-ml
# Install JupyterLab and common data science packages
print_status "Installing JupyterLab and essential packages..."
uv pip install jupyterlab ipywidgets matplotlib seaborn plotly scikit-learn pandas numpy
# Install HuggingFace CLI with hf_transfer for faster downloads
print_status "Installing HuggingFace CLI with hf_transfer acceleration..."
uv pip install huggingface_hub[cli,hf_transfer]
# Create data directory
DATA_DIR="$HOME/hackathon-data"
print_status "Creating data directory at $DATA_DIR..."
mkdir -p "$DATA_DIR"
# Download datasets from HuggingFace
print_status "Downloading datasets from HuggingFace (Lab-Rasool/hackathon)..."
print_warning "Note: Dataset downloads are large (~694GB total). This may take a while..."
print_status "Using hf_transfer for accelerated downloads (optimized for high-bandwidth connections)..."
# Enable hf_transfer for faster downloads
export HF_HUB_ENABLE_HF_TRANSFER=1
# Download entire dataset (CSV files + images)
print_status "Downloading training and test datasets..."
huggingface-cli download Lab-Rasool/hackathon \
--repo-type dataset \
--local-dir "$DATA_DIR"
print_status "Datasets downloaded to $DATA_DIR"
# Verify datasets
if [ -f "$DATA_DIR/train/train.csv" ] && [ -d "$DATA_DIR/train/images" ]; then
print_status "Training dataset verified: CSV and images found"
else
print_warning "Training dataset incomplete. Please check $DATA_DIR/train/"
fi
if [ -f "$DATA_DIR/test/test.csv" ] && [ -d "$DATA_DIR/test/images" ]; then
print_status "Test dataset verified: CSV and images found"
else
print_warning "Test dataset incomplete. Please check $DATA_DIR/test/"
fi
echo ""
echo "=========================================="
echo "${GREEN}Setup Complete!${NC}"
echo "=========================================="
echo ""
echo "Environment name: $ENV_NAME"
echo "Data directory: $DATA_DIR"
echo ""
echo "To activate the environment in a new shell, run:"
echo " conda activate $ENV_NAME"
echo ""
echo "Dataset location: $DATA_DIR"
echo " - Training data: $DATA_DIR/train/"
echo " - Test data: $DATA_DIR/test/"
echo ""
echo "Happy coding! 🚀"
echo ""