feat(lab4): implement S3 attachments with fault tolerance
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"passed": true,
|
||||
"both_uploaders_tested": 2,
|
||||
"scenarios": [
|
||||
{
|
||||
"uploader_instance": "406afeb6-f014-4233-87fb-3ee2e5d0f599",
|
||||
"stopped_container": "30fcbabd1e8c",
|
||||
"survivor_instance": "8c155e11-6333-44b9-8520-b1e6e1e53485",
|
||||
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"original_identical": true
|
||||
},
|
||||
{
|
||||
"uploader_instance": "8c155e11-6333-44b9-8520-b1e6e1e53485",
|
||||
"stopped_container": "050e1dff86f8",
|
||||
"survivor_instance": "807def1e-c2d4-4555-896c-68b5796f7c8f",
|
||||
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"original_identical": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
Compose now can delegate build to bake for better performances
|
||||
Just set COMPOSE_BAKE=true
|
||||
#0 building with "desktop-linux" instance using docker driver
|
||||
|
||||
#1 [migrate internal] load build definition from Dockerfile
|
||||
#1 transferring dockerfile: 954B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [migrate internal] load metadata for docker.io/library/python:3.11.16-slim-bookworm
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [migrate internal] load .dockerignore
|
||||
#3 transferring context: 222B done
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [migrate internal] load build context
|
||||
#4 transferring context: 1.34kB done
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [migrate 1/8] FROM docker.io/library/python:3.11.16-slim-bookworm@sha256:a36c24f9cbdf4fd0f52d67f0823eeac19c2028c637cecc392d97f980d4fec56b
|
||||
#5 resolve docker.io/library/python:3.11.16-slim-bookworm@sha256:a36c24f9cbdf4fd0f52d67f0823eeac19c2028c637cecc392d97f980d4fec56b 0.0s done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [migrate 2/8] WORKDIR /app
|
||||
#6 CACHED
|
||||
|
||||
#7 [migrate 7/8] COPY --chown=appuser:appuser db/ ./db/
|
||||
#7 CACHED
|
||||
|
||||
#8 [migrate 3/8] COPY requirements.txt .
|
||||
#8 CACHED
|
||||
|
||||
#9 [migrate 5/8] RUN useradd --uid 10001 --create-home --shell /usr/sbin/nologin appuser
|
||||
#9 CACHED
|
||||
|
||||
#10 [migrate 4/8] RUN python -m pip install --no-cache-dir -r requirements.txt
|
||||
#10 CACHED
|
||||
|
||||
#11 [migrate 6/8] COPY --chown=appuser:appuser src/ ./src/
|
||||
#11 CACHED
|
||||
|
||||
#12 [migrate 8/8] COPY --chown=appuser:appuser contracts/openapi.json ./contracts/openapi.json
|
||||
#12 CACHED
|
||||
|
||||
#13 [migrate] exporting to image
|
||||
#13 exporting layers done
|
||||
#13 exporting manifest sha256:87efe3e62f69573c004c4121ff309b1ad35bdf670075e413f766061b78b3efc5 done
|
||||
#13 exporting config sha256:7be1ef706b170dc197efbeedfbd3d09501e6a5f4e8fd590df6b3e6ff14ebdb49 done
|
||||
#13 exporting attestation manifest sha256:2e280e83286ae3dab79ddf06b9735524b172bbfdde5487869259e21b361ac693 done
|
||||
#13 exporting manifest list sha256:26a6698cdea3199fe81ad434ade082fb14ad71f20b635254f0f8ed7c3cdcba5e done
|
||||
#13 naming to docker.io/library/mtusi2026lab4-api:local done
|
||||
#13 unpacking to docker.io/library/mtusi2026lab4-api:local done
|
||||
#13 DONE 0.0s
|
||||
|
||||
#14 [migrate] resolving provenance for metadata file
|
||||
#14 DONE 0.0s
|
||||
|
||||
#15 [api internal] load build definition from Dockerfile
|
||||
#15 transferring dockerfile: 954B done
|
||||
#15 DONE 0.0s
|
||||
|
||||
#2 [api internal] load metadata for docker.io/library/python:3.11.16-slim-bookworm
|
||||
#2 DONE 0.0s
|
||||
|
||||
#16 [api internal] load .dockerignore
|
||||
#16 transferring context: 222B done
|
||||
#16 DONE 0.0s
|
||||
|
||||
#17 [api internal] load build context
|
||||
#17 transferring context: 1.34kB done
|
||||
#17 DONE 0.0s
|
||||
|
||||
#5 [api 1/8] FROM docker.io/library/python:3.11.16-slim-bookworm@sha256:a36c24f9cbdf4fd0f52d67f0823eeac19c2028c637cecc392d97f980d4fec56b
|
||||
#5 resolve docker.io/library/python:3.11.16-slim-bookworm@sha256:a36c24f9cbdf4fd0f52d67f0823eeac19c2028c637cecc392d97f980d4fec56b 0.0s done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#18 [api 7/8] COPY --chown=appuser:appuser db/ ./db/
|
||||
#18 CACHED
|
||||
|
||||
#6 [api 2/8] WORKDIR /app
|
||||
#6 CACHED
|
||||
|
||||
#19 [api 6/8] COPY --chown=appuser:appuser src/ ./src/
|
||||
#19 CACHED
|
||||
|
||||
#20 [api 4/8] RUN python -m pip install --no-cache-dir -r requirements.txt
|
||||
#20 CACHED
|
||||
|
||||
#21 [api 5/8] RUN useradd --uid 10001 --create-home --shell /usr/sbin/nologin appuser
|
||||
#21 CACHED
|
||||
|
||||
#22 [api 3/8] COPY requirements.txt .
|
||||
#22 CACHED
|
||||
|
||||
#23 [api 8/8] COPY --chown=appuser:appuser contracts/openapi.json ./contracts/openapi.json
|
||||
#23 CACHED
|
||||
|
||||
#24 [api] exporting to image
|
||||
#24 exporting layers done
|
||||
#24 exporting manifest sha256:36e8cc71595fc04804ec665284eb6328bd087de9dded24bf5363e43219b05be3 done
|
||||
#24 exporting config sha256:90e3dbc5cad2036701f73221a02ab439270f933b193dbd812901db095860b963 done
|
||||
#24 exporting attestation manifest sha256:2364f47deb3b19f215c9813c211c0510a5c625fa838558d4fbc002e090e306e2 done
|
||||
#24 exporting manifest list sha256:bf8b09641c0bf0889e4103bc4a7ac1dd6563feeda39b19b8762788eab50cbd5a done
|
||||
#24 naming to docker.io/library/mtusi2026lab4-api:local done
|
||||
#24 unpacking to docker.io/library/mtusi2026lab4-api:local done
|
||||
#24 DONE 0.0s
|
||||
|
||||
#25 [api] resolving provenance for metadata file
|
||||
#25 DONE 0.0s
|
||||
api Built
|
||||
migrate Built
|
||||
Container mtusi2026lab4-redis-1 Running
|
||||
Container mtusi2026lab4-s3-1 Running
|
||||
Container mtusi2026lab4-postgres-1 Running
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Created
|
||||
Container mtusi2026lab4-api-2 Stopping
|
||||
Container mtusi2026lab4-api-1 Stopping
|
||||
Container mtusi2026lab4-api-1 Stopped
|
||||
Container mtusi2026lab4-api-2 Stopped
|
||||
Container mtusi2026lab4-migrate-1 Recreate
|
||||
Container mtusi2026lab4-migrate-1 Recreated
|
||||
Container mtusi2026lab4-lb-1 Stopping
|
||||
Container mtusi2026lab4-cleanup-1 Stopping
|
||||
Container mtusi2026lab4-lb-1 Stopped
|
||||
Container mtusi2026lab4-cleanup-1 Stopped
|
||||
Container mtusi2026lab4-api-1 Recreate
|
||||
Container mtusi2026lab4-lb-1 Stopping
|
||||
Container mtusi2026lab4-cleanup-1 Stopping
|
||||
Container mtusi2026lab4-cleanup-1 Stopped
|
||||
Container mtusi2026lab4-lb-1 Stopped
|
||||
Container mtusi2026lab4-api-2 Recreate
|
||||
Container mtusi2026lab4-api-1 Recreated
|
||||
Container mtusi2026lab4-api-2 Recreated
|
||||
Container mtusi2026lab4-lb-1 Created
|
||||
Container mtusi2026lab4-cleanup-1 Recreate
|
||||
Container mtusi2026lab4-cleanup-1 Recreated
|
||||
Container mtusi2026lab4-postgres-1 Waiting
|
||||
Container mtusi2026lab4-s3-1 Waiting
|
||||
Container mtusi2026lab4-s3-1 Healthy
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Starting
|
||||
Container mtusi2026lab4-postgres-1 Healthy
|
||||
Container mtusi2026lab4-migrate-1 Starting
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Started
|
||||
Container mtusi2026lab4-migrate-1 Started
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Waiting
|
||||
Container mtusi2026lab4-migrate-1 Waiting
|
||||
Container mtusi2026lab4-redis-1 Waiting
|
||||
Container mtusi2026lab4-redis-1 Healthy
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Exited
|
||||
Container mtusi2026lab4-migrate-1 Exited
|
||||
Container mtusi2026lab4-api-2 Starting
|
||||
Container mtusi2026lab4-api-2 Started
|
||||
Container mtusi2026lab4-api-1 Starting
|
||||
Container mtusi2026lab4-api-1 Started
|
||||
Container mtusi2026lab4-api-2 Waiting
|
||||
Container mtusi2026lab4-api-1 Waiting
|
||||
Container mtusi2026lab4-api-2 Waiting
|
||||
Container mtusi2026lab4-api-1 Waiting
|
||||
Container mtusi2026lab4-api-2 Healthy
|
||||
Container mtusi2026lab4-api-1 Healthy
|
||||
Container mtusi2026lab4-lb-1 Starting
|
||||
Container mtusi2026lab4-api-2 Healthy
|
||||
Container mtusi2026lab4-api-1 Healthy
|
||||
Container mtusi2026lab4-cleanup-1 Starting
|
||||
Container mtusi2026lab4-lb-1 Started
|
||||
Container mtusi2026lab4-cleanup-1 Started
|
||||
@@ -0,0 +1,77 @@
|
||||
MODIFIED
|
||||
.dockerignore
|
||||
.env.example
|
||||
.gitignore
|
||||
REPORT.md
|
||||
infra/README.md
|
||||
|
||||
ADDED (unstaged)
|
||||
Dockerfile
|
||||
compose.yaml
|
||||
db/migrations/001_initial.sql
|
||||
db/migrations/002_idempotency.sql
|
||||
db/migrations/003_attachments.sql
|
||||
evidence/attachment-failover.txt
|
||||
evidence/build.txt
|
||||
evidence/changed-files.txt
|
||||
evidence/check.txt
|
||||
evidence/cleanup-repeat.txt
|
||||
evidence/cleanup.txt
|
||||
evidence/compose-config.txt
|
||||
evidence/development-notes.txt
|
||||
evidence/failover.txt
|
||||
evidence/faults-initial.txt
|
||||
evidence/faults.txt
|
||||
evidence/final-audit.txt
|
||||
evidence/git-status.txt
|
||||
evidence/image-pull.txt
|
||||
evidence/negative.txt
|
||||
evidence/persistence.txt
|
||||
evidence/restart-after.txt
|
||||
evidence/restart-before.txt
|
||||
evidence/restore-after-failover.txt
|
||||
evidence/smoke.txt
|
||||
evidence/storage-audit.txt
|
||||
evidence/storage-image-switch.txt
|
||||
evidence/upload-load.json
|
||||
evidence/upload-load.txt
|
||||
evidence/validate.txt
|
||||
evidence/verification.json
|
||||
infra/haproxy.cfg
|
||||
infra/s3-bootstrap.sh
|
||||
infra/s3-policy.json
|
||||
requirements.txt
|
||||
scripts/README.md
|
||||
scripts/cleanup.sh
|
||||
scripts/compose.sh
|
||||
scripts/init-local.py
|
||||
scripts/restart.sh
|
||||
scripts/stop-one.sh
|
||||
scripts/verify.py
|
||||
src/__init__.py
|
||||
src/attachments.py
|
||||
src/auth.py
|
||||
src/chat_repository.py
|
||||
src/cleanup.py
|
||||
src/cleanup_loop.py
|
||||
src/database.py
|
||||
src/image_check.py
|
||||
src/main.py
|
||||
src/migrate.py
|
||||
src/session_cache.py
|
||||
src/storage.py
|
||||
src/user_repository.py
|
||||
student-tests/attachment-failover.py
|
||||
student-tests/audit-storage.py
|
||||
student-tests/faults.py
|
||||
student-tests/fixtures/README.md
|
||||
student-tests/fixtures/sample.jpg
|
||||
student-tests/negative.py
|
||||
student-tests/upload-load.py
|
||||
|
||||
LOCAL IGNORED
|
||||
DEFENSE.md
|
||||
.env
|
||||
secrets/
|
||||
backups/
|
||||
.venv/
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1 @@
|
||||
{"scanned": 55, "fresh": 55, "referenced": 0, "busy": 0, "deleted": 0}
|
||||
@@ -0,0 +1 @@
|
||||
{"scanned": 55, "fresh": 55, "referenced": 0, "busy": 0, "deleted": 0}
|
||||
@@ -0,0 +1,13 @@
|
||||
Initial environment/development failures (not final PASS):
|
||||
- pip install in sandbox: DNS/host lookup denied. Retried with network approval; installed successfully.
|
||||
- Docker Desktop credential helper absent from PATH. scripts/compose.sh adds the existing Docker Desktop bin path.
|
||||
- minio/minio release-tag pull: access denied. Quay release-tag and cached working digest pull: 401.
|
||||
- A working cached Quay image was first used for development. Final deployment changed to accessible
|
||||
bitnamilegacy/minio:2025.7.23-debian-12-r5@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20.
|
||||
Docker pull succeeded. Before switching, a stopped-volume tar backup was saved locally under ignored backups/.
|
||||
All 33 previously committed originals (79300697 bytes) retained matching sizes and SHA-256 after switch.
|
||||
- Own repeated cleanup test incorrectly treated all pre-existing objects (including an orphan from an earlier
|
||||
crash) as referenced. Failure retained in faults-initial.txt. Assertion corrected to compare only keys backed
|
||||
by committed PostgreSQL metadata. Cleanup algorithm not weakened; final suite rerun.
|
||||
- Sandbox Docker socket access failures were retried with the required execution permissions.
|
||||
Public tests and mandatory contracts were not edited. No Git staging/commit/push/PR actions performed.
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8084"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 116, "failed_attempts": 3, "first_recovery_seconds": 2.28}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,10 @@
|
||||
Traceback (most recent call last):
|
||||
File "/Users/aleksandradugina/Desktop/лабы/4к1с/внп/Projects/mtusi2026lab4/student-tests/faults.py", line 204, in <module>
|
||||
main()
|
||||
~~~~^^
|
||||
File "/Users/aleksandradugina/Desktop/лабы/4к1с/внп/Projects/mtusi2026lab4/student-tests/faults.py", line 92, in main
|
||||
check(not orphan & final and before <= final, 'cleanup lost used data')
|
||||
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/Users/aleksandradugina/Desktop/лабы/4к1с/внп/Projects/mtusi2026lab4/tests/client.py", line 24, in check
|
||||
raise Failure(message)
|
||||
client.Failure: cleanup lost used data
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"passed": [
|
||||
"S3_PUT_then_DB_failure_returns_503_with_real_orphan",
|
||||
"fresh_orphan_survives_one_hour_grace",
|
||||
"expired_orphan_deleted_referenced_objects_preserved_test_clock",
|
||||
"cleanup_repeatable",
|
||||
"anonymous_GET_and_LIST_denied_API_cannot_read_policy",
|
||||
"s3_outage_API_503",
|
||||
"postgres_outage_API_503",
|
||||
"interrupted_upload_no_S3_object",
|
||||
"API_SIGKILL_after_PUT_before_COMMIT_orphan_recoverable",
|
||||
"API_crash_orphan_actually_cleaned_after_test_clock_grace",
|
||||
"confirmed_original_survives_faults"
|
||||
],
|
||||
"count": 11,
|
||||
"privacy_status_codes": [
|
||||
403,
|
||||
403,
|
||||
403
|
||||
],
|
||||
"cleanup_expired_result": {
|
||||
"scanned": 41,
|
||||
"fresh": 0,
|
||||
"referenced": 40,
|
||||
"busy": 0,
|
||||
"deleted": 1
|
||||
},
|
||||
"grace_test": "test process clock +2h; production grace remains 1h"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
$ git diff --check
|
||||
exit_code=0
|
||||
|
||||
$ git diff --exit-code -- tests contracts README.md COURSE.md CONTRIBUTING.md lab.json
|
||||
exit_code=0
|
||||
|
||||
$ git diff --cached --exit-code
|
||||
exit_code=0
|
||||
|
||||
$ git check-ignore DEFENSE.md .env secrets/postgres_password backups/minio-before-image-change.tar
|
||||
exit_code=0
|
||||
DEFENSE.md
|
||||
.env
|
||||
secrets/postgres_password
|
||||
backups/minio-before-image-change.tar
|
||||
|
||||
$ git -C ../mtusi2026lab3 status -sb
|
||||
exit_code=0
|
||||
## solution/BPI2301-Dugina...origin/solution/BPI2301-Dugina
|
||||
|
||||
PASS: 16 verification steps have actual exit_code=0; Python syntax parsed; local password values absent from tracked/nonignored files.
|
||||
@@ -0,0 +1,48 @@
|
||||
## solution/BPI2301-Dugina
|
||||
M .dockerignore
|
||||
M .env.example
|
||||
M .gitignore
|
||||
M REPORT.md
|
||||
M infra/README.md
|
||||
?? Dockerfile
|
||||
?? compose.yaml
|
||||
?? db/
|
||||
?? evidence/attachment-failover.txt
|
||||
?? evidence/build.txt
|
||||
?? evidence/changed-files.txt
|
||||
?? evidence/check.txt
|
||||
?? evidence/cleanup-repeat.txt
|
||||
?? evidence/cleanup.txt
|
||||
?? evidence/compose-config.txt
|
||||
?? evidence/development-notes.txt
|
||||
?? evidence/failover.txt
|
||||
?? evidence/faults-initial.txt
|
||||
?? evidence/faults.txt
|
||||
?? evidence/final-audit.txt
|
||||
?? evidence/git-status.txt
|
||||
?? evidence/image-pull.txt
|
||||
?? evidence/negative.txt
|
||||
?? evidence/persistence.txt
|
||||
?? evidence/restart-after.txt
|
||||
?? evidence/restart-before.txt
|
||||
?? evidence/restore-after-failover.txt
|
||||
?? evidence/smoke.txt
|
||||
?? evidence/storage-audit.txt
|
||||
?? evidence/storage-image-switch.txt
|
||||
?? evidence/upload-load.json
|
||||
?? evidence/upload-load.txt
|
||||
?? evidence/validate.txt
|
||||
?? evidence/verification.json
|
||||
?? infra/haproxy.cfg
|
||||
?? infra/s3-bootstrap.sh
|
||||
?? infra/s3-policy.json
|
||||
?? requirements.txt
|
||||
?? scripts/README.md
|
||||
?? scripts/cleanup.sh
|
||||
?? scripts/compose.sh
|
||||
?? scripts/init-local.py
|
||||
?? scripts/restart.sh
|
||||
?? scripts/stop-one.sh
|
||||
?? scripts/verify.py
|
||||
?? src/
|
||||
?? student-tests/
|
||||
@@ -0,0 +1,4 @@
|
||||
docker.io/bitnamilegacy/minio@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20: Pulling from bitnamilegacy/minio
|
||||
Digest: sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20
|
||||
Status: Image is up to date for bitnamilegacy/minio@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20
|
||||
docker.io/bitnamilegacy/minio:2025.7.23-debian-12-r5@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"passed": [
|
||||
"bytes_over_10MiB",
|
||||
"pixels_over_40M",
|
||||
"broken_png",
|
||||
"broken_jpeg",
|
||||
"mime_mismatch",
|
||||
"invalid_format",
|
||||
"multipart_rejected",
|
||||
"dangerous_filenames",
|
||||
"original_checksum_and_shared_access",
|
||||
"JPEG_success_and_checksum",
|
||||
"download_auth_and_acl",
|
||||
"unknown_foreign_and_other_chat_attachment",
|
||||
"attachment_id_validation",
|
||||
"attachment_idempotency_across_replicas",
|
||||
"chunked_body_limit",
|
||||
"client_disconnect_server_survives"
|
||||
],
|
||||
"count": 16,
|
||||
"note": "Fault/orphan checks are separate in faults.py"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8084"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,7 @@
|
||||
/mtusi2026lab4-api-1 2026-11-06T14:52:10.90533168Z running
|
||||
/mtusi2026lab4-api-2 2026-11-06T14:52:10.803373597Z running
|
||||
/mtusi2026lab4-cleanup-1 2026-11-06T14:52:20.417700921Z running
|
||||
/mtusi2026lab4-lb-1 2026-11-06T14:52:10.491475222Z running
|
||||
/mtusi2026lab4-postgres-1 2026-11-06T14:52:10.469402597Z running
|
||||
/mtusi2026lab4-redis-1 2026-11-06T14:52:10.394762722Z running
|
||||
/mtusi2026lab4-s3-1 2026-11-06T14:52:10.447334638Z running
|
||||
@@ -0,0 +1,7 @@
|
||||
/mtusi2026lab4-api-1 2026-11-06T14:52:01.854436551Z running
|
||||
/mtusi2026lab4-api-2 2026-11-06T14:52:01.779041218Z running
|
||||
/mtusi2026lab4-cleanup-1 2026-11-06T14:52:07.48552572Z running
|
||||
/mtusi2026lab4-lb-1 2026-11-06T14:52:07.484992512Z running
|
||||
/mtusi2026lab4-postgres-1 2026-11-06T14:44:12.610996625Z running
|
||||
/mtusi2026lab4-redis-1 2026-11-06T14:43:25.264236673Z running
|
||||
/mtusi2026lab4-s3-1 2026-11-06T14:50:28.060451049Z running
|
||||
@@ -0,0 +1,16 @@
|
||||
Container mtusi2026lab4-s3-1 Waiting
|
||||
Container mtusi2026lab4-postgres-1 Waiting
|
||||
Container mtusi2026lab4-postgres-1 Healthy
|
||||
Container mtusi2026lab4-migrate-1 Starting
|
||||
Container mtusi2026lab4-s3-1 Healthy
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Starting
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Started
|
||||
Container mtusi2026lab4-migrate-1 Started
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Waiting
|
||||
Container mtusi2026lab4-migrate-1 Waiting
|
||||
Container mtusi2026lab4-redis-1 Waiting
|
||||
Container mtusi2026lab4-s3-bootstrap-1 Exited
|
||||
Container mtusi2026lab4-redis-1 Healthy
|
||||
Container mtusi2026lab4-migrate-1 Exited
|
||||
Container mtusi2026lab4-api-2 Starting
|
||||
Container mtusi2026lab4-api-2 Started
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 tests/smoke.py --base-url "http://localhost:8084"
|
||||
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"verified_originals": 55,
|
||||
"verified_bytes": 157371407,
|
||||
"all_checksums_match": true
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"verified_originals": 33,
|
||||
"verified_bytes": 79300697,
|
||||
"all_checksums_match": true
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"utc": "2026-11-06T14:53:56Z",
|
||||
"concurrency": 10,
|
||||
"requests": 10,
|
||||
"original_bytes": 7684008,
|
||||
"dimensions": [
|
||||
1600,
|
||||
1600
|
||||
],
|
||||
"successful_requests": 10,
|
||||
"failed_requests": 0,
|
||||
"elapsed_seconds": 1.785140791995218,
|
||||
"successful_rps": 5.601799054080877,
|
||||
"latency_success_seconds": {
|
||||
"p50": 1.0907350000052247,
|
||||
"p95": 1.743270292005036,
|
||||
"p99": 1.743270292005036
|
||||
},
|
||||
"api_cgroups": [
|
||||
{
|
||||
"sample_count": 907,
|
||||
"sampled_baseline_bytes": 80306176,
|
||||
"sampled_peak_bytes": 112791552,
|
||||
"cgroup_lifetime_peak_bytes": 138301440,
|
||||
"elapsed_seconds": 20.002547300000515,
|
||||
"cpu_usage_seconds": 2.43918,
|
||||
"container": "050e1dff86f8",
|
||||
"average_cpu_percent_one_core": 12.194346867010967
|
||||
},
|
||||
{
|
||||
"sample_count": 905,
|
||||
"sampled_baseline_bytes": 80728064,
|
||||
"sampled_peak_bytes": 124407808,
|
||||
"cgroup_lifetime_peak_bytes": 141295616,
|
||||
"elapsed_seconds": 20.01476109199939,
|
||||
"cpu_usage_seconds": 2.514936,
|
||||
"container": "30fcbabd1e8c",
|
||||
"average_cpu_percent_one_core": 12.565406044268544
|
||||
}
|
||||
],
|
||||
"requests_detail": [
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.8693261250155047,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.4904946660099085,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.4210281249834225,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.266302750009345,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.7139787090127356,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.743270292005036,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.6961546249804087,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.9460117089911364,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.0907350000052247,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.2004604999965522,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
}
|
||||
],
|
||||
"limitations": "One local closed-loop batch; client overhead; no capacity claim. cgroup memory.current sampled every 20ms includes decoder and tmpfs/page cache; may miss shorter peaks. memory.peak is lifetime, includes earlier work. CPU averaged over 20s sampling window includes idle time. Per-API peaks need not be simultaneous.",
|
||||
"docker_host": "aarch64 CPUs=8 RAM=8218316800"
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"utc": "2026-11-06T14:53:56Z",
|
||||
"concurrency": 10,
|
||||
"requests": 10,
|
||||
"original_bytes": 7684008,
|
||||
"dimensions": [
|
||||
1600,
|
||||
1600
|
||||
],
|
||||
"successful_requests": 10,
|
||||
"failed_requests": 0,
|
||||
"elapsed_seconds": 1.785140791995218,
|
||||
"successful_rps": 5.601799054080877,
|
||||
"latency_success_seconds": {
|
||||
"p50": 1.0907350000052247,
|
||||
"p95": 1.743270292005036,
|
||||
"p99": 1.743270292005036
|
||||
},
|
||||
"api_cgroups": [
|
||||
{
|
||||
"sample_count": 907,
|
||||
"sampled_baseline_bytes": 80306176,
|
||||
"sampled_peak_bytes": 112791552,
|
||||
"cgroup_lifetime_peak_bytes": 138301440,
|
||||
"elapsed_seconds": 20.002547300000515,
|
||||
"cpu_usage_seconds": 2.43918,
|
||||
"container": "050e1dff86f8",
|
||||
"average_cpu_percent_one_core": 12.194346867010967
|
||||
},
|
||||
{
|
||||
"sample_count": 905,
|
||||
"sampled_baseline_bytes": 80728064,
|
||||
"sampled_peak_bytes": 124407808,
|
||||
"cgroup_lifetime_peak_bytes": 141295616,
|
||||
"elapsed_seconds": 20.01476109199939,
|
||||
"cpu_usage_seconds": 2.514936,
|
||||
"container": "30fcbabd1e8c",
|
||||
"average_cpu_percent_one_core": 12.565406044268544
|
||||
}
|
||||
],
|
||||
"requests_detail": [
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.8693261250155047,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.4904946660099085,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.4210281249834225,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.266302750009345,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.7139787090127356,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.743270292005036,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.6961546249804087,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 0.9460117089911364,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.0907350000052247,
|
||||
"instance": "03ea9548-3579-43c3-83fa-8fa742019ed7"
|
||||
},
|
||||
{
|
||||
"ok": true,
|
||||
"seconds": 1.2004604999965522,
|
||||
"instance": "807def1e-c2d4-4555-896c-68b5796f7c8f"
|
||||
}
|
||||
],
|
||||
"limitations": "One local closed-loop batch; client overhead; no capacity claim. cgroup memory.current sampled every 20ms includes decoder and tmpfs/page cache; may miss shorter peaks. memory.peak is lifetime, includes earlier work. CPU averaged over 20s sampling window includes idle time. Per-API peaks need not be simultaneous.",
|
||||
"docker_host": "aarch64 CPUs=8 RAM=8218316800"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
@@ -0,0 +1,164 @@
|
||||
[
|
||||
{
|
||||
"check": "check",
|
||||
"command": [
|
||||
"make",
|
||||
"check"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 0.074
|
||||
},
|
||||
{
|
||||
"check": "validate",
|
||||
"command": [
|
||||
"make",
|
||||
"validate",
|
||||
"PYTHON=.venv/bin/python"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 0.546
|
||||
},
|
||||
{
|
||||
"check": "image-pull",
|
||||
"command": [
|
||||
"docker",
|
||||
"pull",
|
||||
"bitnamilegacy/minio:2025.7.23-debian-12-r5@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 17.858
|
||||
},
|
||||
{
|
||||
"check": "compose-config",
|
||||
"command": [
|
||||
"docker",
|
||||
"compose",
|
||||
"--env-file",
|
||||
".env",
|
||||
"config",
|
||||
"--quiet"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 0.092
|
||||
},
|
||||
{
|
||||
"check": "build",
|
||||
"command": [
|
||||
"docker",
|
||||
"compose",
|
||||
"--env-file",
|
||||
".env",
|
||||
"up",
|
||||
"-d",
|
||||
"--build"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 19.796
|
||||
},
|
||||
{
|
||||
"check": "smoke",
|
||||
"command": [
|
||||
"make",
|
||||
"test",
|
||||
"BASE_URL=http://localhost:8084"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 1.332
|
||||
},
|
||||
{
|
||||
"check": "persistence",
|
||||
"command": [
|
||||
"make",
|
||||
"test-persistence",
|
||||
"BASE_URL=http://localhost:8084",
|
||||
"ACTION_SCRIPT=scripts/restart.sh"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 11.799
|
||||
},
|
||||
{
|
||||
"check": "failover",
|
||||
"command": [
|
||||
"make",
|
||||
"test-failover",
|
||||
"BASE_URL=http://localhost:8084",
|
||||
"ACTION_SCRIPT=scripts/stop-one.sh"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 16.266
|
||||
},
|
||||
{
|
||||
"check": "restore-after-failover",
|
||||
"command": [
|
||||
"docker",
|
||||
"compose",
|
||||
"--env-file",
|
||||
".env",
|
||||
"start",
|
||||
"api"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 1.842
|
||||
},
|
||||
{
|
||||
"check": "negative",
|
||||
"command": [
|
||||
"/opt/homebrew/opt/python@3.13/bin/python3.13",
|
||||
"student-tests/negative.py"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 3.637
|
||||
},
|
||||
{
|
||||
"check": "faults",
|
||||
"command": [
|
||||
"/opt/homebrew/opt/python@3.13/bin/python3.13",
|
||||
"student-tests/faults.py"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 24.98
|
||||
},
|
||||
{
|
||||
"check": "attachment-failover",
|
||||
"command": [
|
||||
"/opt/homebrew/opt/python@3.13/bin/python3.13",
|
||||
"student-tests/attachment-failover.py"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 19.642
|
||||
},
|
||||
{
|
||||
"check": "upload-load",
|
||||
"command": [
|
||||
"/opt/homebrew/opt/python@3.13/bin/python3.13",
|
||||
"student-tests/upload-load.py"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 21.236
|
||||
},
|
||||
{
|
||||
"check": "cleanup",
|
||||
"command": [
|
||||
"scripts/cleanup.sh"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 1.036
|
||||
},
|
||||
{
|
||||
"check": "cleanup-repeat",
|
||||
"command": [
|
||||
"scripts/cleanup.sh"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 0.838
|
||||
},
|
||||
{
|
||||
"check": "storage-audit",
|
||||
"command": [
|
||||
"/opt/homebrew/opt/python@3.13/bin/python3.13",
|
||||
"student-tests/audit-storage.py"
|
||||
],
|
||||
"exit_code": 0,
|
||||
"seconds": 1.368
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user