Skip to content

Commit

Permalink
Merge pull request #95 from DNO-inc/bodya
Browse files Browse the repository at this point in the history
burrito-cluster & version 0.6.0
  • Loading branch information
m-o-d-e-r authored Jul 15, 2023
2 parents 85273ce + e37db88 commit b01f28e
Show file tree
Hide file tree
Showing 28 changed files with 636 additions and 205 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ rmi:

db_conn:
scripts/connect_to_db.sh

check_burrito_cluster:
$(PYTHON) scripts/check_burrito_cluster.py
2 changes: 1 addition & 1 deletion burrito/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.7 indev"
__version__ = "0.6.0 indev"
4 changes: 2 additions & 2 deletions burrito/apps/about/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /opt/pysetup

RUN pip3 install poetry

COPY ./pyproject.toml ./
COPY pyproject.toml ./

RUN poetry install --only main

Expand All @@ -28,4 +28,4 @@ COPY ./burrito /burrito

WORKDIR ./

CMD ["python", "burrito/apps/about"]
CMD ["python", "-m", "burrito.apps.about"]
34 changes: 33 additions & 1 deletion burrito/apps/about/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
import uvicorn
from random import randint
from fastapi.routing import APIRoute

from burrito.utils.config_reader import get_config
from burrito.containers import prepare_app
from burrito.utils.app_util import get_current_app, connect_app


if prepare_app():
from burrito.apps.about.router import about_router
else:
print("App preparation failed")


app = get_current_app(docs_url="/about/docs", openapi_url="/about/openapi.json")
connect_app(app, "/about", about_router)


# TODO: temporary function, should be deleted in soon
def use_route_names_as_operation_ids(app) -> None:
for route in app.routes:
if isinstance(route, APIRoute):
route.operation_id = route.name + str(randint(0, 1000)) # TODO: delete this fuc


use_route_names_as_operation_ids(app)


prepare_app()
if __name__ == "__main__":
uvicorn.run(
"burrito.apps.about.__main__:app",
host="0.0.0.0",
port=int(get_config().BURRITO_PORT_ABOUT),
proxy_headers=bool(get_config().BURRITO_PROXY_HEADERS)
)
4 changes: 2 additions & 2 deletions burrito/apps/admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /opt/pysetup

RUN pip3 install poetry

COPY ./pyproject.toml ./
COPY pyproject.toml ./

RUN poetry install --only main

Expand All @@ -28,4 +28,4 @@ COPY ./burrito /burrito

WORKDIR ./

CMD ["python", "burrito/apps/admin"]
CMD ["python", "-m", "burrito.apps.admin"]
34 changes: 33 additions & 1 deletion burrito/apps/admin/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
import uvicorn
from random import randint
from fastapi.routing import APIRoute

from burrito.utils.config_reader import get_config
from burrito.containers import prepare_app
from burrito.utils.app_util import get_current_app, connect_app


if prepare_app():
from burrito.apps.admin.router import admin_router
else:
print("App preparation failed")


app = get_current_app(docs_url="/admin/docs", openapi_url="/admin/openapi.json")
connect_app(app, "/admin", admin_router)


# TODO: temporary function, should be deleted in soon
def use_route_names_as_operation_ids(app) -> None:
for route in app.routes:
if isinstance(route, APIRoute):
route.operation_id = route.name + str(randint(0, 1000)) # TODO: delete this fuc


use_route_names_as_operation_ids(app)


prepare_app()
if __name__ == "__main__":
uvicorn.run(
"burrito.apps.admin.__main__:app",
host="0.0.0.0",
port=int(get_config().BURRITO_PORT_ADMIN),
proxy_headers=bool(get_config().BURRITO_PROXY_HEADERS)
)
4 changes: 2 additions & 2 deletions burrito/apps/anon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /opt/pysetup

RUN pip3 install poetry

COPY ./pyproject.toml ./
COPY pyproject.toml ./

RUN poetry install --only main

Expand All @@ -28,4 +28,4 @@ COPY ./burrito /burrito

WORKDIR ./

CMD ["python", "burrito/apps/anon"]
CMD ["python", "-m", "burrito.apps.anon"]
34 changes: 33 additions & 1 deletion burrito/apps/anon/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
import uvicorn
from random import randint
from fastapi.routing import APIRoute

from burrito.utils.config_reader import get_config
from burrito.containers import prepare_app
from burrito.utils.app_util import get_current_app, connect_app


if prepare_app():
from burrito.apps.anon.router import anon_router
else:
print("App preparation failed")


app = get_current_app(docs_url="/anon/docs", openapi_url="/anon/openapi.json")
connect_app(app, "/anon", anon_router)


# TODO: temporary function, should be deleted in soon
def use_route_names_as_operation_ids(app) -> None:
for route in app.routes:
if isinstance(route, APIRoute):
route.operation_id = route.name + str(randint(0, 1000)) # TODO: delete this fuc


use_route_names_as_operation_ids(app)


prepare_app()
if __name__ == "__main__":
uvicorn.run(
"burrito.apps.anon.__main__:app",
host="0.0.0.0",
port=int(get_config().BURRITO_PORT_ANON),
proxy_headers=bool(get_config().BURRITO_PROXY_HEADERS)
)
4 changes: 2 additions & 2 deletions burrito/apps/auth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /opt/pysetup

