Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/wine11-candidate-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
github.repository == 'SemperSupra/WineBot' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-24.04
timeout-minutes: 60
timeout-minutes: 180
permissions:
contents: read
env:
Expand Down
36 changes: 35 additions & 1 deletion scripts/ci/qualify-candidate-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,40 @@ for mode in runtime instrumented; do
"$work/pressure.log" || fail pressure_result_missing
[ "$(docker inspect --format '{{.State.OOMKilled}} {{.RestartCount}} {{.State.Running}}' "$cid")" = 'false 0 true' ] || fail pressure_container_state
printf 'WINE11_CANDIDATE_PRESSURE mode=%s clients=4 requests=480 result=pass\n' "$mode"
# Sustain each exact image under post-STOP observation for at least 55
# minutes. This is not a hostile actor or physical hardware test.
soak_events() {
timeout 10 docker exec "$cid" cat /sys/fs/cgroup/memory.events /sys/fs/cgroup/pids.events |
grep -E '^(max|oom|oom_kill) [0-9]+$'
}
soak_before="$(soak_events)" || fail "${mode}_soak_counters"
[ "$(printf '%s\n' "$soak_before" | wc -l)" -eq 4 ] || fail "${mode}_soak_counter_shape"
soak_start=$SECONDS
for sample in $(seq 1 55); do
sleep 60
if ! timeout 40 docker exec -i "$cid" python3 - "$mode" replay \
< tests/qualification/candidate_runtime_probe.py >"$work/soak.log" 2>&1; then
probe_failure "${mode}_soak_replay" "$work/soak.log"
fi
grep -Fxq "WINE11_CANDIDATE mode=$mode phase=replay result=pass" "$work/soak.log" || fail "${mode}_soak_missing"
[ "$(docker inspect --format '{{.State.OOMKilled}} {{.RestartCount}} {{.State.Running}}' "$cid")" = 'false 0 true' ] || fail "${mode}_soak_container_state"
soak_after="$(soak_events)" || fail "${mode}_soak_counters"
[ "$soak_after" = "$soak_before" ] || fail "${mode}_soak_limit_events"
if (( sample % 5 == 0 )); then
printf 'WINE11_CANDIDATE_SOAK_PROGRESS mode=%s samples=%s elapsed_seconds=%s\n' "$mode" "$sample" "$((SECONDS - soak_start))"
fi
done
(( SECONDS - soak_start >= 3300 )) || fail "${mode}_soak_duration"
# Re-exercise STOP and read-only denials after the elapsed interval.
if ! timeout 120 docker exec -i "$cid" python3 - "$mode" pressure \
< tests/qualification/candidate_runtime_probe.py >"$work/post-soak.log" 2>&1; then
probe_failure "${mode}_post_soak_pressure" "$work/post-soak.log"
fi
grep -Fxq "WINE11_CANDIDATE_PRESSURE mode=$mode clients=4 requests=480 result=pass" "$work/post-soak.log" || fail "${mode}_post_soak_result_missing"
soak_after="$(soak_events)" || fail "${mode}_post_soak_counters"
[ "$soak_after" = "$soak_before" ] || fail "${mode}_post_soak_limit_events"
[ "$(docker inspect --format '{{.State.OOMKilled}} {{.RestartCount}} {{.State.Running}}' "$cid")" = 'false 0 true' ] || fail "${mode}_post_soak_container_state"
printf 'WINE11_CANDIDATE_SOAK mode=%s samples=55 elapsed_seconds=%s result=pass\n' "$mode" "$((SECONDS - soak_start))"
docker cp "$cid:/artifacts/candidate-$mode.png" "artifacts/candidate-images/$mode.png" >/dev/null 2>&1 || fail screenshot_copy
emit_screenshot "artifacts/candidate-images/$mode.png" "$mode.png"
if ! CANDIDATE_SOURCE_SHA="$source_sha" docker compose \
Expand Down Expand Up @@ -168,6 +202,6 @@ for mode in runtime instrumented; do
done

cat > artifacts/candidate-images/qualification.json <<EOF
{"schema":"winebot.candidate-images/1","source_revision":"$source_sha","qualification":"pass","envelope":"single-operator-disposable-linux-oci","hosted_runner":"ubuntu-24.04","run_id":"$GITHUB_RUN_ID","run_attempt":"$GITHUB_RUN_ATTEMPT","images":[{"mode":"runtime","local_image_id":"$runtime_id","bytes":$runtime_bytes},{"mode":"instrumented","local_image_id":"$instrumented_id","bytes":$instrumented_bytes}],"checks":["wine11-version","read-only-uid1000","mode-capabilities","internal-workload-network","host-published-api-viewer","read-only-token-denial","actual-windows-notepad-save","brokered-ahk-input","independent-windows-input-sensor","windows-tracer-stop-restart","post-stop-input-denial","bounded-stop-observer-contention","synthetic-desktop-screenshot","live-dashboard-rfb-pixels","human-cv-viewer-geometry","sigkill-recreate-state-replay"],"wininspect_provider_bundled":false,"hostile_actor_containment_qualified":false,"physical_hardware_qualified":false}
{"schema":"winebot.candidate-images/1","source_revision":"$source_sha","qualification":"pass","envelope":"single-operator-disposable-linux-oci","hosted_runner":"ubuntu-24.04","run_id":"$GITHUB_RUN_ID","run_attempt":"$GITHUB_RUN_ATTEMPT","images":[{"mode":"runtime","local_image_id":"$runtime_id","bytes":$runtime_bytes},{"mode":"instrumented","local_image_id":"$instrumented_id","bytes":$instrumented_bytes}],"checks":["wine11-version","read-only-uid1000","mode-capabilities","internal-workload-network","host-published-api-viewer","read-only-token-denial","actual-windows-notepad-save","brokered-ahk-input","independent-windows-input-sensor","windows-tracer-stop-restart","post-stop-input-denial","bounded-stop-observer-contention","55-minute-post-stop-observation-per-mode","synthetic-desktop-screenshot","live-dashboard-rfb-pixels","human-cv-viewer-geometry","sigkill-recreate-state-replay"],"wininspect_provider_bundled":false,"hostile_actor_containment_qualified":false,"physical_hardware_qualified":false}
EOF
printf 'WINE11_CANDIDATE stage=qualified runtime_bytes=%s instrumented_bytes=%s\n' "$runtime_bytes" "$instrumented_bytes"
Loading