-
-
Notifications
You must be signed in to change notification settings - Fork 2
212 lines (182 loc) · 7.16 KB
/
Copy pathbiovault-syqure-tests.yml
File metadata and controls
212 lines (182 loc) · 7.16 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
name: BioVault Syqure Scenario Tests
on:
# Disabled on PR to main (run on schedule / manual dispatch only)
# pull_request:
# branches: [main]
workflow_dispatch:
schedule:
- cron: '15 3 * * *'
workflow_call:
concurrency:
group: biovault-syqure-tests-${{ github.ref }}
cancel-in-progress: false
jobs:
syqure-distributed:
# Disabled: do not run syqure-distributed (set to true to re-enable).
if: ${{ false }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
runner: namespace-profile-linux-medium
# - os: macos-latest
# runner: namespace-profile-mac-medium
# - os: windows
# runner: namespace-profile-windows-large
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Setup Podman Hyper-V (Windows)
if: matrix.os == 'windows'
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 12 --memory 24576 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_INCLUDE_SYQURE: "1"
run: |
chmod +x scripts/setup-workspace.sh
./scripts/setup-workspace.sh
- name: Init syqure submodules
shell: bash
run: |
if [ -d syqure/.git ]; then
git -C syqure submodule sync --recursive
git -C syqure submodule update --init --recursive
else
echo "syqure directory not found; skipping submodule init"
fi
- 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
syqure -> 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
if: matrix.os != 'windows'
uses: actions/setup-go@v5
with:
go-version-file: syftbox/go.mod
- name: Install syqure deps (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y llvm-17 llvm-17-dev zstd libgmp-dev coturn
turnserver --version || true
- name: Install syqure deps (macOS)
if: matrix.os == 'macos-latest'
shell: bash
run: |
brew install llvm@17 zstd gmp coturn
turnserver --version || true
echo "LLVM_PREFIX=$(brew --prefix llvm@17)" >> "$GITHUB_ENV"
- name: Build syqure (Unix)
if: matrix.os != 'windows'
shell: bash
env:
LLVM_PREFIX: /opt/homebrew/opt/llvm@17
SYQURE_LLVM_INCLUDE: /usr/lib/llvm-17/include
run: |
cd syqure
chmod +x syqure_bins.sh
./syqure_bins.sh
ls -la target/debug/syqure
- name: Build BioVault CLI
run: cd cli && cargo build --release
- name: Run syqure-distributed scenario (Unix)
if: matrix.os != 'windows'
run: ./test-scenario.sh --client-mode rust tests/scenarios/syqure-distributed.yaml
- name: Run syqure-distributed scenario (Windows)
if: matrix.os == 'windows'
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 --docker tests/scenarios/syqure-distributed.yaml
- 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 3 2>/dev/null || true