Files
mtusi2026lab3/.github/workflows/lab3-stand.yml
T

126 lines
4.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Реальный прогон Docker-стенда lab3 на GitHub-hosted runner (ubuntu, 4 vCPU / 16 GB).
# Нужен потому, что на машине разработки нет аппаратной виртуализации для Docker Desktop.
# Все результаты — настоящие измерения; сокращённая методика трека 1 описана в REPORT.md.
name: lab3 stand
on:
push:
branches: [lab3]
workflow_dispatch:
permissions:
contents: read
# Новый push отменяет незавершённый прогон той же ветки.
concurrency:
group: lab3-stand-${{ github.ref }}
cancel-in-progress: true
env:
PYTHONUTF8: "1"
jobs:
levels-3-4:
name: Уровни 3–4 (smoke, failover, persistence, идемпотентность, серия отказов, rolling update)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Секреты и запуск стенда
run: |
chmod +x scripts/*.sh
sh scripts/init-secrets.sh
docker compose --env-file .env config --quiet
docker compose --env-file .env up -d --build --wait
- name: make check + сбор доказательств
run: |
make check PYTHON=python
PYTHON=python sh scripts/collect-evidence.sh
- name: Окружение runner
if: always()
run: |
{ nproc; free -m; docker version --format '{{.Server.Version}}'; docker compose version; } > evidence/runner.txt
docker compose ps -a > evidence/docker_ps_final.txt || true
docker compose logs --no-color lb > evidence/lb_log.txt 2>&1 || true
- uses: actions/upload-artifact@v4
if: always()
with:
name: evidence-levels-3-4
path: evidence/
track1:
name: Трек 1 — ${{ matrix.series }}
runs-on: ubuntu-24.04
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
# Серии A, B, D уже измерены прогоном 39970452644 (данные в evidence/track1);
# второй прогон добавляет C (причинность узкого места) и E (рост реплик после улучшения).
include:
- series: C_shared_resources
configs: ""
levels: "16,64"
- series: E_scale_out_after_fix
configs: ""
levels: "4,16,64"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Секреты
run: chmod +x scripts/*.sh && sh scripts/init-secrets.sh
- name: Серия ${{ matrix.series }}
run: |
python scripts/track1.py --series ${{ matrix.series }} \
--configs "${{ matrix.configs }}" --levels "${{ matrix.levels }}" \
--duration 15s --warmup 3s --repeats 3 \
--output evidence/track1/raw_${{ matrix.series }}.jsonl
- name: Окружение runner
if: always()
run: |
mkdir -p evidence/track1
{ nproc; free -m; lscpu | grep -E 'Model name|^CPU\(s\)'; } > evidence/track1/runner_${{ matrix.series }}.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: track1-${{ matrix.series }}
path: evidence/track1/
# api.github.com недоступен из сети разработчика, а github.com (git) — доступен,
# поэтому все артефакты дополнительно публикуются в ветку lab3-results.
publish:
name: Публикация результатов в ветку lab3-results
needs: [levels-3-4, track1]
if: always()
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: collected
- name: Commit в lab3-results
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -q --orphan lab3-results
git rm -rf -q .
{ echo "source_commit=${{ github.sha }}"
echo "run=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "levels_3_4=${{ needs.levels-3-4.result }}"
echo "track1=${{ needs.track1.result }}"; } > collected/RUN.txt
cp -r collected/. .
rm -rf collected
git add -A
git commit -q -m "results for ${{ github.sha }}"
git push -f origin lab3-results