Skip to content

Commit a511cf3

Browse files
committed
script to prepare gaia env and run gaia exp
1 parent cabc393 commit a511cf3

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

scripts/run_gaia.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
# run podman for containers
4+
if ! command -v podman &> /dev/null; then
5+
echo "Podman is not installed, installing..."
6+
if ! command -v brew &> /dev/null; then
7+
echo "Error: Homebrew is not installed. Please install it first."
8+
echo "Visit https://brew.sh for installation instructions."
9+
exit 1
10+
fi
11+
brew install podman
12+
echo "Podman installed"
13+
podman machine init > /dev/null 2>&1
14+
echo "Podman initialized"
15+
fi
16+
if ! podman machine list | grep -q "Currently running"; then
17+
podman machine set --user-mode-networking
18+
nohup podman machine start > /dev/null 2>&1
19+
echo "Podman machine started"
20+
podman info > /dev/null 2>&1
21+
if [ $? -ne 0 ]; then
22+
echo "Error: Failed to initialize Podman. Please check the error messages above."
23+
exit 1
24+
fi
25+
fi
26+
export DOCKER_HOST=http+unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')
27+
if ! podman images computer | grep -q "computer"; then
28+
echo "No computer image found, building one"
29+
podman images
30+
podman build -t computer:latest tapeagents/tools/computer/
31+
if [ $? -ne 0 ]; then
32+
echo "Failed to build computer image"
33+
exit 1
34+
fi
35+
fi
36+
37+
# Check if OPENAI_API_KEY is set
38+
if [ -z "${OPENAI_API_KEY}" ]; then
39+
echo "Error: OPENAI_API_KEY environment variable is not set"
40+
exit 1
41+
fi
42+
43+
if [ -z "${SERPER_API_KEY}" ]; then
44+
echo "Error: SERPER_API_KEY environment variable is not set"
45+
exit 1
46+
fi
47+
48+
# Run the Python script
49+
python "$(dirname "$0")/run_gaia.py"

0 commit comments

Comments
 (0)