forked from mtusi2026/mtusi2026lab4
4
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# Отчёт — лабораторная 4
|
||||
|
||||
- Автор, группа: Никифорова Екатерина, БВТ2301
|
||||
- Целевая оценка: **4** (уровни 3 и 4, трек 5 не заявлен)
|
||||
- Commit/PR: https://gitea.privcloud.tech/eqktrin/mtusi2026lab4/pulls (PR после публикации)
|
||||
- Источники, библиотеки, помощь ИИ: FastAPI 0.115, Uvicorn 0.30,
|
||||
PostgreSQL 17.6, Valkey 8.1.3, Silo (`pgsty/silo` — поддерживаемый форк
|
||||
MinIO: официальные образы MinIO удалены с Docker Hub и Quay в 2025),
|
||||
Nginx 1.27, psycopg 3.2, boto3 1.43.107, Pillow 12.3.0, Argon2id.
|
||||
Помощь ИИ при написании кода и отчёта.
|
||||
|
||||
## Запуск из чистого clone
|
||||
|
||||
**Требования:** Docker Engine ≥ 24 с Compose v2, Python ≥ 3.9,
|
||||
PowerShell (Windows) или sh (Linux/macOS), `PYTHONUTF8=1` для корректной
|
||||
работы публичных тестов на Windows.
|
||||
|
||||
```powershell
|
||||
git clone https://gitea.privcloud.tech/eqktrin/mtusi2026lab4.git
|
||||
cd mtusi2026lab4
|
||||
|
||||
# 1. Секреты. На Windows — PowerShell-скрипт ниже; на Linux/macOS — sh scripts/init-secrets.sh
|
||||
# (PowerShell-вариант создаёт secrets/* и .env через System.Security.Cryptography)
|
||||
$bytes = New-Object byte[] 16
|
||||
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes)
|
||||
$pgPass = -join ($bytes | ForEach-Object { $_.ToString("x2") })
|
||||
# ... и т.д. — см. README или скрипт init-secrets.sh
|
||||
docker compose --env-file .env config --quiet
|
||||
|
||||
# 2. Сборка и запуск
|
||||
docker compose --env-file .env up -d --build
|
||||
|
||||
# 3. Дождаться готовности
|
||||
Invoke-RestMethod http://localhost:8080/health/ready
|
||||
|
||||
# 4. Тесты
|
||||
$env:PYTHONUTF8 = "1"
|
||||
python tests/smoke.py --base-url http://localhost:8080
|
||||
python student-tests/test_attachments_negative.py --base-url http://localhost:8080
|
||||
python tests/resilience.py --mode persistence --action-script scripts/restart.cmd --base-url http://localhost:8080
|
||||
python tests/resilience.py --mode failover --action-script scripts/stop-one.cmd --base-url http://localhost:8080
|
||||
Reference in New Issue
Block a user