-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_OSX.sh
99 lines (75 loc) · 1.92 KB
/
install_OSX.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
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
#!/bin/bash
# Define repositories
mkdir Drug-discovery-game
cd Drug-discovery-game
BACKEND_REPO="[email protected]:SABS-Group-2-2021-22/drug-discovery-game-backend.git"
FRONTEND_REPO="[email protected]:SABS-Group-2-2021-22/drug-discovery-game-app.git"
# Clone repositories
echo "Cloning repositories..."
git clone $BACKEND_REPO
git clone $FRONTEND_REPO
# Setup Backend
echo "Setting up the backend..."
cd drug-discovery-game-backend
conda env create -f environment.yml
# Create run_backend.sh
echo "Creating run_backend.sh..."
cat <<EOF > run_backend.sh
#!/bin/bash
# Activate backend environment and run
# Default set to no
LLM_FLAG="n"
while [[ "\$#" -gt 0 ]]; do
case \$1 in
-LLM) LLM_FLAG="\$2"; shift ;;
*) echo "Unknown parameter passed: \$1"; exit 1 ;;
esac
shift
done
# Check the LLM flag
if [ "\$LLM_FLAG" = "y" ]; then
echo "Switching to main_LLM branch..."
git checkout 222-openai-api-integration-BE
else
echo "Using main branch..."
git checkout main
fi
conda activate dd_game
export FLASK_APP=api/service
flask run -p 8000
EOF
chmod +x run_backend.sh
cd ..
# Setup Frontend
echo "Setting up the frontend..."
cd drug-discovery-game-app
brew install node
npm install
# Create run_frontend.sh
echo "Creating run_frontend.sh..."
cat <<EOF > run_frontend.sh
#!/bin/bash
# Run frontend server
# Default set to no
LLM_FLAG="n"
# Parse arguments
while [[ "\$#" -gt 0 ]]; do
case \$1 in
-LLM) LLM_FLAG="\$2"; shift ;;
*) echo "Unknown parameter passed: \$1"; exit 1 ;;
esac
shift
done
# Check the LLM flag
if [ "\$LLM_FLAG" = "y" ]; then
echo "Switching to main_LLM branch..."
git checkout OPENCHAT_with_openai
else
echo "Using main branch..."
git checkout main
fi
npm start
EOF
chmod +x run_frontend.sh
cd ..
echo "Installation completed. You can now run './run_backend.sh' and './run_frontend.sh' in separate terminals within their respective directories."