-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(
deployment
): add launch for all deployments
- Loading branch information
1 parent
20570e5
commit 082eb7d
Showing
8 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/pixel_battle/deployment/chunk_reading_service/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import uvicorn | ||
|
||
from pixel_battle.deployment.chunk_reading_service.asgi import app | ||
|
||
|
||
def main() -> None: | ||
uvicorn.run(app) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from pixel_battle.deployment.chunk_reading_service.di import ( | ||
chunk_reading_service_container, | ||
) | ||
from pixel_battle.deployment.common.asgi import ASGIApp, LazyASGIApp | ||
from pixel_battle.presentation.web.app import app_from | ||
|
||
|
||
async def app_factory() -> ASGIApp: | ||
return await app_from(chunk_reading_service_container) | ||
|
||
|
||
app = LazyASGIApp(factory=app_factory) |
23 changes: 23 additions & 0 deletions
23
src/pixel_battle/deployment/chunk_stream_compression_coordination_service/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import asyncio | ||
|
||
from pixel_battle.deployment.chunk_stream_compression_coordination_service.di import ( # noqa: E501 | ||
chunk_stream_compression_coordination_service_container, | ||
) | ||
from pixel_battle.presentation.distributed_tasks.update_chunk_view import ( | ||
UpdateChunkViewTask, | ||
) | ||
|
||
|
||
async def main() -> None: | ||
task = await chunk_stream_compression_coordination_service_container.get( | ||
UpdateChunkViewTask | ||
) | ||
|
||
try: | ||
await task.start_pushing() | ||
finally: | ||
await chunk_stream_compression_coordination_service_container.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(main()) |
23 changes: 23 additions & 0 deletions
23
src/pixel_battle/deployment/chunk_stream_compression_service/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import asyncio | ||
|
||
from pixel_battle.deployment.chunk_stream_compression_service.di import ( | ||
chunk_stream_compression_service_container, | ||
) | ||
from pixel_battle.presentation.distributed_tasks.update_chunk_view import ( | ||
UpdateChunkViewTask, | ||
) | ||
|
||
|
||
async def main() -> None: | ||
task = await chunk_stream_compression_service_container.get( | ||
UpdateChunkViewTask | ||
) | ||
|
||
try: | ||
await task.start_pulling() | ||
finally: | ||
await chunk_stream_compression_service_container.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(main()) |
11 changes: 11 additions & 0 deletions
11
src/pixel_battle/deployment/chunk_streaming_service/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import uvicorn | ||
|
||
from pixel_battle.deployment.chunk_streaming_service.asgi import app | ||
|
||
|
||
def main() -> None: | ||
uvicorn.run(app) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
12 changes: 12 additions & 0 deletions
12
src/pixel_battle/deployment/chunk_streaming_service/asgi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from pixel_battle.deployment.chunk_streaming_service.di import ( | ||
chunk_streaming_service_container, | ||
) | ||
from pixel_battle.deployment.common.asgi import ASGIApp, LazyASGIApp | ||
from pixel_battle.presentation.web.app import app_from | ||
|
||
|
||
async def app_factory() -> ASGIApp: | ||
return await app_from(chunk_streaming_service_container) | ||
|
||
|
||
app = LazyASGIApp(factory=app_factory) |
11 changes: 11 additions & 0 deletions
11
src/pixel_battle/deployment/chunk_writing_service/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import uvicorn | ||
|
||
from pixel_battle.deployment.chunk_writing_service.asgi import app | ||
|
||
|
||
def main() -> None: | ||
uvicorn.run(app) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from pixel_battle.deployment.chunk_writing_service.di import ( | ||
chunk_writing_service_container, | ||
) | ||
from pixel_battle.deployment.common.asgi import ASGIApp, LazyASGIApp | ||
from pixel_battle.presentation.web.app import app_from | ||
|
||
|
||
async def app_factory() -> ASGIApp: | ||
return await app_from(chunk_writing_service_container) | ||
|
||
|
||
app = LazyASGIApp(factory=app_factory) |