-
Notifications
You must be signed in to change notification settings - Fork 100
318 lines (255 loc) · 11.8 KB
/
test_gaia_cli_linux.yml
File metadata and controls
318 lines (255 loc) · 11.8 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
# This workflow tests the GAIA CLI on Linux (Ubuntu) with Lemonade server support
# Tests include: CLI installation, Lemonade server setup, core commands, and evaluation tools
# Platform: Linux/Ubuntu (Full CLI functionality with Lemonade server)
name: GAIA CLI Tests (Linux)
on:
workflow_call:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
workflow_dispatch:
permissions:
contents: read
jobs:
test-gaia-cli-linux:
name: Test GAIA CLI on Linux (Full Integration)
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Free disk space
uses: ./.github/actions/free-disk-space
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl jq portaudio19-dev
- name: Setup Python environment
uses: ./.github/actions/setup-venv
with:
python-version: '3.12'
# Note: 'blender' excluded as bpy requires Blender runtime
install-package: '.[dev,talk,rag,mcp,api]'
extra-index-url: 'https://download.pytorch.org/whl/cpu'
- name: Install Lemonade SDK
run: |
echo "=== Installing Lemonade SDK ==="
uv pip install lemonade-sdk --python .venv/bin/python
echo "=== Verifying Lemonade Installation ==="
lemonade-server-dev -h
- name: Verify GAIA CLI installation
run: |
echo "=== Testing GAIA CLI Installation ==="
# Test version command
echo "Testing version command:"
gaia --version
# Test help command
echo "Testing help command:"
gaia --help
# Verify gaia command is available
which gaia
echo "GAIA CLI installed successfully!"
- name: Start Lemonade Server and Test Core Commands
run: |
echo "=== Starting Lemonade Server ==="
# Start Lemonade server in background with a lightweight model
echo "Starting Lemonade server with Qwen model..."
echo "Note: First run may take 5-10 minutes to download the model (~3GB)"
# Start server and capture both stdout and stderr
lemonade-server-dev run Qwen3-0.6B-GGUF > lemonade.log 2>&1 &
LEMONADE_PID=$!
echo "Lemonade server started with PID: $LEMONADE_PID"
# Function to check if process is still running
check_process_alive() {
if ! kill -0 $LEMONADE_PID 2>/dev/null; then
echo "❌ Lemonade server process has died. Log output:"
cat lemonade.log
return 1
fi
return 0
}
# Wait for server to start up with longer timeout for model download
echo "Waiting for Lemonade server to start (this may take up to 10 minutes for model download)..."
# Check if server is responding with extended timeout and exponential backoff
max_attempts=60 # Increased from 10 to 60
attempt=0
wait_time=5
max_wait_time=30
while [ $attempt -lt $max_attempts ]; do
# Check if process is still alive
if ! check_process_alive; then
exit 1
fi
# Try to connect to health endpoint
if curl -f -m 10 http://localhost:8000/api/v1/health 2>/dev/null; then
echo "✅ Lemonade server is responding!"
break
fi
attempt=$((attempt + 1))
echo "Waiting for server... (attempt $attempt/$max_attempts, waiting ${wait_time}s)"
# Show recent log output every 10 attempts to indicate progress
if [ $((attempt % 10)) -eq 0 ]; then
echo "Recent server output:"
tail -n 5 lemonade.log 2>/dev/null || echo "No log output yet"
fi
sleep $wait_time
# Exponential backoff with max limit
if [ $wait_time -lt $max_wait_time ]; then
wait_time=$((wait_time + 5))
fi
done
if [ $attempt -eq $max_attempts ]; then
echo "❌ Lemonade server failed to start within timeout"
echo "Final server log output:"
cat lemonade.log
kill $LEMONADE_PID 2>/dev/null || true
exit 1
fi
# Pull the model now that server is running
echo "=== Pulling Qwen3-0.6B-GGUF model ==="
lemonade-server-dev pull Qwen3-0.6B-GGUF
# List available models for debugging
echo "=== Listing Available Models ==="
curl -s http://localhost:8000/api/v1/models | jq '.' || echo "Could not list models"
echo "=== Testing Core GAIA CLI Commands with Lemonade ==="
# Test chat command with Qwen model (should now work with Lemonade)
echo "Testing chat command with Qwen3-0.6B-GGUF model:"
timeout 30s gaia chat --model "Qwen3-0.6B-GGUF" -q "Hello, this is a test message. Please respond briefly." || echo "Chat command completed"
# Test prompt command with Qwen model
echo "Testing prompt command with Qwen3-0.6B-GGUF model:"
timeout 30s gaia prompt --model "Qwen3-0.6B-GGUF" "What is 2+2?" || echo "Prompt command completed"
# Test llm command with Qwen model
echo "Testing llm command with Qwen3-0.6B-GGUF model:"
timeout 30s gaia llm --model "Qwen3-0.6B-GGUF" "Say hello" || echo "LLM command completed"
echo "✅ Core commands tested successfully!"
# Now test summarizer while server is still running
echo ""
echo "=== Testing Summarizer Integration ==="
echo "Testing complete CLI workflow: gaia summarize command"
# Set the test model for summarizer tests
export GAIA_TEST_MODEL="Qwen3-0.6B-GGUF"
# Run the summarizer integration tests
python -m pytest tests/test_summarizer.py -vs --tb=short || TEST_EXIT=$?
if [ "${TEST_EXIT:-0}" -eq 0 ]; then
echo "✅ Summarizer CLI integration tests passed successfully!"
else
echo "❌ Summarizer CLI integration tests failed with exit code: ${TEST_EXIT}"
echo "Note: Error details displayed above"
fi
echo ""
echo "=== Testing RAG Functionality ==="
echo "Testing RAG (Retrieval-Augmented Generation) system"
# Run the RAG tests
python -m pytest tests/test_rag.py -vs --tb=short || RAG_TEST_EXIT=$?
if [ "${RAG_TEST_EXIT:-0}" -eq 0 ]; then
echo "✅ RAG tests passed successfully!"
else
echo "❌ RAG tests failed with exit code: ${RAG_TEST_EXIT}"
echo "Note: Error details displayed above"
fi
echo ""
echo "=== Testing Lemonade Client Integration ==="
echo "Testing LemonadeClient API with running server"
# Run the lemonade client integration tests (skip hybrid NPU test - no NPU on Linux)
GAIA_TEST_MODEL="Qwen3-0.6B-GGUF" python -m pytest tests/test_lemonade_client.py -vs --tb=short -k "Integration and not hybrid" || LEMONADE_TEST_EXIT=$?
if [ "${LEMONADE_TEST_EXIT:-0}" -eq 0 ]; then
echo "✅ Lemonade client integration tests passed successfully!"
else
echo "❌ Lemonade client integration tests failed with exit code: ${LEMONADE_TEST_EXIT}"
echo "Note: Error details displayed above"
fi
# Clean up: Stop the Lemonade server
echo "Stopping Lemonade server..."
kill $LEMONADE_PID 2>/dev/null || true
sleep 5
# Clean up log file
rm -f lemonade.log
- name: Test evaluation and utility commands
run: |
echo "=== Testing Evaluation and Utility Commands ==="
# Test groundtruth command help
echo "Testing groundtruth command help:"
gaia groundtruth --help
# Test eval command help
echo "Testing eval command help:"
gaia eval --help
# Test report command help
echo "Testing report command help:"
gaia report --help
# Test generate command help
echo "Testing generate command help:"
gaia generate --help
# Test batch-experiment command help
echo "Testing batch-experiment command help:"
gaia batch-experiment --help
# Test create-template command help
echo "Testing create-template command help:"
gaia create-template --help
# Test visualize command help
echo "Testing visualize command help:"
gaia visualize --help
# Test test command help
echo "Testing test command help:"
gaia test --help
# Test youtube command help
echo "Testing youtube command help:"
gaia youtube --help
# Test kill command help
echo "Testing kill command help:"
gaia kill --help
- name: Test platform compatibility
run: |
echo "=== Testing Platform Compatibility ==="
# Test that Linux-specific process commands work
echo "Testing kill command with invalid port (should handle gracefully):"
if gaia kill --port 99999 2>&1 | grep -q "No process found"; then
echo "✅ Kill command handled Linux environment gracefully"
else
echo "⚠️ Kill command may not be fully Linux-compatible"
fi
- name: Test import statements
run: |
echo "=== Testing Python Import Compatibility ==="
# Test that all modules can be imported on Linux
python -c "
try:
from gaia.cli import main
from gaia.version import version
from gaia.logger import get_logger
from gaia.llm import LLMClient
print('✅ All core imports successful on Linux')
except ImportError as e:
print(f'❌ Import error: {e}')
exit(1)
"
- name: Summary
run: |
echo "=== Linux Full Integration Test Summary ==="
echo "✅ GAIA CLI installation works on Linux"
echo "✅ Python venv environment setup successful"
echo "✅ Lemonade server installation and startup successful"
echo "✅ Core CLI commands (chat, prompt, llm) working with Lemonade"
echo "✅ Evaluation and utility commands working"
echo "✅ Cross-platform process management working"
echo "✅ Core Python modules import successfully"
echo ""
echo "🎉 Linux now has full GAIA CLI functionality!"
echo "📋 Tested components:"
echo " ✅ Lemonade server with Qwen3-0.6B-GGUF model"
echo " ✅ Core CLI commands using Qwen model (chat, prompt, llm)"
echo " ✅ Evaluation commands (eval, groundtruth, report, etc.)"
echo " ✅ Summarizer CLI integration (gaia summarize command)"
echo " ✅ RAG (Retrieval-Augmented Generation) functionality"
echo " ✅ Lemonade client integration (API tests)"
echo " ✅ Cross-platform compatibility"
echo " ✅ Process management and cleanup"
echo ""
echo "🚀 Next enhancements:"
echo " 🔧 Test audio/TTS functionality on Linux"
echo " 🔧 Add Linux NPU driver support (if available)"
echo " 🔧 Optimize model loading and performance"