Pass the upload limits to the API and check the console from the network
The API replicas get UPLOAD_CONCURRENCY, UPLOAD_GRACE_SECONDS, UPLOAD_SWEEP_INTERVAL_SECONDS and UPLOAD_SWEEP_BATCH through the S3 anchor of compose.yaml with the same defaults as the settings, and .env.example documents them. A value in the shell overrides the default, which the memory experiment uses to recreate the replicas with a different number of slots. s3-check.sh now also asks the console port of the S3 service from a separate container on the stand network and expects a refused connection, so 23 checks cover ports, the console inside and outside the container, the repeated bootstrap, the rights of the API key and anonymous access. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0e4eb1738c
commit
28055a8551
@@ -42,3 +42,9 @@ S3_CONNECT_TIMEOUT_SECONDS=1
|
||||
S3_READ_TIMEOUT_SECONDS=2
|
||||
IMAGE_CHECK_CONCURRENCY=2
|
||||
S3_MEMORY=512m
|
||||
# Solution-specific for lab4 grade 4: upload bodies buffered at once per worker, grace period
|
||||
# before an abandoned pending upload is swept, sweep interval and rows per sweep pass.
|
||||
UPLOAD_CONCURRENCY=3
|
||||
UPLOAD_GRACE_SECONDS=900
|
||||
UPLOAD_SWEEP_INTERVAL_SECONDS=30
|
||||
UPLOAD_SWEEP_BATCH=100
|
||||
|
||||
@@ -13,6 +13,10 @@ x-s3-env: &s3-env
|
||||
MAX_UPLOAD_BYTES: ${MAX_UPLOAD_BYTES:-10485760}
|
||||
MAX_IMAGE_PIXELS: ${MAX_IMAGE_PIXELS:-40000000}
|
||||
IMAGE_CHECK_CONCURRENCY: ${IMAGE_CHECK_CONCURRENCY:-2}
|
||||
UPLOAD_CONCURRENCY: ${UPLOAD_CONCURRENCY:-3}
|
||||
UPLOAD_GRACE_SECONDS: ${UPLOAD_GRACE_SECONDS:-900}
|
||||
UPLOAD_SWEEP_INTERVAL_SECONDS: ${UPLOAD_SWEEP_INTERVAL_SECONDS:-30}
|
||||
UPLOAD_SWEEP_BATCH: ${UPLOAD_SWEEP_BATCH:-100}
|
||||
|
||||
x-s3-client: &s3-client
|
||||
image: rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
## 3. Стенд
|
||||
|
||||
- [ ] 3.1 `compose.yaml` и `.env.example`: новые переменные зоны у `api`
|
||||
- [ ] 3.2 `scripts/s3-check.sh`: консоль из сети стенда
|
||||
- [ ] 3.3 Проверка группы: `docker compose config --quiet`, `make up`, `make test`
|
||||
- [x] 3.1 `compose.yaml` и `.env.example`: новые переменные зоны у `api`
|
||||
- [x] 3.2 `scripts/s3-check.sh`: консоль из сети стенда
|
||||
- [x] 3.3 Проверка группы: `docker compose config --quiet`, `make up`, `make test`
|
||||
|
||||
## 4. Проверки против стенда
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ if [ "$status" = 403 ]; then echo "PASS anonymous: прямой HTTP GET объ
|
||||
permission=$(rc bucket anonymous get "root/$b" --json | sed -n 's/.*"permission": *"\([a-z]*\)".*/\1/p')
|
||||
if [ "$permission" = private ]; then echo "PASS bucket: anonymous policy: $permission"; else echo "FAIL bucket: anonymous policy: $permission"; result=1; fi
|
||||
expect allow "api: DeleteObject" rc object remove --force "api/$b/$key"
|
||||
host=$(echo "$S3_ENDPOINT" | sed 's#^[a-z]*://##; s#:.*##')
|
||||
if wget -T 2 -O /dev/null "http://$host:9001/" >/tmp/out 2>&1; then echo "FAIL s3: консоль :9001 отвечает из сети стенда"; result=1
|
||||
elif grep -q refused /tmp/out; then echo "PASS s3: консоль :9001 из отдельного контейнера сети стенда: connection refused"
|
||||
else echo "FAIL s3: консоль :9001 из сети стенда: $(tail -n 1 /tmp/out)"; result=1; fi
|
||||
exit $result
|
||||
EOF
|
||||
echo "== IAM/bucket snapshot (без секретов)"
|
||||
|
||||
Reference in New Issue
Block a user