Merge pull request #13 from evison/main #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# 添加验证步骤 | |
- 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 .. | |
# Wait and check if the process is running | |
sleep 5 | |
if ! ps -p $KERNEL_PID > /dev/null; then | |
echo "Kernel process has terminated. Check the log:" | |
cat kernel.log | |
exit 1 | |
fi | |
# Wait for the port to be available | |
for i in {1..12}; do | |
if nc -z localhost 8000; then | |
echo "Port 8000 is available - kernel is running" | |
break | |
fi | |
echo "Waiting for kernel to start... Attempt $i" | |
sleep 5 | |
done | |
# Final connection test | |
if ! curl -s http://localhost:8000/health; then | |
echo "Unable to connect to the kernel. Log:" | |
cat kernel.log | |
exit 1 | |
fi | |
# 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 |