-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·69 lines (51 loc) · 1.64 KB
/
setup.sh
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
#!/bin/bash
# Exit script if any command fails
set -e
# Setup variables
DATABASE_FILE="data.db"
MODEL_NAME="solu-1l"
echo "Checking Python version..."
PYTHON_VERSION=$(python -V 2>&1)
echo "Detected Python version: $PYTHON_VERSION"
if ! command -v cargo &> /dev/null; then
echo "Rust toolchain not found. Please install Rust."
exit 1
fi
echo "Rust toolchain detected."
# Assuming you're in the root of the cloned repo
echo "Setting up Python virtual environment..."
python -m venv .env
source .env/bin/activate
if [[ -z "$VIRTUAL_ENV" ]]; then
echo "Virtual environment activation failed."
exit 1
fi
echo "Virtual environment activated at $VIRTUAL_ENV"
echo "Installing maturin..."
python -m pip install maturin
echo "Building the DeepDecipher package with maturin..."
# Explicitly specifying the Python interpreter might help
maturin develop --release
echo "Verifying DeepDecipher installation..."
# Checking if the installation path includes DeepDecipher
python -c "import site; print(site.getsitepackages())"
python -c "import deepdecipher; print('DeepDecipher module found.')"
echo "Running the scrape Neuroscope script..."
python -m scripts.scrape_neuroscope $DATABASE_FILE $MODEL_NAME
echo "Starting the DeepDecipher server..."
python -m deepdecipher $DATABASE_FILE &
sleep 5
echo "Verifying server response..."
curl http://localhost:8080/api/$MODEL_NAME/neuroscope/0/9
# Check that npm is installed
if ! command -v npm &> /dev/null; then
echo "npm not found. Please install npm."
exit 1
fi
echo "npm detected."
# Run the frontend server on port
echo "Starting the frontend server..."
cd frontend
npm install
npm audit fix
npm run dev