-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable multiple workers to improve perf (#75)
* Add fast bm25 * Update * Fix bug * Fix bm25 bug * Fix bug * Refine code * Update multi-process * Add API to support upload local files (#67) * support upload file via API * add Readme for upload API * refactor query api * modify load_knowledge with session_config * use tempfile.mkdtemp() to store upload files * add docker image timezone for China (#68) * add image zone for China * remove unused ENV --------- Co-authored-by: shubao.sx <shubao.sx@alibaba-inc.com> Co-authored-by: Yue Fei <luxun.fy@alibaba-inc.com> * load data pipeline supports read config (#70) * Add gpu docker image timezone for China (#74) * Add fast bm25 (#66) * Add fast bm25 * Fix bm25 bug * Fix bug * Fix test * Update dockerfile * Fix bug * Update * Update docker file * Fix empty file bug * Fix local index error * Fix lint * Decouple gradio and backend * Add ui build * Add gunicorn * Fix gunicorn * Update nginx * add nginx image * Fix deployment issue * Fix upload --------- Co-authored-by: 筱文 <zxw320697@alibaba-inc.com> Co-authored-by: paradiseHIT <paradiseHIT@gmail.com> Co-authored-by: shubao.sx <shubao.sx@alibaba-inc.com>
- Loading branch information
1 parent
7c2467e
commit 9e68ac6
Showing
37 changed files
with
2,140 additions
and
602 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,3 +222,4 @@ output | |
*.local.toml | ||
|
||
localdata/ | ||
*.tmp |
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,3 @@ | ||
FROM nginx:latest | ||
COPY ./nginx/default.conf etc/nginx/conf.d/default.conf | ||
COPY ./nginx/nginx.conf etc/nginx/nginx.conf |
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,27 @@ | ||
FROM python:3.10-slim AS builder | ||
|
||
RUN pip3 install poetry | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN poetry install && rm -rf $POETRY_CACHE_DIR | ||
|
||
FROM python:3.10-slim AS prod | ||
|
||
RUN rm -rf /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Harbin /etc/localtime | ||
|
||
ENV VIRTUAL_ENV=/app/.venv \ | ||
PATH="/app/.venv/bin:$PATH" | ||
|
||
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 | ||
|
||
WORKDIR /app | ||
COPY . . | ||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
CMD ["pai_rag", "ui"] |
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,67 @@ | ||
|
||
server { | ||
listen 8000; | ||
listen [::]:8000; | ||
server_name localhost; | ||
client_max_body_size 50m; | ||
|
||
#access_log /var/log/nginx/host.access.log main; | ||
|
||
location / { | ||
proxy_set_header Host \$host; | ||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; | ||
proxy_pass http://127.0.0.1:8002; | ||
} | ||
|
||
#Websocket configuration | ||
location /queue/ { | ||
proxy_pass http://127.0.0.1:8002/queue/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
|
||
location /service { | ||
proxy_set_header Host \$host; | ||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; | ||
proxy_pass http://127.0.0.1:8001; | ||
} | ||
|
||
location /docs { | ||
proxy_set_header Host \$host; | ||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; | ||
proxy_pass http://127.0.0.1:8001; | ||
} | ||
|
||
#error_page 404 /404.html; | ||
|
||
# redirect server error pages to the static page /50x.html | ||
# | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 | ||
# | ||
#location ~ \.php$ { | ||
# proxy_pass http://127.0.0.1; | ||
#} | ||
|
||
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | ||
# | ||
#location ~ \.php$ { | ||
# root html; | ||
# fastcgi_pass 127.0.0.1:9000; | ||
# fastcgi_index index.php; | ||
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; | ||
# include fastcgi_params; | ||
#} | ||
|
||
# deny access to .htaccess files, if Apache's document root | ||
# concurs with nginx's one | ||
# | ||
#location ~ /\.ht { | ||
# deny all; | ||
#} | ||
} |
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,33 @@ | ||
|
||
user nginx; | ||
daemon off; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
Oops, something went wrong.