RUN pip3 install poetry

COPY ./pyproject.toml ./
COPY pyproject.toml ./

RUN poetry install --only main

Expand All @@ -28,4 +28,4 @@ COPY ./burrito /burrito

WORKDIR ./

CMD ["python", "burrito/apps/auth"]
CMD ["python", "-m", "burrito.apps.auth"]
34 changes: 33 additions & 1 deletion burrito/apps/auth/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
import uvicorn
from random import randint
from fastapi.routing import APIRoute

from burrito.utils.config_reader import get_config
from burrito.containers import prepare_app
from burrito.utils.app_util import get_current_app, connect_app


if prepare_app():
from burrito.apps.auth.router import auth_router
else:
print("App preparation failed")


app = get_current_app(docs_url="/auth/docs", openapi_url="/auth/openapi.json")
connect_app(app, "/auth", auth_router)


# TODO: temporary function, should be deleted in soon
def use_route_names_as_operation_ids(app) -> None:
for route in app.routes:
if isinstance(route, APIRoute):
route.operation_id = route.name + str(randint(0, 1000)) # TODO: delete this fuc


use_route_names_as_operation_ids(app)


prepare_app()
if __name__ == "__main__":
uvicorn.run(
"burrito.apps.auth.__main__:app",
host="0.0.0.0",
port=int(get_config().BURRITO_PORT_AUTH),
proxy_headers=bool(get_config().BURRITO_PROXY_HEADERS)
)
4 changes: 2 additions & 2 deletions burrito/apps/comments/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /opt/pysetup

RUN pip3 install poetry

COPY ./pyproject.toml ./
COPY pyproject.toml ./

RUN poetry install --only main

Expand All @@ -28,4 +28,4 @@ COPY ./burrito /burrito

WORKDIR ./

CMD ["python", "burrito/apps/comments"]
CMD ["python", "-m", "burrito.apps.comments"]
34 changes: 33 additions & 1 deletion burrito/apps/comments/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
import uvicorn
from random import randint
from fastapi.routing import APIRoute

from burrito.utils.config_reader import get_config
from burrito.containers import prepare_app
from burrito.utils.app_util import get_current_app, connect_app


if prepare_app():
from burrito.apps.comments.router import comments_router
else:
print("App preparation failed")


app = get_current_app(docs_url="/comments/docs", openapi_url="/comments/openapi.json")
connect_app(app, "/comments", comments_router)


# TODO: temporary function, should be deleted in soon
def use_route_names_as_operation_ids(app) -> None:
for route in app.routes:
if isinstance(route, APIRoute):
route.operation_id = route.name + str(randint(0, 1000)) # TODO: delete this fuc


use_route_names_as_operation_ids(app)


prepare_app()
if __name__ == "__main__":
uvicorn.run(
"burrito.apps.comments.__main__:app",
host="0.0.0.0",
port=int(get_config().BURRITO_PORT_COMMENTS),
proxy_headers=bool(get_config().BURRITO_PROXY_HEADERS)
)
4 changes: 2 additions & 2 deletions burrito/apps/iofiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /opt/pysetup

RUN pip3 install poetry

COPY ./pyproject.toml ./
COPY pyproject.toml ./

RUN poetry install --only main

Expand All @@ -28,4 +28,4 @@ COPY ./burrito /burrito

WORKDIR ./

CMD ["python", "burrito/apps/iofiles"]
CMD ["python", "-m", "burrito.apps.iofiles"]
34 changes: 33 additions & 1 deletion burrito/apps/iofiles/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
import uvicorn
from random import randint
from fastapi.routing import APIRoute

from burrito.utils.config_reader import get_config
from burrito.containers import prepare_app
from burrito.utils.app_util import get_current_app, connect_app


if prepare_app():
from burrito.apps.iofiles.router import iofiles_router
else:
print("App preparation failed")


app = get_current_app(docs_url="/iofiles/docs", openapi_url="/iofiles/openapi.json")
connect_app(app, "/iofiles", iofiles_router)


# TODO: temporary function, should be deleted in soon
def use_route_names_as_operation_ids(app) -> None:
for route in app.routes:
if isinstance(route, APIRoute):
route.operation_id = route.name + str(randint(0, 1000)) # TODO: delete this fuc


use_route_names_as_operation_ids(app)


prepare_app()
if __name__ == "__main__":
uvicorn.run(
"burrito.apps.iofiles.__main__:app",
host="0.0.0.0",
port=int(get_config().BURRITO_PORT_IOFILES),
proxy_headers=bool(get_config().BURRITO_PROXY_HEADERS)
)
10 changes: 5 additions & 5 deletions burrito/apps/iofiles/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

iofiles_router = APIRouter()

iofiles_router.add_api_route(
"/upload_file",
iofiles__upload_file_for_ticket,
methods=["POST"]
)
#iofiles_router.add_api_route(
# "/upload_file",
# iofiles__upload_file_for_ticket,
# methods=["POST"]
#)
10 changes: 0 additions & 10 deletions burrito/apps/meta/.dockerignore

This file was deleted.

Loading

0 comments on commit b01f28e

Please sign in to comment.