-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·58 lines (53 loc) · 2.05 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
# Copyright 2024 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# Run with source setup.sh
# Create a virtual environment
if [[ ! -d "venv" ]]; then
echo "Creating virtual environment..."
python3 -m venv venv
echo "Virtual environment created successfully."
else
echo "Virtual environment already exists."
fi
# Activate the virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Check if activation was successful
if [[ "$VIRTUAL_ENV" != "" ]]; then
echo "Virtual environment activated successfully."
else
echo "Failed to activate virtual environment."
exit 1
fi
# Check if requirements.txt exists
if [[ -f "requirements.txt" ]]; then
echo "Installing requirements from requirements.txt..."
pip install -r requirements.txt
echo "Requirements installed successfully."
else
echo "requirements.txt not found. Skipping package installation."
fi
echo "Setup process completed successfully."
echo "You can now run the ECS Editor and Simulation Stream application."
echo
echo "Usage instructions:"
echo "1. To launch the web interface:"
echo " python app.py --web --model=MODEL_NAME --api_key=YOUR_API_KEY"
echo
echo "2. To launch the web interface with an ECS config:"
echo " python app.py path/to/ecs_config.py --web --model=MODEL_NAME --api_key=YOUR_API_KEY"
echo
echo "3. To run a simulation from the command line with custom metrics:"
echo " python app.py path/to/ecs_config.py --steps=10 --metrics=path/to/metrics_file.json --model=MODEL_NAME --api_key=YOUR_API_KEY"