Skip to content

BioVault Scenario Tests #349

BioVault Scenario Tests

BioVault Scenario Tests #349

name: BioVault Scenario Tests
on:
pull_request:
branches: [main]
schedule:
- cron: '45 2 * * *'
workflow_dispatch:
workflow_call:
concurrency:
group: biovault-scenario-tests-${{ github.ref }}
cancel-in-progress: false
jobs:
run-scenarios:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: linux
runner: namespace-profile-linux-medium
client_mode: rust
scenario: tests/scenarios/inbox-ping-pong.yaml
needs_container: true
- os: linux
runner: namespace-profile-linux-medium
client_mode: rust
scenario: tests/scenarios/import-and-run.yaml
needs_container: true
- os: linux
runner: namespace-profile-linux-medium
client_mode: rust
scenario: tests/scenarios/messaging-core.yaml
needs_container: false
- os: linux
runner: namespace-profile-linux-medium
client_mode: rust
scenario: tests/scenarios/break-nextflow.yaml
needs_container: true
- os: linux
runner: namespace-profile-linux-medium
client_mode: rust
scenario: tests/scenarios/key-management.yaml
needs_container: false
# allele-freq.yaml removed - covered by allele-freq-syqure-test.yml workflow
# Windows scenarios disabled for PR -> main
# - os: windows
# runner: namespace-profile-windows-medium
# client_mode: rust
# scenario: tests/scenarios/import-and-run.yaml
# needs_container: true
# - os: windows
# runner: namespace-profile-windows-medium
# client_mode: rust
# scenario: tests/scenarios/inbox-ping-pong.yaml
# needs_container: true
# - os: windows
# runner: namespace-profile-windows-medium
# client_mode: rust
# scenario: tests/scenarios/messaging-core.yaml
# needs_container: false
# - os: windows
# runner: namespace-profile-windows-medium
# client_mode: rust
# scenario: tests/scenarios/break-nextflow.yaml
# needs_container: true
# - os: windows
# runner: namespace-profile-windows-medium
# client_mode: rust
# scenario: tests/scenarios/key-management.yaml
# needs_container: false
steps:
- uses: actions/checkout@v4
- name: Setup Podman Hyper-V (Windows)
if: matrix.os == 'windows' && matrix.needs_container == true
shell: pwsh
run: |
$ErrorActionPreference = "Continue"
Write-Host "=== System Info ===" -ForegroundColor Cyan
Write-Host "OS: $([System.Environment]::OSVersion.VersionString)"
whoami
Write-Host ""
Write-Host "=== Hyper-V Status ===" -ForegroundColor Cyan
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V* | Format-Table FeatureName, State
Write-Host ""
Write-Host "=== Installing Chocolatey ===" -ForegroundColor Cyan
if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
$env:PATH = "$env:PATH;C:\ProgramData\chocolatey\bin"
}
choco --version
Write-Host ""
Write-Host "=== Installing Podman ===" -ForegroundColor Cyan
choco install podman-cli -y
$env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH"
Write-Host ""
Write-Host "=== Podman Version ===" -ForegroundColor Cyan
podman --version
Write-Host ""
Write-Host "=== Initializing Podman with Hyper-V ===" -ForegroundColor Cyan
$env:CONTAINERS_MACHINE_PROVIDER = "hyperv"
[Environment]::SetEnvironmentVariable("CONTAINERS_MACHINE_PROVIDER", "hyperv", "Process")
# Clean up stale machines (namespace runners can retain state)
podman machine stop podman-hyperv 2>$null
podman machine stop podman-machine-default 2>$null
podman machine rm -f podman-hyperv 2>$null
podman machine rm -f podman-machine-default 2>$null
podman machine init podman-hyperv --cpus 8 --memory 12288 2>$null
$started = $false
for ($i=0; $i -lt 3; $i++) {
podman machine start podman-hyperv
if ($LASTEXITCODE -eq 0) { $started = $true; break }
Start-Sleep -Seconds 5
}
if (-not $started) { throw "Podman Hyper-V machine failed to start" }
podman system connection default podman-hyperv
Write-Host ""
Write-Host "=== Testing Podman ===" -ForegroundColor Cyan
podman info
podman run --rm hello-world
- name: Setup workspace dependencies
shell: bash
env:
BV_SKIP_SYQURE: "1"
run: |
chmod +x scripts/setup-workspace.sh
./scripts/setup-workspace.sh
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.91.0
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: |
cli -> target
syftbox/rust -> target
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: syftbox/go.mod
- name: Install coturn (Linux)
if: matrix.os == 'linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y coturn
turnserver --version || true
- name: Install Nextflow (Unix)
if: matrix.os != 'windows'
shell: bash
run: |
curl -fsSL https://get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
chmod +x /usr/local/bin/nextflow
nextflow -version
- name: Build BioVault CLI
run: cd cli && cargo build --release
- name: Run scenario (Unix)
if: matrix.os != 'windows'
shell: bash
run: ./test-scenario.sh --client-mode ${{ matrix.client_mode }} ${{ matrix.scenario }}
# - name: Hyper-V smoke test (Windows)
# if: matrix.os == 'windows' && matrix.needs_container == true
# shell: pwsh
# env:
# CONTAINERS_MACHINE_PROVIDER: hyperv
# BIOVAULT_CONTAINER_RUNTIME: podman
# BIOVAULT_HYPERV_MOUNT: "1"
# run: .\win.ps1 tests/scripts/test-hyperv-herc2.sh
- name: Run scenario (Windows Hyper-V)
if: matrix.os == 'windows' && matrix.needs_container == true
shell: pwsh
env:
CONTAINERS_MACHINE_PROVIDER: hyperv
BIOVAULT_CONTAINER_RUNTIME: podman
BIOVAULT_HYPERV_MOUNT: "0"
BIOVAULT_SYQURE_KEEP_CONTAINERS: "1"
run: .\win.ps1 ./test-scenario.sh --client-mode ${{ matrix.client_mode }} ${{ matrix.scenario }}
- name: Run scenario (Windows)
if: matrix.os == 'windows' && matrix.needs_container != true
shell: pwsh
run: .\win.ps1 ./test-scenario.sh --client-mode ${{ matrix.client_mode }} ${{ matrix.scenario }}
- name: Podman debug (Windows)
if: failure() && matrix.os == 'windows'
shell: pwsh
env:
CONTAINERS_MACHINE_PROVIDER: hyperv
run: |
Write-Host "=== Podman Machine List ===" -ForegroundColor Cyan
podman machine list
Write-Host ""
Write-Host "=== Podman System Info ===" -ForegroundColor Cyan
podman info
Write-Host ""
Write-Host "=== Podman Containers (all) ===" -ForegroundColor Cyan
podman ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.ExitCode}}"
Write-Host ""
Write-Host "=== Syqure Container Logs (last 200 lines) ===" -ForegroundColor Cyan
$containers = podman ps -a --format "{{.Names}}" | Where-Object { $_ -match "syqure" }
foreach ($name in $containers) {
Write-Host "--- $name ---" -ForegroundColor Yellow
podman logs --tail 200 $name 2>$null
}
- name: Show logs on failure
if: failure()
shell: bash
run: |
echo "=== Sandbox Directory Structure ==="
find sandbox -type d -maxdepth 2 2>/dev/null || true
echo ""
echo "=== Client Logs ==="
find sandbox -name "*.log" -exec echo "--- {} ---" \; -exec cat {} \; 2>/dev/null || true
echo ""
echo "=== Nextflow Task Errors (first failed task) ==="
# Find a .command.err file from the work directory
WORK_DIR=$(find ../bioscript -name "work" -type d 2>/dev/null | head -1)
if [ -n "$WORK_DIR" ]; then
echo "Work directory: $WORK_DIR"
# Find first .command.err with content
find "$WORK_DIR" -name ".command.err" -size +0 2>/dev/null | head -1 | xargs cat 2>/dev/null || echo "No error files found"
echo ""
echo "=== Nextflow Task Script ==="
find "$WORK_DIR" -name ".command.sh" 2>/dev/null | head -1 | xargs cat 2>/dev/null || echo "No script files found"
echo ""
echo "=== Nextflow Task Run Script ==="
find "$WORK_DIR" -name ".command.run" 2>/dev/null | head -1 | xargs cat 2>/dev/null || echo "No run files found"
fi
- name: Cleanup devstack
if: always()
shell: bash
run: |
chmod +x ./tests/scripts/devstack.sh
./tests/scripts/devstack.sh --stop --reset || true
echo ""
echo "=== Client Logs ==="
find sandbox -name "*.log" -exec echo "--- {} ---" \; -exec cat {} \; 2>/dev/null || true
echo ""
echo "=== MPC Channel Files ==="
find sandbox -path "*/_mpc/*" -type f 2>/dev/null | head -50 || true
- name: Cleanup devstack
if: always()
shell: bash
run: |
chmod +x ./tests/scripts/devstack.sh
./tests/scripts/devstack.sh --stop --reset || true