ЛР 3: балансировка, идемпотентность и failover — на 3

This commit is contained in:
2026-11-20 16:20:41 +03:00
parent 0ab3a341aa
commit be96c39563
31 changed files with 1490 additions and 21 deletions
+14
View File
@@ -0,0 +1,14 @@
FROM docker:27.5.1-cli
RUN apk add --no-cache python3 py3-pip make && python3 -m venv /opt/venv
ENV PATH=/opt/venv/bin:$PATH PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /workspace
COPY infra/requirements-tools.lock /tmp/requirements-tools.lock
RUN pip install --no-cache-dir -r /tmp/requirements-tools.lock
COPY Makefile lab.json compose.yaml README.md COURSE.md CONTRIBUTING.md REPORT.md ./
COPY contracts/ ./contracts/
COPY tests/ ./tests/
COPY scripts/check_contract.py scripts/validate_openapi.py ./scripts/
COPY --chmod=0755 scripts/restart.sh scripts/stop-one.sh ./scripts/
COPY student-tests/ ./student-tests/
ENTRYPOINT []
CMD ["make", "check"]
+29
View File
@@ -0,0 +1,29 @@
defaults
mode http
timeout http-request 5s
timeout connect 500ms
timeout client 15s
timeout server 10s
timeout check 1s
retries 1
retry-on conn-failure
option redispatch
resolvers docker
nameserver embedded 127.0.0.11:53
timeout resolve 500ms
timeout retry 500ms
hold valid 1s
hold nx 1s
frontend public_http
bind :8080
default_backend messenger
backend messenger
balance roundrobin
option httpchk GET /health/ready
http-check expect status 200
default-server check inter 1s fastinter 500ms downinter 1s fall 2 rise 1 resolvers docker init-addr none resolve-prefer ipv4
server api1 api1:8080
server api2 api2:8080
+19
View File
@@ -0,0 +1,19 @@
attrs==26.1.0
certifi==2026.10.23
charset-normalizer==3.5.2
idna==3.20
jsonschema==4.26.0
jsonschema-path==0.3.4
jsonschema-specifications==2025.9.1
lazy-object-proxy==1.13.0
openapi-schema-validator==0.6.3
openapi-spec-validator==0.7.2
pathable==0.4.4
PyYAML==6.0.3
referencing==0.36.2
requests==2.34.2
rfc3339-validator==0.1.4
rpds-py==2026.9.1
six==1.17.0
typing_extensions==4.16.0
urllib3==2.8.0