-
Notifications
You must be signed in to change notification settings - Fork 21
133 lines (120 loc) · 3.66 KB
/
python-package-conda.yml
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
name: Cerebrum-AIOS Integration Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
# Clone AIOS
- name: Git Clone AIOS
uses: actions/checkout@v4
with:
repository: agiresearch/AIOS
path: aios_root
ref: main
# Verify AIOS clone
- name: Verify AIOS clone
run: |
echo "=== AIOS root directory contents ==="
ls -la aios_root/
echo "=== Looking for setup files ==="
find aios_root/ -name "setup.py" -o -name "pyproject.toml"
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
# Install AIOS dependencies
- name: Install AIOS dependencies
working-directory: aios_root
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# Clone Cerebrum into AIOS directory
- name: Checkout Cerebrum
uses: actions/checkout@v4
with:
path: aios_root/Cerebrum
ref: ${{ github.ref }}
# Install Cerebrum
- name: Install Cerebrum
run: |
python -m pip install -e aios_root/Cerebrum/
# Run AIOS kernel
- name: Run AIOS kernel in background
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
cd aios_root
bash runtime/launch_kernel.sh &>../kernel.log &
KERNEL_PID=$!
cd ..
# Set maximum wait time (10 seconds)
max_wait=10
start_time=$SECONDS
# Dynamically check if the process is running until it succeeds or times out
while true; do
if ! ps -p $KERNEL_PID > /dev/null; then
echo "Kernel process died. Checking logs:"
cat kernel.log
exit 1
fi
if nc -z localhost 8000; then
if curl -s http://localhost:8000/health; then
echo "Kernel successfully started and healthy"
break
fi
fi
# Check if timed out
elapsed=$((SECONDS - start_time))
if [ $elapsed -ge $max_wait ]; then
echo "Timeout after ${max_wait} seconds. Kernel failed to start properly."
cat kernel.log
exit 1
fi
echo "Waiting for kernel to start... (${elapsed}s elapsed)"
sleep 1
done
# Run integration test
- name: Run integration test
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
# Debug information
echo "Checking kernel status..."
curl -v http://localhost:8000/health || true
echo "Network status:"
netstat -tlpn | grep 8000 || true
# Run the test
run-agent \
--llm_name gemini-1.5-flash \
--llm_backend google \
--agent_name_or_path demo_author/demo_agent \
--task "Tell me what is core idea of AIOS" \
--aios_kernel_url http://localhost:8000 \
2>&1 | tee agent.log
# Upload logs
- name: Upload logs
if: always()
uses: actions/[email protected]
with:
name: test-logs
path: |
kernel.log
agent.log
# Debug information
- name: Debug information
if: failure()
run: |
echo "=== Kernel log ==="
cat kernel.log
echo "=== Environment variables ==="
env | grep -i api_key || true
echo "=== Process status ==="
ps aux | grep kernel
echo "=== Directory structure ==="
tree aios_main || true