-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/refactor: migrate to uvicorn-gunicorn
- Loading branch information
1 parent
56f7c6b
commit 6cae78a
Showing
21 changed files
with
448 additions
and
172 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
{ | ||
order rate_limit before basicauth | ||
} | ||
|
||
:{$APP_PORT} { | ||
handle_path /api/* { | ||
reverse_proxy http://localhost:{$SERVER_PORT} { | ||
transport http { | ||
versions h2c | ||
} | ||
rate_limit { | ||
zone dynamic_example { | ||
key {remote_host} | ||
events {$EVENTS_PER_WINDOW} | ||
window 60s | ||
} | ||
} | ||
|
||
handle_path /api/* { | ||
reverse_proxy http://localhost:{$SERVER_PORT} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
FROM ghcr.io/winstxnhdw/capgen:main | ||
|
||
ENV SERVER_PORT 5000 | ||
ENV APP_PORT 7860 | ||
|
||
ENV OMP_NUM_THREADS 4 | ||
ENV OMP_NUM_THREADS 8 | ||
ENV CT2_USE_EXPERIMENTAL_PACKED_GEMM 1 | ||
ENV CT2_FORCE_CPU_ISA AVX512 | ||
ENV EVENTS_PER_WINDOW 5 | ||
|
||
EXPOSE $APP_PORT |
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
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
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,13 @@ | ||
# pylint: skip-file | ||
|
||
from server import initialise | ||
from server.config import Config | ||
|
||
wsgi_app = f'{initialise.__module__}:{initialise.__name__}()' | ||
reload = False | ||
accesslog = '-' | ||
preload_app = True | ||
bind = f'0.0.0.0:{Config.server_port}' | ||
workers = Config.worker_count | ||
worker_class = 'uvicorn.workers.UvicornWorker' | ||
timeout = 300 |
Oops, something went wrong.