forked from mtusi2026/mtusi2026lab6
Carry over the lab 5 solution
Bring the application, own tests, Dockerfile, toolchain, compose stack, HAProxy, k6, RustFS and RabbitMQ configuration, migrations, hooks, scenario scripts and the CI job from the lab 5 solution commit 64d5c67, keep the lab 5 Makefile targets on top of the unchanged skeleton targets, and append the lab 5 solution variables to the skeleton .env.example. The package and the application follow the contract version 1.6.0, and the image, the throwaway test containers and the broker vhost description are tagged lab6 so they do not collide with a lab 5 stand on the same host. This is the starting point of the lab 6 cycle: lint, own tests and the offline skeleton check pass before any lab 6 change. 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
a0d3947710
commit
5ae3d77152
@@ -0,0 +1,37 @@
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
from dishka import make_async_container
|
||||
|
||||
from messenger.attachments.domain.jobs import ReplayResult
|
||||
from messenger.attachments.entrypoints.admin import rendered, run
|
||||
from messenger.attachments.entrypoints.ioc import AdminProvider
|
||||
from messenger.attachments.entrypoints.journal import LOG_FIELDS, subscribe_journal
|
||||
from messenger.shared.application.messagebus import EventBus
|
||||
from messenger.shared.config import PlatformSettings
|
||||
from messenger.shared.entrypoints.ioc import PlatformProvider
|
||||
from messenger.shared.infrastructure.logging import PLATFORM_FIELDS, StructlogLogger
|
||||
|
||||
|
||||
async def serve(argv: list[str]) -> int:
|
||||
platform = PlatformSettings()
|
||||
logger = StructlogLogger(level=platform.log_level, allowed_fields=PLATFORM_FIELDS | LOG_FIELDS)
|
||||
container = make_async_container(PlatformProvider(platform, logger), AdminProvider())
|
||||
bus = await container.get(EventBus)
|
||||
subscribe_journal(bus, logger)
|
||||
bus.start()
|
||||
try:
|
||||
report = await run(container, argv)
|
||||
finally:
|
||||
await bus.stop()
|
||||
await container.close()
|
||||
sys.stdout.write(rendered(report) + "\n")
|
||||
return int(report.get("result") == ReplayResult.NOT_FOUND)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
sys.exit(asyncio.run(serve(sys.argv[1:])))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user