Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ram in prod #280

Merged
merged 2 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions infra/charts/datasets-server/env/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ reverseProxy:
resources:
requests:
cpu: 1
memory: "256Mi"
limits:
cpu: 1
memory: "256Mi"

api:
replicas: 2
Expand All @@ -65,8 +67,10 @@ api:
resources:
requests:
cpu: 1
memory: "256Mi"
limits:
cpu: 1
memory: "256Mi"

datasetsWorker:
replicas: 3
Expand Down
26 changes: 5 additions & 21 deletions services/api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ huggingface-hub = "^0.5.1"
libcache = { path = "../../libs/libcache", develop = true }
libqueue = { path = "../../libs/libqueue", develop = true }
libutils = { path = "../../libs/libutils", develop = true }
prometheus-client = "^0.14.1"
python = "3.9.6"
python-dotenv = "^0.20.0"
starlette = "^0.16.0"
starlette-prometheus = "^0.9.0"
uvicorn = "^0.14.0"
watchdog = { extras = ["watchmedo"], version = "^2.1.3" }

Expand Down
3 changes: 1 addition & 2 deletions services/api/src/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from starlette.middleware.gzip import GZipMiddleware
from starlette.routing import Mount, Route
from starlette.staticfiles import StaticFiles
from starlette_prometheus import PrometheusMiddleware

from api.config import (
APP_HOSTNAME,
Expand Down Expand Up @@ -45,7 +44,7 @@ def create_app() -> Starlette:
show_assets_dir(ASSETS_DIRECTORY)
prometheus = Prometheus()

middleware = [Middleware(GZipMiddleware), Middleware(PrometheusMiddleware, filter_unhandled_paths=True)]
middleware = [Middleware(GZipMiddleware)]
routes = [
Mount("/assets", app=StaticFiles(directory=init_assets_dir(ASSETS_DIRECTORY), check_dir=True), name="assets"),
Route("/cache-reports", endpoint=cache_reports_endpoint),
Expand Down