forked from mtusi2026/mtusi2026lab4
Run RustFS with a private bucket in the stand
MinIO community images can no longer be pulled on this arm64 host, so the stand runs RustFS 1.0.4 pinned by digest as non-root with a read only root, no published port, the console off and data on the s3data volume. A one-off s3-init with rc v0.1.36 creates the bucket, keeps it private for anonymous clients, creates the API user with a policy on the objects and listing of that one bucket, imports a lifecycle rule for incomplete multipart uploads and checks itself; the API replicas start only after it succeeded. Root keys reach only s3, s3-init and the operator s3-cli; the API gets its own key and the S3 settings through an anchor merged into its environment. secrets.sh creates hex S3 keys, the restart hook restarts S3 next to PostgreSQL and Valkey and waits until it is healthy, the limits policy covers the S3 services, and the stack evidence lists the new packages. The object storage adapter is tested against a throwaway RustFS of the same image: a 10 MiB round trip, a missing object, an idempotent delete and an unreachable endpoint failing within the request budget. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f9760fc098
commit
5aa766acff
+27
-3
@@ -7,10 +7,17 @@ import time
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
S3_CLIENT_SECRETS = ["s3_access_key_id", "s3_root_password", "s3_root_user", "s3_secret_access_key"]
|
||||
POLICY = {
|
||||
"lb": {"secrets": [], "volumes": [], "networks": ["backend", "edge"], "ports": True},
|
||||
"api": {
|
||||
"secrets": ["cache_url", "cursor_secret", "database_url"],
|
||||
"secrets": [
|
||||
"cache_url",
|
||||
"cursor_secret",
|
||||
"database_url",
|
||||
"s3_access_key_id",
|
||||
"s3_secret_access_key",
|
||||
],
|
||||
"volumes": [],
|
||||
"networks": ["backend"],
|
||||
},
|
||||
@@ -18,6 +25,13 @@ POLICY = {
|
||||
"postgres": {"secrets": ["postgres_password"], "volumes": ["pgdata"], "networks": ["backend"]},
|
||||
"valkey": {"secrets": ["valkey.conf"], "volumes": ["valkeydata"], "networks": ["backend"]},
|
||||
"k6": {"secrets": [], "volumes": [], "networks": ["edge"]},
|
||||
"s3": {
|
||||
"secrets": ["s3_root_password", "s3_root_user"],
|
||||
"volumes": ["s3data"],
|
||||
"networks": ["backend"],
|
||||
},
|
||||
"s3-init": {"secrets": S3_CLIENT_SECRETS, "volumes": [], "networks": ["backend"]},
|
||||
"s3-cli": {"secrets": S3_CLIENT_SECRETS, "volumes": [], "networks": ["backend"]},
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +113,17 @@ def main():
|
||||
parser.add_argument("--out", help="text report, written only after a complete check")
|
||||
args = parser.parse_args()
|
||||
problems = []
|
||||
_, raw = run("docker", "compose", "--profile", "bench", "config", "--format", "json")
|
||||
_, raw = run(
|
||||
"docker",
|
||||
"compose",
|
||||
"--profile",
|
||||
"bench",
|
||||
"--profile",
|
||||
"tools",
|
||||
"config",
|
||||
"--format",
|
||||
"json",
|
||||
)
|
||||
config = json.loads(raw)
|
||||
services = [
|
||||
declared(name, service, config.get("networks", {}), problems)
|
||||
@@ -110,7 +134,7 @@ def main():
|
||||
problems.append("no running api replicas to inspect")
|
||||
lines = [
|
||||
f"date: {time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())}",
|
||||
"$ docker compose --profile bench config --format json (declared)",
|
||||
"$ docker compose --profile bench --profile tools config --format json (declared)",
|
||||
*table(["service", "cpus/mem", "ports", "secrets", "volumes", "networks", "ro"], services),
|
||||
"",
|
||||
"$ docker inspect (running containers: hostname = X-Instance-Id, applied limits)",
|
||||
|
||||
Reference in New Issue
Block a user