-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/deploy/dev' into feat/cleaning_ops_trace
* refs/heads/deploy/dev: (273 commits) chore: host required fix: monitor copywrite feat: make show citations enable default chore: use singular style in middleware config class name (#5502) refactor: extract hosted service configs into dify config (#5504) fix: summary of duckduckgo_search (#5488) fix: zhipu tool calling, this PR fixes the bug described in issue #5496 (#5469) fix: tongyi json output (#5396) fix: firecrawl apikey not start with fc- (#5498) fix lock refactor: extract db configs and celery configs into dify config (#5491) refactor: extract storage provider configs into dify configs (#5443) chore: use singular style in config class name (#5489) chore: remove pip support for api service (#5453) Add Oracle23ai as a vector datasource (#5342) build: support Poetry for depencencies tool in api's Dockerfile (#5105) feat: add ops trace encrypt_config decrypt_config obfuscate_config feat: add remove tracing app fix: max_tokens of qwen-plus & qwen-plus-chat (#5480) feat: add support for Vertex AI claude-3-5-sonnet@20240620 (#5475) ...
- Loading branch information
Showing
110 changed files
with
3,933 additions
and
880 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
cd api && pip install -r requirements.txt | ||
poetry install -C api |
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 |
---|---|---|
|
@@ -14,74 +14,6 @@ concurrency: | |
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
./api/requirements.txt | ||
./api/requirements-dev.txt | ||
- name: Install dependencies | ||
run: pip install -r ./api/requirements.txt -r ./api/requirements-dev.txt | ||
|
||
- name: Run Unit tests | ||
run: dev/pytest/pytest_unit_tests.sh | ||
|
||
- name: Run ModelRuntime | ||
run: dev/pytest/pytest_model_runtime.sh | ||
|
||
- name: Run Tool | ||
run: dev/pytest/pytest_tools.sh | ||
|
||
- name: Set up Sandbox | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: | | ||
docker/docker-compose.middleware.yaml | ||
services: | | ||
sandbox | ||
ssrf_proxy | ||
- name: Run Workflow | ||
run: dev/pytest/pytest_workflow.sh | ||
|
||
- name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma) | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: | | ||
docker/docker-compose.middleware.yaml | ||
docker/docker-compose.qdrant.yaml | ||
docker/docker-compose.milvus.yaml | ||
docker/docker-compose.pgvecto-rs.yaml | ||
docker/docker-compose.pgvector.yaml | ||
docker/docker-compose.chroma.yaml | ||
services: | | ||
weaviate | ||
qdrant | ||
etcd | ||
minio | ||
milvus-standalone | ||
pgvecto-rs | ||
pgvector | ||
chroma | ||
- name: Test Vector Stores | ||
run: dev/pytest/pytest_vdb.sh | ||
|
||
test-in-poetry: | ||
name: API Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -108,7 +40,7 @@ jobs: | |
- name: Poetry check | ||
run: | | ||
poetry check -C api | ||
poetry check -C api --lock | ||
poetry show -C api | ||
- name: Install dependencies | ||
|
@@ -145,6 +77,7 @@ jobs: | |
docker/docker-compose.pgvecto-rs.yaml | ||
docker/docker-compose.pgvector.yaml | ||
docker/docker-compose.chroma.yaml | ||
docker/docker-compose.oracle.yaml | ||
services: | | ||
weaviate | ||
qdrant | ||
|
@@ -154,6 +87,7 @@ jobs: | |
pgvecto-rs | ||
pgvector | ||
chroma | ||
oracle | ||
- name: Test Vector Stores | ||
run: poetry run -C api bash dev/pytest/pytest_vdb.sh |
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
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 |
---|---|---|
|
@@ -8,4 +8,7 @@ logs | |
*.log* | ||
|
||
# jetbrains | ||
.idea | ||
.idea | ||
|
||
# venv | ||
.venv |
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 |
---|---|---|
|
@@ -224,3 +224,4 @@ WORKFLOW_CALL_MAX_DEPTH=5 | |
# App configuration | ||
APP_MAX_EXECUTION_TIME=1200 | ||
|
||
|
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,18 +1,28 @@ | ||
# base image | ||
FROM python:3.10-slim-bookworm AS base | ||
FROM python:3.10-slim-bookworm as base | ||
|
||
LABEL maintainer="[email protected]" | ||
WORKDIR /app/api | ||
|
||
# Install Poetry | ||
ENV POETRY_VERSION=1.8.3 | ||
RUN pip install --no-cache-dir --upgrade pip && \ | ||
pip install --no-cache-dir --upgrade poetry==${POETRY_VERSION} | ||
|
||
# Configure Poetry | ||
ENV POETRY_CACHE_DIR=/tmp/poetry_cache | ||
ENV POETRY_NO_INTERACTION=1 | ||
ENV POETRY_VIRTUALENVS_IN_PROJECT=true | ||
ENV POETRY_VIRTUALENVS_CREATE=true | ||
|
||
# install packages | ||
FROM base as packages | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev | ||
|
||
COPY requirements.txt /requirements.txt | ||
# Install Python dependencies | ||
COPY pyproject.toml poetry.lock ./ | ||
RUN poetry install --sync --no-cache --no-root | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install --prefix=/pkg -r requirements.txt | ||
|
||
# production stage | ||
FROM base AS production | ||
|
@@ -37,13 +47,20 @@ RUN apt-get update \ | |
&& apt-get autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=packages /pkg /usr/local | ||
# Copy Python environment and packages | ||
ENV VIRTUAL_ENV=/app/api/.venv | ||
COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" | ||
|
||
# Copy source code | ||
COPY . /app/api/ | ||
|
||
# Copy entrypoint | ||
COPY docker/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
|
||
ARG COMMIT_SHA | ||
ENV COMMIT_SHA ${COMMIT_SHA} | ||
|
||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] | ||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] |
Oops, something went wrong.