Skip to content

Commit

Permalink
v0.1.0-20240802 release (#140)
Browse files Browse the repository at this point in the history
* Bugfix: a case that files' encodings can not be detected by chardet (#61)

* Bugfix: connection error for longtime upload tasks (#62)

* Fix connection error for longtime job

* fix testcase bugs

* support num workers for embedding model

* Refactor query api and add dataframe UI

* Refactor query api

* Remove embedding workers

* Add file: file_utils.py (#63)

* Fix connection error for longtime job

* fix testcase bugs

* support num workers for embedding model

* Refactor query api and add dataframe UI

* Refactor query api

* Remove embedding workers

* Add file_utils

---------

Co-authored-by: Yue Fei <[email protected]>

* Remove local storage and enable Elasticsearch hybrid query mode (#60)

* Add gpu dockerfile

* Fix bug

* Fix gb2312

* Update embedding batch size

* Set default embedding and llm model

* Update docker tag

* Fix hologres check

* Update registry

* Fix bug

* Fix tests

* Add queue

* Update batch size

* Add async interface

* Fix index conflict

* Add change index parameter for FAISS

* Fix batch size

* Update

* Modify async upload to sync (#64)

* Modify async upload to sync

* fix failed test

* Fix faiss_path not effective in retrieval (#65)

* 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 <[email protected]>
Co-authored-by: Yue Fei <[email protected]>

* 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 readme and configuration (#77)

* fix demo.toml typo, and add comments for settings.toml for embedding

* update readme, add load data

* Update docker.yml

* 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 <[email protected]>
Co-authored-by: Yue Fei <[email protected]>

* 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: 筱文 <[email protected]>
Co-authored-by: paradiseHIT <[email protected]>
Co-authored-by: shubao.sx <[email protected]>

* Add guides for env and docker (#81)

* Add guides for env

* add guides for docker build

* Add README

* Add config guide cn&en (#82)

* add es setting

* add es setting

* add elasticsearch test

* add es test

* add and modify es_tokenizer test

* add and modify es_tokenizer test

* modify test_as_tokenizer

* add skipif

* fix test linter fails

* fix lint problem

* update test_as_analyzer

* add config_guide

* add navigation into readme

* Add doc reference for rag query (#84)

* Support evaluation for generated and open datasets (#83)

* Refactor evaluation module

* add UI: eval_tab

* support eval UI

* tmp eval

* remove eval web

* Support evaluation

* fix pytest

* Add OpenDataSet class

---------

Co-authored-by: ranxia <[email protected]>

* Fix oss url for miracl dataset (#86)

* fix ui es upload (#85)

* Fix eas LLM (#88)

* Milvus support sparse search (#87)

* Upload multiple files in single API call (#89)

* Milvus support sparse search

* aload fix

* Upload multiple files in one api call

* Remove notebooks

* Fix tests

* Fix http timeout issue

* Add client default timeout limitation and support UI interactive (#90)

* Add client default timeout limitation and support UI interactive

* support interactivate for vectordb type

* Fix ui issue (#91)

* Fix deps and add gpu ci tests (#92)

* Fix deps and add gpu ci tests

* Don't send report in 2nd pipeline

* Fix empty response for empty knowledge base (#93)

* Fix empty response for empty knowledge base

* Add constant for empty response message

* Fix dup nodes (#94)

* Add error handling (#96)

* Add error handling

* Add upload error msg

* fix data_loader (#95)

* fix data_loader

* fix data_loder

* fix data_loader

* fix data_loader

* Set proper log levels (#98)

* Adjust config instruction and add es instruction (#99)

* add es setting

* add es setting

* add elasticsearch test

* add es test

* add and modify es_tokenizer test

* add and modify es_tokenizer test

* modify test_as_tokenizer

* add skipif

* fix test linter fails

* fix lint problem

* update test_as_analyzer

* add config_guide

* add navigation into readme

* adjust config guide and add es instruction

* Log stacktrace for failed requests (#100)

* Load milvus collection by default (#101)

* Log stacktrace for failed requests

* Load milvus collection by default

* Rename & Relocate figures in md (#102)

* add es setting

* add es setting

* add elasticsearch test

* add es test

* add and modify es_tokenizer test

* add and modify es_tokenizer test

* modify test_as_tokenizer

* add skipif

* fix test linter fails

* fix lint problem

* update test_as_analyzer

* add config_guide

* add navigation into readme

* adjust config guide and add es instruction

* modify md figures

* minor modification

* change md path and name

* 针对windows平台修改docker启动命令 (#104)

* 针对windows平台修改docker启动命令

* 针对windows平台修改docker启动命令

* 针对windows平台修改docker启动命令

* make format

* make format, nothing changed

* download models from oss automatically (#97)

* download models from oss automatically

* download models from oss automatically

* download models from oss automatically

* download models from oss automatically

* download models from modelscope

* download models from modelscope

* fix readme

* Fix bug in downloading models (#106)

* Fix bug

* Fix log

* Fix download

* Add markdown reader (#105)

* fix pdf reader (#107)

Co-authored-by: Yue Fei <[email protected]>

* Personal/ranxia/pdf table summary fix (#109)

* fix pdf reader

* fix pdf reader table summary

---------

Co-authored-by: Yue Fei <[email protected]>

* FiAddage number to file_name (#110)

* Support stream response for LLM (PaiEAS && DashScope) (#112)

* Support stream response for LLM (PaiEAS && DashScope)

* Add PaiEas LLM old file

* Add image node processor (#114)

* Fit image in response

* Add image insert

* Fix llm max-token

* Fix bug (#115)

* Fix bugs for chinese escaped string in API header (#117)

* Fix bidi version (#119)

* Add fix version

* Update poetry.lock

* Update streaming response to body field use server sent events (#120)

* Fix streaming

* Fix llm and vector query

* Address comment

* Remove extra print

* Support simple-weighted-reranker and similarity-threshold (#116)

* Support nomalized cosine_sim score for different vectorDB

* Support simple-weighted-reranker and similarity-threshold

* [Todo] Support ES hybrid search

* Support Milvus

* fix path

* fix open dataset

* Fix url for du-retrieval dataset

* Restore setting

* Fix reviews

* Apply node_id for weighted_reranker

* jsonl reader (#124)

* jsonl reader

* jsonl reader

* Support function_calling with booking demo tools (#122)

* Add booking system demo for function_calling

* Support customized function calling tools

* Add testcase for agent and llm

* Fix test

* Fix async test

* Add readme for function calling

* Add readme for function calling

* Remove ref figs

* Add nodes enhancement by raptor (#111)

* add raptor

* add raptor ui support

* fix logger bug

* add node_enhancement class and modify test

* fix node_enhancement setting bug

* lint adjustment

* poetry lock

* fix poetry.lock

* fix poetry issues

* add a param

* add token calculation for Chinese and adjust context_window

* update tokenization_qwen

* update file_path

* merge feature and update poetry.lock

* exclude pytest since no vocab file in the test env

* exclude qwen.tiktoken

* delete assert

* Add weather tool (#125)

* weather okgit add .!

* fix bug

* space bug

---------

Co-authored-by: Yue Fei <[email protected]>

* Don't use parallel when data size is big (#108)

* Add opensearch (#127)

* Add open search. Not tested

* Fix

* Fix config

* update docker's readme (#126)

* update docker's readme

* change network back

* change network back

* change network back

* Create ci.yml (#131)

* Update CI & PR pipelines (#132)

* Update CI

* Fix ci

* Fix a few ui bugs (#133)

* Support RDS postgres vector store (#134)

* support rds postgers for store engine

* Format

* support table

* Make format

---------

Co-authored-by: Yue Fei <[email protected]>

* Fix minor bugs (#135)

* Fix bug

* Fix index bug

* Updaet password field

* Add pre-commit

* Remove upload button

* Refine upload

* Fix pg connection string

* Fix empty response for score_threshold (#136)

* Fix empty response for score_threshold

* Modify empty response info

* Modify empty response info

---------

Co-authored-by: Yue Fei <[email protected]>

* fix table_reader in pdf_reader (#128)

* fix table_reader in pdf_reader

* fix table_reader in pdf_reader

* fix table_reader in pdf_reader

* fix table_reader in pdf_reader

* fix table_reader in pdf_reader

* fix table_reader in pdf_reader

* add "enable_ocr" and "enable_table_summary" (#138)

* add "enable_ocr" and "enable_table_summary"

* add "enable_ocr" and "enable_table_summary"

* add "enable_ocr" and "enable_table_summary"

* Add release pipeline and fix some bugs (#137)

* Fix bug

* Add release pipeline

* Update

* Update

* Fix bug

* Fix login

* Fix empty tag

* Update

* Fix ui issue

* Add base version tag

* Fix specific version

* Use pg hybrid retrieval directly

* Fix image tag

* Fix llm config (#139)

* Fix toml merge bug (#142)

* Fix configuration conflict (#143)

* Fix merge bug

* Fix version conflict for config file

* Resolve snapshot merge conflict

* Fix space outage in github runner (#144)

* Fix merge bug

* Fix version conflict for config file

* Resolve snapshot merge conflict

* Update yaml

---------

Co-authored-by: Ceceliachenen <[email protected]>
Co-authored-by: wwxxzz <[email protected]>
Co-authored-by: paradiseHIT <[email protected]>
Co-authored-by: shubao.sx <[email protected]>
Co-authored-by: aero-xi <[email protected]>
Co-authored-by: ranxia <[email protected]>
Co-authored-by: aero-xi <[email protected]>
Co-authored-by: CharlieKoo <[email protected]>
Co-authored-by: zhangdingchu <[email protected]>
Co-authored-by: zt2645802240 <[email protected]>
  • Loading branch information
11 people authored Aug 5, 2024
1 parent a707e6d commit 2363ae5
Show file tree
Hide file tree
Showing 165 changed files with 168,947 additions and 3,019 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: PAI-RAG CI Build

on:
push:
# Sequence of patterns matched against refs/heads
branches:
- main
- feature
- "releases/**"

permissions:
contents: read
pull-requests: write

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
# This is the version of the action for setting up Python, not the Python version.
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: "3.10"
# Optional - x64 or x86 architecture, defaults to x64
architecture: "x64"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install poetry
poetry install
env:
POETRY_VIRTUALENVS_CREATE: false

- name: Install pre-commit
shell: bash
run: poetry run pip install pre-commit

- name: Run Linter
shell: bash
run: poetry run make lint

- name: Run Tests
run: |
make coveragetest
env:
DASHSCOPE_API_KEY: ${{ secrets.TESTDASHSCOPEKEY }}
IS_PAI_RAG_CI_TEST: true
PAIRAG_RAG__embedding__source: "DashScope"
PAIRAG_RAG__llm__source: "DashScope"
PAIRAG_RAG__llm__name: "qwen-turbo"
51 changes: 35 additions & 16 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#
name: Create and publish a Docker image
name: Publish Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
workflow_dispatch:
push:
branches: ["feature"]

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: registry.cn-beijing.aliyuncs.com
REGISTRY_HZ: registry.cn-hangzhou.aliyuncs.com

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
Expand All @@ -19,6 +18,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check disk space
run: df . -h

- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
- name: Extract version
run: |
pip install poetry
VERSION_TAG=$(poetry version --short)
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Login to ACR Beijing region
uses: docker/login-action@v1
Expand All @@ -27,27 +43,30 @@ jobs:
username: ${{ secrets.ACR_USER }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Login to ACR Hangzhou region
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY_HZ }}
username: ${{ secrets.ACR_USER }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Build and push base image
env:
IMAGE_TAG: 0.0.2
IMAGE_TAG: ${{env.VERSION_TAG}}
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG .
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG ${{ env.REGISTRY_HZ }}/mybigpai/pairag:$IMAGE_TAG
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
docker push ${{ env.REGISTRY_HZ }}/mybigpai/pairag:$IMAGE_TAG
- name: Build and push UI image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-ui
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG -f Dockerfile_ui .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
- name: Build and push nginx image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-nginx
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG -f Dockerfile_nginx .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
- name: Build and push GPU image
env:
IMAGE_TAG: 0.0.2_gpu
IMAGE_TAG: ${{env.VERSION_TAG}}-gpu
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG -f Dockerfile_gpu .
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG ${{ env.REGISTRY_HZ }}/mybigpai/pairag:$IMAGE_TAG
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
docker push ${{ env.REGISTRY_HZ }}/mybigpai/pairag:$IMAGE_TAG
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PAI-RAG CI
name: PR Build

on:
pull_request:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/main_gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PR Build (GPU)

on:
pull_request:
# Sequence of patterns matched against refs/heads
branches:
- main
- feature
- "releases/**"

permissions:
contents: read
pull-requests: write

jobs:
build:
name: Build and Test GPU version
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
# This is the version of the action for setting up Python, not the Python version.
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: "3.10"
# Optional - x64 or x86 architecture, defaults to x64
architecture: "x64"

- name: Install Dependencies
run: |
mv pyproject_gpu.toml pyproject.toml && rm poetry.lock
python -m pip install --upgrade pip setuptools wheel
pip install poetry
poetry install
env:
POETRY_VIRTUALENVS_CREATE: false

- name: Install pre-commit
shell: bash
run: poetry run pip install pre-commit

- name: Run Linter
shell: bash
run: poetry run make lint

- name: Run Tests
run: |
make coveragetest
env:
DASHSCOPE_API_KEY: ${{ secrets.TESTDASHSCOPEKEY }}
IS_PAI_RAG_CI_TEST: true
PAIRAG_RAG__embedding__source: "DashScope"
PAIRAG_RAG__llm__source: "DashScope"
PAIRAG_RAG__llm__name: "qwen-turbo"
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
workflow_dispatch:
push:
branches: ["main", "release_test"]

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: mybigpai-public-registry.cn-beijing.cr.aliyuncs.com

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Check disk space
run: df . -h

- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
- name: Extract version
run: |
pip install poetry
VERSION_TAG=$(poetry version --short)
SPECIFIC_VERSION_TAG="$VERSION_TAG-$(date +'%Y%m%d')"
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
echo "SPECIFIC_VERSION_TAG=$SPECIFIC_VERSION_TAG" >> $GITHUB_ENV
echo "version:$SPECIFIC_VERSION_TAG\ncommit_id:$(git rev-parse HEAD)" > __build_version.cfg
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Login to ACR region
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.ACR_USER }}
password: ${{ secrets.ACR_PUBLIC_PASSWORD }}

- name: Build and push base image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}
SPECIFIC_IMAGE_TAG: ${{env.SPECIFIC_VERSION_TAG}}
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
- name: Build and push UI image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-ui
SPECIFIC_IMAGE_TAG: ${{env.SPECIFIC_VERSION_TAG}}-ui
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} -f Dockerfile_ui .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
- name: Build and push nginx image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-nginx
SPECIFIC_IMAGE_TAG: ${{env.SPECIFIC_VERSION_TAG}}-nginx
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} -f Dockerfile_nginx .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
- name: Build and push GPU image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-gpu
SPECIFIC_IMAGE_TAG: ${{env.SPECIFIC_VERSION_TAG}}-gpu
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} -f Dockerfile_gpu .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,6 @@ output
*.local.toml

localdata/
model_repository/
*.tmp
__*
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ repos:
(\/.*?\.[\w:]+)/poetry.lock
args:
[
"--exclude",
"./data/tokenization/qwen.tiktoken",
"--ignore-words-list",
"astroid,gallary,momento,narl,ot,rouge,nin,gere",
]
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ 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"

Expand All @@ -21,4 +24,4 @@ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
WORKDIR /app
COPY . .
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENTRYPOINT ["pai_rag", "run"]
CMD ["pai_rag", "run"]
5 changes: 4 additions & 1 deletion Dockerfile_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ RUN mv pyproject_gpu.toml pyproject.toml \
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"

Expand All @@ -23,4 +26,4 @@ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
WORKDIR /app
COPY . .
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENTRYPOINT ["pai_rag", "run"]
CMD ["pai_rag", "run"]
3 changes: 3 additions & 0 deletions Dockerfile_nginx
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
27 changes: 27 additions & 0 deletions Dockerfile_ui
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"]
Loading

0 comments on commit 2363ae5

Please sign in to comment.