feat: add job outbox, relay, leases and image variants to the pipeline
Move publishing out of the upload path: a relay process publishes queued jobs with confirms. Add lease and attempt fencing, backoff with jitter, a per-job render process with CPU and memory limits, crop and optimized variants, the failed registry with audited replay, and staging cleanup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+15
-3
@@ -271,7 +271,13 @@ check_list_prefix() {
|
||||
# уборщику — чтение и удаление объектов своего bucket и их список только с
|
||||
# префиксом вложений своей базы (условие s3:prefix соблюдает SeaweedFS 4.48:
|
||||
# весь bucket, другой префикс и HEAD bucket — 403); без записи и прав на
|
||||
# bucket (design change track2-reconciler, решение 2)
|
||||
# bucket (design change track2-reconciler, решение 2). С change
|
||||
# pipeline-reliability (решение 9) — ещё префикс staging той же базы: выводится
|
||||
# из уже проверенного имени
|
||||
staging_list_prefix() {
|
||||
printf '%s/staging/' "${LIST_PREFIX%/attachments/}"
|
||||
}
|
||||
|
||||
put_cleaner_policy() {
|
||||
cat >"$WORK/policy.json" <<EOF
|
||||
{"Version": "2012-10-17", "Statement": [{"Effect": "Allow",
|
||||
@@ -279,7 +285,7 @@ put_cleaner_policy() {
|
||||
"Resource": ["arn:aws:s3:::${BUCKET}/*"]},
|
||||
{"Effect": "Allow", "Action": ["s3:ListBucket"],
|
||||
"Resource": ["arn:aws:s3:::${BUCKET}"],
|
||||
"Condition": {"StringLike": {"s3:prefix": ["${LIST_PREFIX}*"]}}}]}
|
||||
"Condition": {"StringLike": {"s3:prefix": ["${LIST_PREFIX}*", "$(staging_list_prefix)*"]}}}]}
|
||||
EOF
|
||||
ws_step "policy put ${CLEANER_POLICY}" \
|
||||
"s3.policy -put -name=${CLEANER_POLICY} -file=$WORK/policy.json"
|
||||
@@ -384,6 +390,8 @@ apply_checks() {
|
||||
# список своего префикса: политика доходит до шлюза подпиской, как ключ
|
||||
wait_key 200 "$CLEANER_CRED" "$(list_url "$LIST_PREFIX")" \
|
||||
|| fail "cleaner key list ${LIST_PREFIX} (code ${code})"
|
||||
wait_key 200 "$CLEANER_CRED" "$(list_url "$(staging_list_prefix)")" \
|
||||
|| fail "cleaner key list $(staging_list_prefix) (code ${code})"
|
||||
[ "$(cleaner_signed -X DELETE "$probe")" = 204 ] || fail "cleaner key delete"
|
||||
[ "$(signed "$probe")" = 404 ] || fail "object is still there after delete"
|
||||
worker_probe="${S3}/${BUCKET}/.s3-bootstrap/worker-check-$$"
|
||||
@@ -406,7 +414,7 @@ apply_checks() {
|
||||
[ "$(signed -X DELETE "$worker_probe")" = 204 ] \
|
||||
|| fail "api key delete worker probe"
|
||||
say "checks passed (api key put/get; cleaner key get/delete and list" \
|
||||
"${LIST_PREFIX}; worker key put/get; api key list and bucket create," \
|
||||
"${LIST_PREFIX} and $(staging_list_prefix); worker key put/get; api key list and bucket create," \
|
||||
"cleaner key put and list of the bucket, worker key delete, list and" \
|
||||
"bucket create, anonymous get and list denied)"
|
||||
}
|
||||
@@ -467,6 +475,10 @@ run_checks() {
|
||||
"$(cleaner_signed "${S3}/${BUCKET}?list-type=2")"
|
||||
check "cleaner key list attachments prefix" 200 \
|
||||
"$(cleaner_signed "$(list_url "$LIST_PREFIX")")"
|
||||
check "cleaner key list staging prefix" 200 \
|
||||
"$(cleaner_signed "$(list_url "$(staging_list_prefix)")")"
|
||||
check "cleaner key list database prefix" 403 \
|
||||
"$(cleaner_signed "$(list_url "${LIST_PREFIX%attachments/}")")"
|
||||
check "cleaner key list other prefix" 403 \
|
||||
"$(cleaner_signed "$(list_url .s3-check/)")"
|
||||
check "cleaner key create bucket" 403 \
|
||||
|
||||
Reference in New Issue
Block a user