Skip to content

Upgrade to Lemonade 7.0.4 #61

Upgrade to Lemonade 7.0.4

Upgrade to Lemonade 7.0.4 #61

Workflow file for this run

# Copyright(C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: GAIA CLI Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
jobs:
gaia-cli-pytest:
runs-on: windows-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
steps:
- uses: actions/checkout@v4
- name: Download and Install Miniforge
run: |
Invoke-WebRequest -Uri "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe" -OutFile "miniforge3.exe"
Start-Process -FilePath "miniforge3.exe" -ArgumentList "/S", "/D=$env:GITHUB_WORKSPACE\miniforge3" -Wait
- name: Initialize Conda
run: |
Write-Host "Step 1: Get conda path"
$condaPath = "$env:GITHUB_WORKSPACE\miniforge3"
$env:Path = "$condaPath;$condaPath\Scripts;$env:Path"
Write-Host "Step 2: Initialize conda for both shells"
& "$condaPath\Scripts\conda.exe" init powershell
& "$condaPath\Scripts\conda.exe" init cmd.exe
Write-Host "Step 3: Create the environment at system level"
& "$condaPath\Scripts\conda.exe" create -n gaiaenv python=3.10 -y
- name: Install GAIA dependencies
run: |
Write-Host "Step 1: Activate conda environment"
& "$env:GITHUB_WORKSPACE\miniforge3\shell\condabin\conda-hook.ps1"
conda activate gaiaenv
Write-Host "Step 2: Install dependencies"
python -m pip install --upgrade pip
pip install -e .[clip,joker,rag,talk,dev]
Write-Host "Step 3: Verify installation"
$gaiaPath = Get-Command gaia -ErrorAction SilentlyContinue
if (-not $gaiaPath) {
Write-Host "Error: gaia not installed correctly"
Write-Host "Current PATH: $env:Path"
exit 1
}
Write-Host "Found gaia at: $($gaiaPath.Source)"
python -m pip check
- name: Lint with Black
uses: psf/black@stable
with:
options: "--check --verbose --config pyproject.toml"
src: "./installer ./plot ./src ./tests"
- name: PyLint
run: |
Write-Host "Step 1: Activate conda environment"
& "$env:GITHUB_WORKSPACE\miniforge3\shell\condabin\conda-hook.ps1"
conda activate gaiaenv
Write-Host "Step 2: Install pylint"
pip install pylint
Write-Host "Step 3: Run pylint"
& ".\util\lint.ps1" -RunPylint
- name: Install Ollama
shell: cmd
run: |
curl -L https://ollama.com/download/OllamaSetup.exe -o OllamaSetup.exe --progress-bar
echo Ollama download complete. Starting installation.
start /wait OllamaSetup.exe /VERYSILENT /SUPPRESSMSGBOXES /SP- /LOG="llama_install.log"
echo "Ollama installation log:"
type llama_install.log
echo "PATH=C:\Users\runneradmin\AppData\Local\Programs\Ollama;%PATH%" >> $GITHUB_ENV
del OllamaSetup.exe
- name: Verify Ollama Installation
shell: cmd
run: |
if exist "C:\Users\runneradmin\AppData\Local\Programs\Ollama\ollama.exe" (
echo "Ollama installed successfully."
) else (
echo "Ollama installation failed. Executable not found."
exit 1
)
set PATH=%PATH%;C:\Users\runneradmin\AppData\Local\Programs\Ollama
ollama --version
- name: Start Ollama Service (Background)
shell: cmd
run: |
echo Setting PATH for Ollama...
set PATH=%PATH%;C:\Users\runneradmin\AppData\Local\Programs\Ollama
echo Starting Ollama service in background using PowerShell...
powershell -Command "$env:PATH += ';C:\Users\runneradmin\AppData\Local\Programs\Ollama'; Start-Process -FilePath 'ollama' -ArgumentList 'serve' -WindowStyle Hidden -PassThru"
echo Ollama serve process started
- name: Wait and Test Ollama Service
shell: cmd
timeout-minutes: 10
run: |
echo Setting PATH for Ollama...
set PATH=%PATH%;C:\Users\runneradmin\AppData\Local\Programs\Ollama
echo Waiting for Ollama service to start...
set /a counter=0
:loop
set /a counter=%counter%+1
echo Attempt %counter% - Testing Ollama connection...
ollama list >nul 2>&1
if %errorlevel%==0 (
echo Ollama service is running successfully!
goto :connected
)
if %counter% geq 30 (
echo "Ollama service failed to start after 30 attempts"
echo "Checking processes:"
tasklist | findstr ollama
echo "Checking ports:"
netstat -an | findstr :11434
exit 1
)
echo Waiting 2 seconds before next attempt...
timeout /t 2 /nobreak >nul
goto :loop
:connected
echo Pulling required model (this may take several minutes in CI)...
ollama pull llama3.2:1b
echo Model pull completed
- uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
- name: Test GAIA
timeout-minutes: 20
env:
HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
HF_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
GAIA_MODE: GENERIC
run: |
Write-Host "Setting GAIA_MODE explicitly"
$env:GAIA_MODE = "GENERIC"
Write-Host "GAIA_MODE is set to: $env:GAIA_MODE"
Write-Host "Adding Ollama to PATH for GAIA to find"
$env:Path = "C:\Users\runneradmin\AppData\Local\Programs\Ollama;$env:Path"
Write-Host "Activate and verify Conda environment"
$env:Path = "$env:GITHUB_WORKSPACE\miniforge3;$env:GITHUB_WORKSPACE\miniforge3\Scripts;$env:Path"
& "$env:GITHUB_WORKSPACE\miniforge3\shell\condabin\conda-hook.ps1"
conda activate gaiaenv
Write-Host "Verify Python environment"
python -c "import sys; print(sys.executable)"
Write-Host "Verify NumPy is available"
python -c "import numpy; print(f'NumPy version: {numpy.__version__}'); print(f'NumPy path: {numpy.__file__}')"
Write-Host "Find gaia executable location"
$gaiaPath = Get-Command gaia -ErrorAction SilentlyContinue
if (-not $gaiaPath) {
Write-Host "Error: Cannot find gaia executable in PATH"
Write-Host "Current PATH: $env:Path"
exit 1
}
Write-Host "Found gaia at: $($gaiaPath.Source)"
Write-Host "Running test_gaia.py"
python tests\test_gaia.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_gaia.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_llama_index.py"
python tests\test_llama_index.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_llama_index.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_asr.py"
python tests\unit\test_asr.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_asr.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_tts.py"
python tests\unit\test_tts.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_tts.py failed with exit code $LASTEXITCODE"
}
Write-Host "Running test_rag.py"
python tests\test_rag.py 2>&1 | Out-String -Stream
if ($LASTEXITCODE -ne 0) {
throw "test_rag.py failed with exit code $LASTEXITCODE"
}
- name: Debug GAIA Logs on Failure
if: failure()
shell: cmd
run: |
echo === Debugging GAIA failure ===
echo === Check for GAIA log files ===
if exist "gaia.cli.log" (
echo Found gaia.cli.log:
type gaia.cli.log
) else (
echo No gaia.cli.log found
)
if exist ".gaia_servers.json" (
echo Found .gaia_servers.json:
type .gaia_servers.json
) else (
echo No .gaia_servers.json found
)
echo === Check running processes ===
tasklist | findstr /i "python gaia ollama"
echo === Check ports in use ===
netstat -an | findstr ":8000 :8001 :11434"
echo === Check Ollama status ===
ollama list 2>&1 || echo "Ollama not responding"
echo === Check GAIA_MODE ===
echo GAIA_MODE=%GAIA_MODE%