forked from mtusi2026/mtusi2026lab3
fix: update env and PR template
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
|
||||
from rolling_update import COMPOSE, ROOT, command
|
||||
from rolling_update import COMPOSE, ROOT, command, configured_replicas
|
||||
|
||||
|
||||
def main():
|
||||
@@ -29,7 +29,8 @@ def main():
|
||||
if service == "haproxy":
|
||||
assert "highload-lab3_data" not in networks
|
||||
if service == "api":
|
||||
assert not info["mounts"], "API must not mount persistent state"
|
||||
assert all(not mount["RW"] and mount["Type"] == "bind"
|
||||
for mount in info["mounts"]), "API mounts must be read-only configuration"
|
||||
records.append(
|
||||
{
|
||||
"service": service,
|
||||
@@ -40,14 +41,14 @@ def main():
|
||||
"public_ports": info["ports"],
|
||||
}
|
||||
)
|
||||
assert len([row for row in records if row["service"] == "api"]) == 2
|
||||
assert len([row for row in records if row["service"] == "api"]) == configured_replicas()
|
||||
ROOT.joinpath(".memory/grade4").mkdir(parents=True, exist_ok=True)
|
||||
ROOT.joinpath(".memory/grade4/resources.json").write_text(
|
||||
json.dumps(records, indent=2) + "\n"
|
||||
)
|
||||
print(json.dumps(records, indent=2))
|
||||
print(
|
||||
"PASS: effective CPU/RAM limits, two API replicas, private storage/API, isolated frontend"
|
||||
"PASS: effective CPU/RAM limits, configured API replicas, private storage/API, isolated frontend"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user