Compare commits
2 Commits
update_vLL
...
nightly-ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec9db1a3e1 | ||
|
|
faf6250590 |
13
.github/CODEOWNERS
vendored
13
.github/CODEOWNERS
vendored
@@ -1,18 +1,16 @@
|
||||
# Code owners will review PRs within their respective folders.
|
||||
|
||||
* liang1.lv@intel.com feng.tian@intel.com suyue.chen@intel.com kaokao.lv@intel.com minmin.hou@intel.com rita.brugarolas.brufau@intel.com
|
||||
* liang1.lv@intel.com feng.tian@intel.com suyue.chen@intel.com
|
||||
/.github/ suyue.chen@intel.com ze.pan@intel.com
|
||||
/AgentQnA/ abolfazl.shahbazi@intel.com kaokao.lv@intel.com minmin.hou@intel.com
|
||||
/AgentQnA/ kaokao.lv@intel.com minmin.hou@intel.com
|
||||
/AudioQnA/ sihan.chen@intel.com wenjiao.yue@intel.com
|
||||
/AvatarChatbot/ chun.tao@intel.com kaokao.lv@intel.com
|
||||
/ChatQnA/ liang1.lv@intel.com letong.han@intel.com
|
||||
/CodeGen/ liang1.lv@intel.com
|
||||
/CodeTrans/ sihan.chen@intel.com
|
||||
/DBQnA/ supriya.krishnamurthi@intel.com liang1.lv@intel.com
|
||||
/DocIndexRetriever/ abolfazl.shahbazi@intel.com kaokao.lv@intel.com chendi.xue@intel.com
|
||||
/DocIndexRetriever/ kaokao.lv@intel.com chendi.xue@intel.com
|
||||
/DocSum/ letong.han@intel.com
|
||||
/EdgeCraftRAG/ yongbo.zhu@intel.com mingyuan.qi@intel.com
|
||||
/FinanceAgent/ abolfazl.shahbazi@intel.com kaokao.lv@intel.com minmin.hou@intel.com rita.brugarolas.brufau@intel.com
|
||||
/FaqGen/ yogesh.pandey@intel.com
|
||||
/GraphRAG/ rita.brugarolas.brufau@intel.com abolfazl.shahbazi@intel.com
|
||||
/InstructionTuning/ xinyu.ye@intel.com kaokao.lv@intel.com
|
||||
/MultimodalQnA/ melanie.h.buehler@intel.com tiep.le@intel.com
|
||||
@@ -22,5 +20,4 @@
|
||||
/Text2Image/ wenjiao.yue@intel.com xinyu.ye@intel.com
|
||||
/Translation/ liang1.lv@intel.com sihan.chen@intel.com
|
||||
/VideoQnA/ huiling.bao@intel.com
|
||||
/VisualQnA/ liang1.lv@intel.com sihan.chen@intel.com
|
||||
/WorkflowExecAgent/ joshua.jian.ern.liew@intel.com kaokao.lv@intel.com
|
||||
/VisualQnA/ liang1.lv@intel.com sihan.chen@intel.com
|
||||
5
.github/env/_build_image.sh
vendored
5
.github/env/_build_image.sh
vendored
@@ -1,5 +0,0 @@
|
||||
# Copyright (C) 2025 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export VLLM_VER=v0.8.3
|
||||
export VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
11
.github/workflows/_build_image.yml
vendored
11
.github/workflows/_build_image.yml
vendored
@@ -75,12 +75,17 @@ jobs:
|
||||
run: |
|
||||
cd ${{ github.workspace }}/${{ inputs.example }}/docker_image_build
|
||||
docker_compose_path=${{ github.workspace }}/${{ inputs.example }}/docker_image_build/build.yaml
|
||||
source ${{ github.workspace }}/.github/env/_build_image.sh
|
||||
if [[ $(grep -c "vllm:" ${docker_compose_path}) != 0 ]]; then
|
||||
git clone -b ${VLLM_VER} --single-branch https://github.com/vllm-project/vllm.git
|
||||
git clone https://github.com/vllm-project/vllm.git && cd vllm
|
||||
VLLM_VER=v0.8.3
|
||||
echo "Check out vLLM tag ${VLLM_VER}"
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
fi
|
||||
if [[ $(grep -c "vllm-gaudi:" ${docker_compose_path}) != 0 ]]; then
|
||||
git clone -b ${VLLM_FORK_VER} --single-branch https://github.com/HabanaAI/vllm-fork.git
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
echo "Check out vLLM tag ${VLLM_VER}"
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
fi
|
||||
git clone --depth 1 --branch ${{ inputs.opea_branch }} https://github.com/opea-project/GenAIComps.git
|
||||
cd GenAIComps && git rev-parse HEAD && cd ../
|
||||
|
||||
2
.github/workflows/_helm-e2e.yml
vendored
2
.github/workflows/_helm-e2e.yml
vendored
@@ -137,7 +137,7 @@ jobs:
|
||||
env:
|
||||
example: ${{ inputs.example }}
|
||||
run: |
|
||||
if [[ ! "$example" =~ ^[a-zA-Z0-9]{1,20}$ ]] || [[ "$example" =~ \.\. ]] || [[ "$example" == -* || "$example" == *- ]]; then
|
||||
if [[ ! "$example" =~ ^[a-zA-Z]{1,20}$ ]] || [[ "$example" =~ \.\. ]] || [[ "$example" == -* || "$example" == *- ]]; then
|
||||
echo "Error: Invalid input - only lowercase alphanumeric and internal hyphens allowed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
10
.github/workflows/_run-docker-compose.yml
vendored
10
.github/workflows/_run-docker-compose.yml
vendored
@@ -204,10 +204,6 @@ jobs:
|
||||
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid && sleep 1s; fi
|
||||
|
||||
echo "Cleaning up images ..."
|
||||
df -h
|
||||
sleep 1
|
||||
docker system df
|
||||
sleep 1
|
||||
if [[ "${{ inputs.hardware }}" == "xeon"* ]]; then
|
||||
docker system prune -a -f
|
||||
else
|
||||
@@ -217,13 +213,7 @@ jobs:
|
||||
docker images --filter reference="opea/comps-base" -q | xargs -r docker rmi && sleep 1s
|
||||
docker system prune -f
|
||||
fi
|
||||
sleep 5
|
||||
docker images
|
||||
sleep 1
|
||||
df -h
|
||||
sleep 1
|
||||
docker system df
|
||||
sleep 1
|
||||
|
||||
- name: Publish pipeline artifact
|
||||
if: ${{ !cancelled() }}
|
||||
|
||||
94
.github/workflows/daily-update-vllm-version.yml
vendored
94
.github/workflows/daily-update-vllm-version.yml
vendored
@@ -1,94 +0,0 @@
|
||||
# Copyright (C) 2025 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Daily update vLLM & vLLM-fork version
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 22 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BRANCH_NAME: "update"
|
||||
USER_NAME: "CICD-at-OPEA"
|
||||
USER_EMAIL: "CICD@opea.dev"
|
||||
|
||||
jobs:
|
||||
freeze-tag:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- repo: vLLM
|
||||
repo_name: vllm-project/vllm
|
||||
ver_name: VLLM_VER
|
||||
- repo: vLLM-fork
|
||||
repo_name: HabanaAI/vllm-fork
|
||||
ver_name: VLLM_FORK_VER
|
||||
fail-fast: false
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name ${{ env.USER_NAME }}
|
||||
git config --global user.email ${{ env.USER_EMAIL }}
|
||||
git remote set-url origin https://${{ env.USER_NAME }}:"${{ secrets.ACTION_TOKEN }}"@github.com/${{ github.repository }}.git
|
||||
git fetch
|
||||
|
||||
if git ls-remote https://github.com/${{ github.repository }}.git "refs/heads/${{ env.BRANCH_NAME }}_${{ matrix.repo }}" | grep -q "refs/heads/${{ env.BRANCH_NAME }}_${{ matrix.repo }}"; then
|
||||
echo "branch ${{ env.BRANCH_NAME }}_${{ matrix.repo }} exists"
|
||||
git checkout ${{ env.BRANCH_NAME }}_${{ matrix.repo }}
|
||||
else
|
||||
echo "branch ${{ env.BRANCH_NAME }}_${{ matrix.repo }} not exists"
|
||||
git checkout -b ${{ env.BRANCH_NAME }}_${{ matrix.repo }}
|
||||
git push origin ${{ env.BRANCH_NAME }}_${{ matrix.repo }}
|
||||
echo "branch ${{ env.BRANCH_NAME }}_${{ matrix.repo }} created successfully"
|
||||
fi
|
||||
|
||||
- name: Run script
|
||||
run: |
|
||||
latest_vllm_ver=$(curl -s "https://api.github.com/repos/${{ matrix.repo_name }}/tags" | jq '.[0].name' -)
|
||||
latest_vllm_ver=$(echo "$latest_vllm_ver" | sed 's/"//g')
|
||||
echo "latest_vllm_ver=${latest_vllm_ver}" >> "$GITHUB_ENV"
|
||||
find . -type f -name "*.sh" -exec sed -i "s/${{ matrix.ver_name }}=.*/${{ matrix.ver_name }}=${latest_vllm_ver}/" {} \;
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add .
|
||||
if git diff-index --quiet HEAD --; then
|
||||
echo "No changes detected, skipping commit."
|
||||
exit 1
|
||||
else
|
||||
git commit -s -m "Update ${{ matrix.repo }} version to ${latest_vllm_ver}"
|
||||
git push --set-upstream origin ${{ env.BRANCH_NAME }}_${{ matrix.repo }}
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.ACTION_TOKEN }}
|
||||
run: |
|
||||
pr_count=$(curl -H "Authorization: token ${{ secrets.ACTION_TOKEN }}" -s "https://api.github.com/repos/${{ github.repository }}/pulls?state=all&head=${{ env.USER_NAME }}:${{ env.BRANCH_NAME }}_${{ matrix.repo }}" | jq '. | length')
|
||||
if [ $pr_count -gt 0 ]; then
|
||||
echo "Pull Request exists"
|
||||
pr_number=$(curl -H "Authorization: token ${{ secrets.ACTION_TOKEN }}" -s "https://api.github.com/repos/${{ github.repository }}/pulls?state=all&head=${{ env.USER_NAME }}:${{ env.BRANCH_NAME }}_${{ matrix.repo }}" | jq '.[0].number')
|
||||
gh pr edit ${pr_number} \
|
||||
--title "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" \
|
||||
--body "Update ${{ matrix.repo }} version to ${latest_vllm_ver}"
|
||||
echo "Pull Request updated successfully"
|
||||
else
|
||||
echo "Pull Request does not exists..."
|
||||
gh pr create \
|
||||
-B main \
|
||||
-H ${{ env.BRANCH_NAME }}_${{ matrix.repo }} \
|
||||
--title "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" \
|
||||
--body "Update ${{ matrix.repo }} version to ${latest_vllm_ver}"
|
||||
echo "Pull Request created successfully"
|
||||
fi
|
||||
@@ -26,4 +26,3 @@ jobs:
|
||||
close-pr-message: "This PR was closed because it has been stalled for 7 days with no activity."
|
||||
repo-token: ${{ secrets.ACTION_TOKEN }}
|
||||
start-date: "2025-03-01T00:00:00Z"
|
||||
exempt-issue-labels: "Backlog"
|
||||
|
||||
@@ -9,7 +9,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
EXAMPLES: ${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
|
||||
EXAMPLES: CodeGen,CodeTrans #${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
|
||||
TAG: "latest"
|
||||
PUBLISH_TAGS: "latest"
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
publish:
|
||||
needs: [get-build-matrix, get-image-list, build-images]
|
||||
if: always()
|
||||
if: ${{ success() }}
|
||||
strategy:
|
||||
matrix:
|
||||
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}
|
||||
|
||||
30
.github/workflows/pr-link-path-scan.yml
vendored
30
.github/workflows/pr-link-path-scan.yml
vendored
@@ -23,7 +23,6 @@ jobs:
|
||||
- name: Check the Validity of Hyperlinks
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
delay=15
|
||||
fail="FALSE"
|
||||
merged_commit=$(git log -1 --format='%H')
|
||||
changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')"
|
||||
@@ -36,20 +35,15 @@ jobs:
|
||||
# echo $url_line
|
||||
url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//')
|
||||
path=$(echo "$url_line"|cut -d':' -f1 | cut -d'/' -f2-)
|
||||
if [[ "$url" == "https://platform.openai.com/api-keys"* ]]; then
|
||||
echo "Link "$url" from ${{github.workspace}}/$path needs to be verified by a real person."
|
||||
else
|
||||
sleep $delay
|
||||
response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url")|| true
|
||||
if [ "$response" -ne 200 ]; then
|
||||
echo "**********Validation failed ($response), try again**********"
|
||||
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
|
||||
if [ "$response_retry" -eq 200 ]; then
|
||||
echo "*****Retry successfully*****"
|
||||
else
|
||||
echo "Invalid link ($response_retry) from ${{github.workspace}}/$path: $url"
|
||||
fail="TRUE"
|
||||
fi
|
||||
response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url")|| true
|
||||
if [ "$response" -ne 200 ]; then
|
||||
echo "**********Validation failed, try again**********"
|
||||
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
|
||||
if [ "$response_retry" -eq 200 ]; then
|
||||
echo "*****Retry successfully*****"
|
||||
else
|
||||
echo "Invalid link from ${{github.workspace}}/$path: $url"
|
||||
fail="TRUE"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -80,7 +74,6 @@ jobs:
|
||||
- name: Checking Relative Path Validity
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
delay=15
|
||||
fail="FALSE"
|
||||
repo_name=${{ github.event.pull_request.head.repo.full_name }}
|
||||
branch="https://github.com/$repo_name/blob/${{ github.event.pull_request.head.ref }}"
|
||||
@@ -112,15 +105,14 @@ jobs:
|
||||
if [[ "$png_line" == *#* ]]; then
|
||||
if [ -n "changed_files" ] && echo "$changed_files" | grep -q "^${refer_path}$"; then
|
||||
url_dev=$branch$(echo "$real_path" | sed 's|.*/GenAIExamples||')$png_path
|
||||
sleep $delay
|
||||
response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url_dev")
|
||||
if [ "$response" -ne 200 ]; then
|
||||
echo "**********Validation failed ($response), try again**********"
|
||||
echo "**********Validation failed, try again**********"
|
||||
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url_dev")
|
||||
if [ "$response_retry" -eq 200 ]; then
|
||||
echo "*****Retry successfully*****"
|
||||
else
|
||||
echo "Invalid path ($response_retry) from ${{github.workspace}}/$refer_path: $png_path"
|
||||
echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path"
|
||||
fail="TRUE"
|
||||
fi
|
||||
else
|
||||
|
||||
@@ -99,7 +99,7 @@ flowchart LR
|
||||
|
||||
#### First, clone the `GenAIExamples` repo.
|
||||
|
||||
```bash
|
||||
```
|
||||
export WORKDIR=<your-work-directory>
|
||||
cd $WORKDIR
|
||||
git clone https://github.com/opea-project/GenAIExamples.git
|
||||
@@ -109,7 +109,7 @@ git clone https://github.com/opea-project/GenAIExamples.git
|
||||
|
||||
##### For proxy environments only
|
||||
|
||||
```bash
|
||||
```
|
||||
export http_proxy="Your_HTTP_Proxy"
|
||||
export https_proxy="Your_HTTPs_Proxy"
|
||||
# Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1"
|
||||
@@ -118,24 +118,14 @@ export no_proxy="Your_No_Proxy"
|
||||
|
||||
##### For using open-source llms
|
||||
|
||||
Set up a [HuggingFace](https://huggingface.co/) account and generate a [user access token](https://huggingface.co/docs/transformers.js/en/guides/private#step-1-generating-a-user-access-token).
|
||||
|
||||
Then set an environment variable with the token and another for a directory to download the models:
|
||||
|
||||
```bash
|
||||
```
|
||||
export HUGGINGFACEHUB_API_TOKEN=<your-HF-token>
|
||||
export HF_CACHE_DIR=<directory-where-llms-are-downloaded> # to avoid redownloading models
|
||||
export HF_CACHE_DIR=<directory-where-llms-are-downloaded> #so that no need to redownload every time
|
||||
```
|
||||
|
||||
##### [Optional] OPENAI_API_KEY to use OpenAI models or Intel® AI for Enterprise Inference
|
||||
##### [Optional] OPANAI_API_KEY to use OpenAI models
|
||||
|
||||
To use OpenAI models, generate a key following these [instructions](https://platform.openai.com/api-keys).
|
||||
|
||||
To use a remote server running Intel® AI for Enterprise Inference, contact the cloud service provider or owner of the on-prem machine for a key to access the desired model on the server.
|
||||
|
||||
Then set the environment variable `OPENAI_API_KEY` with the key contents:
|
||||
|
||||
```bash
|
||||
```
|
||||
export OPENAI_API_KEY=<your-openai-key>
|
||||
```
|
||||
|
||||
@@ -143,18 +133,16 @@ export OPENAI_API_KEY=<your-openai-key>
|
||||
|
||||
##### Gaudi
|
||||
|
||||
```bash
|
||||
```
|
||||
source $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi/set_env.sh
|
||||
```
|
||||
|
||||
##### Xeon
|
||||
|
||||
```bash
|
||||
```
|
||||
source $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon/set_env.sh
|
||||
```
|
||||
|
||||
For running
|
||||
|
||||
### 2. Launch the multi-agent system. </br>
|
||||
|
||||
We make it convenient to launch the whole system with docker compose, which includes microservices for LLM, agents, UI, retrieval tool, vector database, dataprep, and telemetry. There are 3 docker compose files, which make it easy for users to pick and choose. Users can choose a different retrieval tool other than the `DocIndexRetriever` example provided in our GenAIExamples repo. Users can choose not to launch the telemetry containers.
|
||||
@@ -196,37 +184,14 @@ docker compose -f $WORKDIR/GenAIExamples/DocIndexRetriever/docker_compose/intel/
|
||||
|
||||
#### Launch on Xeon
|
||||
|
||||
On Xeon, OpenAI models and models deployed on a remote server are supported. Both methods require an API key.
|
||||
On Xeon, only OpenAI models are supported. The command below will launch the multi-agent system with the `DocIndexRetriever` as the retrieval tool for the Worker RAG agent.
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY=<your-openai-key>
|
||||
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon
|
||||
```
|
||||
|
||||
##### OpenAI Models
|
||||
|
||||
The command below will launch the multi-agent system with the `DocIndexRetriever` as the retrieval tool for the Worker RAG agent.
|
||||
|
||||
```bash
|
||||
docker compose -f $WORKDIR/GenAIExamples/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose.yaml -f compose_openai.yaml up -d
|
||||
```
|
||||
|
||||
##### Models on Remote Server
|
||||
|
||||
When models are deployed on a remote server with Intel® AI for Enterprise Inference, a base URL and an API key are required to access them. To run the Agent microservice on Xeon while using models deployed on a remote server, add `compose_remote.yaml` to the `docker compose` command and set additional environment variables.
|
||||
|
||||
###### Notes
|
||||
|
||||
- `OPENAI_API_KEY` is already set in a previous step.
|
||||
- `model` is used to overwrite the value set for this environment variable in `set_env.sh`.
|
||||
- `LLM_ENDPOINT_URL` is the base URL given from the owner of the on-prem machine or cloud service provider. It will follow this format: "https://<DNS>". Here is an example: "https://api.inference.example.com".
|
||||
|
||||
```bash
|
||||
export model=<name-of-model-card>
|
||||
export LLM_ENDPOINT_URL=<http-endpoint-of-remote-server>
|
||||
docker compose -f $WORKDIR/GenAIExamples/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose.yaml -f compose_openai.yaml -f compose_remote.yaml up -d
|
||||
```
|
||||
|
||||
### 3. Ingest Data into the vector database
|
||||
|
||||
The `run_ingest_data.sh` script will use an example jsonl file to ingest example documents into a vector database. Other ways to ingest data and other types of documents supported can be found in the OPEA dataprep microservice located in the opea-project/GenAIComps repo.
|
||||
@@ -243,18 +208,12 @@ bash run_ingest_data.sh
|
||||
The UI microservice is launched in the previous step with the other microservices.
|
||||
To see the UI, open a web browser to `http://${ip_address}:5173` to access the UI. Note the `ip_address` here is the host IP of the UI microservice.
|
||||
|
||||
1. Click on the arrow above `Get started`. Create an admin account with a name, email, and password.
|
||||
2. Add an OpenAI-compatible API endpoint. In the upper right, click on the circle button with the user's initial, go to `Admin Settings`->`Connections`. Under `Manage OpenAI API Connections`, click on the `+` to add a connection. Fill in these fields:
|
||||
|
||||
- **URL**: `http://${ip_address}:9090/v1`, do not forget the `v1`
|
||||
- **Key**: any value
|
||||
- **Model IDs**: any name i.e. `opea-agent`, then press `+` to add it
|
||||
|
||||
Click "Save".
|
||||
1. `create Admin Account` with a random value
|
||||
2. add opea agent endpoint `http://$ip_address:9090/v1` which is a openai compatible api
|
||||
|
||||

|
||||
|
||||
3. Test OPEA agent with UI. Return to `New Chat` and ensure the model (i.e. `opea-agent`) is selected near the upper left. Enter in any prompt to interact with the agent.
|
||||
3. test opea agent with ui
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Copyright (C) 2025 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
services:
|
||||
worker-rag-agent:
|
||||
environment:
|
||||
llm_endpoint_url: ${LLM_ENDPOINT_URL}
|
||||
api_key: ${OPENAI_API_KEY}
|
||||
|
||||
worker-sql-agent:
|
||||
environment:
|
||||
llm_endpoint_url: ${LLM_ENDPOINT_URL}
|
||||
api_key: ${OPENAI_API_KEY}
|
||||
|
||||
supervisor-react-agent:
|
||||
environment:
|
||||
llm_endpoint_url: ${LLM_ENDPOINT_URL}
|
||||
api_key: ${OPENAI_API_KEY}
|
||||
@@ -37,8 +37,8 @@ function build_agent_docker_image_gaudi_vllm() {
|
||||
get_genai_comps
|
||||
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build agent image with --no-cache..."
|
||||
service_list="agent agent-ui vllm-gaudi"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
# export host_ip=<your External Public IP> # export host_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
export host_ip=${ip_address}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export host_ip="192.165.1.21"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${YOUR_HUGGINGFACEHUB_API_TOKEN}
|
||||
# <token>
|
||||
|
||||
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
# export host_ip=<your External Public IP> # export host_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
export host_ip=${ip_address}
|
||||
export external_host_ip=${ip_address}
|
||||
export host_ip=""
|
||||
export external_host_ip=""
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export HF_CACHE_DIR="./data"
|
||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
||||
|
||||
@@ -14,8 +14,7 @@ export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export LLM_SERVER_HOST_IP=${host_ip}
|
||||
export GPT_SOVITS_SERVER_HOST_IP=${host_ip}
|
||||
export GPT_SOVITS_SERVER_PORT=9880
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
# AudioQnA E2E test scripts
|
||||
|
||||
## Set the required environment variable
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
## Run test
|
||||
|
||||
On Intel Xeon with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_tgi_on_xeon.sh
|
||||
```
|
||||
|
||||
On Intel Xeon with vLLM:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_xeon.sh
|
||||
```
|
||||
|
||||
On Intel Gaudi with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_tgi_on_gaudi.sh
|
||||
```
|
||||
|
||||
On Intel Gaudi with vLLM:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_gaudi.sh
|
||||
```
|
||||
|
||||
On AMD ROCm with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_rocm.sh
|
||||
```
|
||||
|
||||
On AMD ROCm with vLLM:
|
||||
|
||||
```bash
|
||||
bash test_compose_vllm_on_rocm.sh
|
||||
```
|
||||
@@ -40,8 +40,21 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon/
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export LLM_MODEL_ID=meta-llama/Meta-Llama-3-8B-Instruct
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export WHISPER_SERVER_HOST_IP=${ip_address}
|
||||
export GPT_SOVITS_SERVER_HOST_IP=${ip_address}
|
||||
export LLM_SERVER_HOST_IP=${ip_address}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export GPT_SOVITS_SERVER_PORT=9880
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${ip_address}:3008/v1/audioqna
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
|
||||
# sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
# Start Docker Containers
|
||||
|
||||
@@ -27,9 +27,9 @@ function build_docker_images() {
|
||||
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git
|
||||
cd vllm-fork/
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
echo "Check out vLLM tag ${VLLM_FORK_VER}"
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
echo "Check out vLLM tag ${VLLM_VER}"
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="audioqna audioqna-ui whisper-gaudi speecht5-gaudi vllm-gaudi"
|
||||
@@ -40,8 +40,24 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/hpu/gaudi
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export LLM_MODEL_ID=meta-llama/Meta-Llama-3-8B-Instruct
|
||||
export NUM_CARDS=1
|
||||
export BLOCK_SIZE=128
|
||||
export MAX_NUM_SEQS=256
|
||||
export MAX_SEQ_LEN_TO_CAPTURE=2048
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export WHISPER_SERVER_HOST_IP=${ip_address}
|
||||
export SPEECHT5_SERVER_HOST_IP=${ip_address}
|
||||
export LLM_SERVER_HOST_IP=${ip_address}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${ip_address}:3008/v1/audioqna
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
# sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
# Start Docker Containers
|
||||
|
||||
@@ -35,7 +35,20 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/amd/gpu/rocm/
|
||||
source set_env.sh
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export WHISPER_SERVER_HOST_IP=${ip_address}
|
||||
export SPEECHT5_SERVER_HOST_IP=${ip_address}
|
||||
export LLM_SERVER_HOST_IP=${ip_address}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${ip_address}:3008/v1/audioqna
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
n=0
|
||||
|
||||
@@ -40,8 +40,21 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon/
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export LLM_MODEL_ID=meta-llama/Meta-Llama-3-8B-Instruct
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export WHISPER_SERVER_HOST_IP=${ip_address}
|
||||
export SPEECHT5_SERVER_HOST_IP=${ip_address}
|
||||
export LLM_SERVER_HOST_IP=${ip_address}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${ip_address}:3008/v1/audioqna
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
|
||||
# sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
# Start Docker Containers
|
||||
|
||||
@@ -34,8 +34,21 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/hpu/gaudi
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export LLM_MODEL_ID=meta-llama/Meta-Llama-3-8B-Instruct
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export WHISPER_SERVER_HOST_IP=${ip_address}
|
||||
export SPEECHT5_SERVER_HOST_IP=${ip_address}
|
||||
export LLM_SERVER_HOST_IP=${ip_address}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${ip_address}:3008/v1/audioqna
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f compose_tgi.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
n=0
|
||||
|
||||
@@ -34,8 +34,21 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon/
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export LLM_MODEL_ID=meta-llama/Meta-Llama-3-8B-Instruct
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export WHISPER_SERVER_HOST_IP=${ip_address}
|
||||
export SPEECHT5_SERVER_HOST_IP=${ip_address}
|
||||
export LLM_SERVER_HOST_IP=${ip_address}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=3006
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${ip_address}:3008/v1/audioqna
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f compose_tgi.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
n=0
|
||||
|
||||
@@ -33,7 +33,27 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/amd/gpu/rocm/
|
||||
source set_env_vllm.sh
|
||||
|
||||
export host_ip=${ip_address}
|
||||
export external_host_ip=${ip_address}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export HF_CACHE_DIR="./data"
|
||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
||||
export VLLM_SERVICE_PORT="8081"
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export LLM_SERVER_HOST_IP=${host_ip}
|
||||
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_PORT=${VLLM_SERVICE_PORT}
|
||||
export BACKEND_SERVICE_PORT=3008
|
||||
export FRONTEND_SERVICE_PORT=5173
|
||||
|
||||
export BACKEND_SERVICE_ENDPOINT=http://${external_host_ip}:${BACKEND_SERVICE_PORT}/v1/audioqna
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
# Start Docker Containers
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
ARG IMAGE_REPO=opea
|
||||
ARG BASE_TAG=latest
|
||||
FROM $IMAGE_REPO/comps-base:$BASE_TAG
|
||||
FROM opea/comps-base:$BASE_TAG
|
||||
|
||||
COPY ./avatarchatbot.py $HOME/avatarchatbot.py
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export FACE="/home/user/comps/animation/src/assets/img/avatar5.png"
|
||||
# export AUDIO='assets/audio/eg3_ref.wav' # audio file path is optional, will use base64str in the post request as input if is 'None'
|
||||
export AUDIO='None'
|
||||
export FACESIZE=96
|
||||
export OUTFILE="./outputs/result.mp4"
|
||||
export OUTFILE="/outputs/result.mp4"
|
||||
export GFPGAN_MODEL_VERSION=1.4 # latest version, can roll back to v1.3 if needed
|
||||
export UPSCALE_FACTOR=1
|
||||
export FPS=5
|
||||
export FPS=10
|
||||
|
||||
@@ -5,32 +5,3 @@
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export host_ip=$(hostname -I | awk '{print $1}')
|
||||
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
|
||||
export WAV2LIP_ENDPOINT=http://$host_ip:7860
|
||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_HOST_IP=${host_ip}
|
||||
export LLM_SERVER_PORT=3006
|
||||
export ANIMATION_SERVICE_HOST_IP=${host_ip}
|
||||
export ANIMATION_SERVICE_PORT=3008
|
||||
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
|
||||
export DEVICE="cpu"
|
||||
export WAV2LIP_PORT=7860
|
||||
export INFERENCE_MODE='wav2lip+gfpgan'
|
||||
export CHECKPOINT_PATH='/usr/local/lib/python3.11/site-packages/Wav2Lip/checkpoints/wav2lip_gan.pth'
|
||||
export FACE="/home/user/comps/animation/src/assets/img/avatar5.png"
|
||||
# export AUDIO='assets/audio/eg3_ref.wav' # audio file path is optional, will use base64str in the post request as input if is 'None'
|
||||
export AUDIO='None'
|
||||
export FACESIZE=96
|
||||
export OUTFILE="/outputs/result.mp4"
|
||||
export GFPGAN_MODEL_VERSION=1.4 # latest version, can roll back to v1.3 if needed
|
||||
export UPSCALE_FACTOR=1
|
||||
export FPS=10
|
||||
|
||||
@@ -5,35 +5,3 @@
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
|
||||
export host_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
|
||||
|
||||
export WAV2LIP_ENDPOINT=http://$host_ip:7860
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_HOST_IP=${host_ip}
|
||||
export LLM_SERVER_PORT=3006
|
||||
export ANIMATION_SERVICE_HOST_IP=${host_ip}
|
||||
export ANIMATION_SERVICE_PORT=3008
|
||||
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
|
||||
export DEVICE="hpu"
|
||||
export WAV2LIP_PORT=7860
|
||||
export INFERENCE_MODE='wav2lip+gfpgan'
|
||||
export CHECKPOINT_PATH='/usr/local/lib/python3.10/dist-packages/Wav2Lip/checkpoints/wav2lip_gan.pth'
|
||||
export FACE="/home/user/comps/animation/src/assets/img/avatar1.jpg"
|
||||
# export AUDIO='assets/audio/eg3_ref.wav' # audio file path is optional, will use base64str in the post request as input if is 'None'
|
||||
export AUDIO='None'
|
||||
export FACESIZE=96
|
||||
export OUTFILE="/outputs/result.mp4"
|
||||
export GFPGAN_MODEL_VERSION=1.4 # latest version, can roll back to v1.3 if needed
|
||||
export UPSCALE_FACTOR=1
|
||||
export FPS=10
|
||||
|
||||
@@ -5,8 +5,6 @@ services:
|
||||
avatarchatbot:
|
||||
build:
|
||||
args:
|
||||
IMAGE_REPO: ${REGISTRY:-opea}
|
||||
BASE_TAG: ${TAG:-latest}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
no_proxy: ${no_proxy}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# AvatarChatbot E2E test scripts
|
||||
|
||||
## Set the required environment variable
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
## Run test
|
||||
|
||||
On Intel Xeon with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_xeon.sh
|
||||
```
|
||||
|
||||
On Intel Gaudi with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_gaudi.sh
|
||||
```
|
||||
|
||||
On AMD ROCm with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_rocm.sh
|
||||
```
|
||||
@@ -24,13 +24,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="avatarchatbot whisper-gaudi speecht5-gaudi wav2lip-gaudi animation"
|
||||
@@ -45,7 +51,37 @@ function build_docker_images() {
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/hpu/gaudi
|
||||
|
||||
source set_env.sh
|
||||
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
|
||||
export host_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
|
||||
|
||||
export WAV2LIP_ENDPOINT=http://$host_ip:7860
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_HOST_IP=${host_ip}
|
||||
export LLM_SERVER_PORT=3006
|
||||
export ANIMATION_SERVICE_HOST_IP=${host_ip}
|
||||
export ANIMATION_SERVICE_PORT=3008
|
||||
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
|
||||
export DEVICE="hpu"
|
||||
export WAV2LIP_PORT=7860
|
||||
export INFERENCE_MODE='wav2lip+gfpgan'
|
||||
export CHECKPOINT_PATH='/usr/local/lib/python3.10/dist-packages/Wav2Lip/checkpoints/wav2lip_gan.pth'
|
||||
export FACE="/home/user/comps/animation/src/assets/img/avatar1.jpg"
|
||||
# export AUDIO='assets/audio/eg3_ref.wav' # audio file path is optional, will use base64str in the post request as input if is 'None'
|
||||
export AUDIO='None'
|
||||
export FACESIZE=96
|
||||
export OUTFILE="/outputs/result.mp4"
|
||||
export GFPGAN_MODEL_VERSION=1.4 # latest version, can roll back to v1.3 if needed
|
||||
export UPSCALE_FACTOR=1
|
||||
export FPS=10
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
@@ -92,29 +128,19 @@ function stop_docker() {
|
||||
|
||||
|
||||
function main() {
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
docker builder prune --all -f
|
||||
docker image prune -f
|
||||
echo y | docker builder prune --all
|
||||
echo y | docker image prune
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
# validate_microservices
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
# validate_frontend
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
docker builder prune --all -f
|
||||
docker image prune -f
|
||||
echo y | docker builder prune --all
|
||||
echo y | docker image prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -xe
|
||||
set -e
|
||||
IMAGE_REPO=${IMAGE_REPO:-"opea"}
|
||||
IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||
@@ -25,10 +25,6 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
function build_docker_images() {
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="avatarchatbot whisper asr speecht5 tts wav2lip animation"
|
||||
@@ -42,8 +38,48 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/amd/gpu/rocm
|
||||
|
||||
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
|
||||
export OPENAI_API_KEY=$OPENAI_API_KEY
|
||||
source set_env.sh
|
||||
export host_ip=${ip_address}
|
||||
|
||||
export TGI_SERVICE_PORT=3006
|
||||
export TGI_LLM_ENDPOINT=http://${host_ip}:${TGI_SERVICE_PORT}
|
||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
||||
|
||||
export ASR_ENDPOINT=http://${host_ip}:7066
|
||||
export TTS_ENDPOINT=http://${host_ip}:7055
|
||||
export WAV2LIP_ENDPOINT=http://${host_ip}:7860
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export ASR_SERVICE_HOST_IP=${host_ip}
|
||||
export TTS_SERVICE_HOST_IP=${host_ip}
|
||||
export LLM_SERVICE_HOST_IP=${host_ip}
|
||||
export ANIMATION_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
export ASR_SERVICE_PORT=3001
|
||||
export TTS_SERVICE_PORT=3002
|
||||
export LLM_SERVICE_PORT=3006
|
||||
export ANIMATION_SERVICE_PORT=3008
|
||||
|
||||
export DEVICE="cpu"
|
||||
export WAV2LIP_PORT=7860
|
||||
export INFERENCE_MODE='wav2lip+gfpgan'
|
||||
export CHECKPOINT_PATH='/usr/local/lib/python3.11/site-packages/Wav2Lip/checkpoints/wav2lip_gan.pth'
|
||||
export FACE="/home/user/comps/animation/src/assets/img/avatar5.png"
|
||||
# export AUDIO='assets/audio/eg3_ref.wav' # audio file path is optional, will use base64str in the post request as input if is 'None'
|
||||
export AUDIO='None'
|
||||
export FACESIZE=96
|
||||
export OUTFILE="./outputs/result.mp4"
|
||||
export GFPGAN_MODEL_VERSION=1.4 # latest version, can roll back to v1.3 if needed
|
||||
export UPSCALE_FACTOR=1
|
||||
export FPS=5
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose up -d --force-recreate
|
||||
@@ -102,6 +138,11 @@ function validate_megaservice() {
|
||||
}
|
||||
|
||||
|
||||
#function validate_frontend() {
|
||||
|
||||
#}
|
||||
|
||||
|
||||
function stop_docker() {
|
||||
cd $WORKPATH/docker_compose/amd/gpu/rocm
|
||||
docker compose down && docker compose rm -f
|
||||
@@ -110,27 +151,19 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
echo $OPENAI_API_KEY
|
||||
echo $OPENAI_KEY
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
stop_docker
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
# validate_microservices
|
||||
sleep 30
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
# validate_frontend
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="avatarchatbot whisper speecht5 wav2lip animation"
|
||||
@@ -45,7 +51,37 @@ function build_docker_images() {
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon
|
||||
|
||||
source set_env.sh
|
||||
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
|
||||
export host_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
|
||||
|
||||
export WAV2LIP_ENDPOINT=http://$host_ip:7860
|
||||
|
||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_HOST_IP=${host_ip}
|
||||
export WHISPER_SERVER_PORT=7066
|
||||
export SPEECHT5_SERVER_HOST_IP=${host_ip}
|
||||
export SPEECHT5_SERVER_PORT=7055
|
||||
export LLM_SERVER_HOST_IP=${host_ip}
|
||||
export LLM_SERVER_PORT=3006
|
||||
export ANIMATION_SERVICE_HOST_IP=${host_ip}
|
||||
export ANIMATION_SERVICE_PORT=3008
|
||||
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
|
||||
export DEVICE="cpu"
|
||||
export WAV2LIP_PORT=7860
|
||||
export INFERENCE_MODE='wav2lip+gfpgan'
|
||||
export CHECKPOINT_PATH='/usr/local/lib/python3.11/site-packages/Wav2Lip/checkpoints/wav2lip_gan.pth'
|
||||
export FACE="/home/user/comps/animation/src/assets/img/avatar5.png"
|
||||
# export AUDIO='assets/audio/eg3_ref.wav' # audio file path is optional, will use base64str in the post request as input if is 'None'
|
||||
export AUDIO='None'
|
||||
export FACESIZE=96
|
||||
export OUTFILE="/outputs/result.mp4"
|
||||
export GFPGAN_MODEL_VERSION=1.4 # latest version, can roll back to v1.3 if needed
|
||||
export UPSCALE_FACTOR=1
|
||||
export FPS=10
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose up -d
|
||||
@@ -91,28 +127,16 @@ function stop_docker() {
|
||||
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
# validate_microservices
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
# validate_frontend
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker builder prune --all
|
||||
echo y | docker image prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
35
ChatQnA/docker_compose/install_docker.sh
Normal file
35
ChatQnA/docker_compose/install_docker.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Update the package index
|
||||
sudo apt-get -y update
|
||||
|
||||
# Install prerequisites
|
||||
sudo apt-get -y install ca-certificates curl
|
||||
|
||||
# Create the directory for the Docker GPG key
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
|
||||
# Add Docker's official GPG key
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
|
||||
# Set permissions for the GPG key
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
# Add Docker repository to the sources list
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# Update the package index with Docker packages
|
||||
sudo apt-get -y update
|
||||
|
||||
# Install Docker packages
|
||||
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
|
||||
# add existing user
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# Optional: Verify that Docker is installed correctly
|
||||
sudo docker --version
|
||||
@@ -156,7 +156,6 @@ In the context of deploying a ChatQnA pipeline on an Intel® Xeon® platform, we
|
||||
| [compose_faqgen_tgi.yaml](./compose_faqgen_tgi.yaml) | Enables FAQ generation using TGI as the LLM serving framework. For more details, refer to [README_faqgen.md](./README_faqgen.md). |
|
||||
| [compose.telemetry.yaml](./compose.telemetry.yaml) | Helper file for telemetry features for vllm. Can be used along with any compose files that serves vllm |
|
||||
| [compose_tgi.telemetry.yaml](./compose_tgi.telemetry.yaml) | Helper file for telemetry features for tgi. Can be used along with any compose files that serves tgi |
|
||||
| [compose_mariadb.yaml](./compose_mariadb.yaml) | Uses MariaDB Server as the vector database. All other configurations remain the same as the default |
|
||||
|
||||
## ChatQnA with Conversational UI (Optional)
|
||||
|
||||
|
||||
@@ -1,259 +0,0 @@
|
||||
# Deploying ChatQnA with MariaDB Vector on Intel® Xeon® Processors
|
||||
|
||||
This document outlines the deployment process for a ChatQnA application utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline on Intel® Xeon® servers. The pipeline integrates **MariaDB Vector** as the vector database and includes microservices such as `embedding`, `retriever`, `rerank`, and `llm`.
|
||||
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Build Docker Images](#build-docker-images)
|
||||
2. [Validate Microservices](#validate-microservices)
|
||||
3. [Launch the UI](#launch-the-ui)
|
||||
4. [Launch the Conversational UI (Optional)](#launch-the-conversational-ui-optional)
|
||||
|
||||
---
|
||||
|
||||
## Build Docker Images
|
||||
|
||||
First of all, you need to build Docker Images locally and install the python package of it.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/opea-project/GenAIComps.git
|
||||
cd GenAIComps
|
||||
```
|
||||
|
||||
### 1. Build Retriever Image
|
||||
|
||||
```bash
|
||||
docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
|
||||
```
|
||||
|
||||
### 2. Build Dataprep Image
|
||||
|
||||
```bash
|
||||
docker build --no-cache -t opea/dataprep:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/src/Dockerfile .
|
||||
cd ..
|
||||
```
|
||||
|
||||
### 3. Build MegaService Docker Image
|
||||
|
||||
To construct the Mega Service, we utilize the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline within the `chatqna.py` Python script. Build MegaService Docker image via below command:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/opea-project/GenAIExamples.git
|
||||
cd GenAIExamples/ChatQnA/
|
||||
docker build --no-cache -t opea/chatqna:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
cd ../..
|
||||
```
|
||||
|
||||
### 4. Build UI Docker Image
|
||||
|
||||
Build frontend Docker image via below command:
|
||||
|
||||
```bash
|
||||
cd GenAIExamples/ChatQnA/ui
|
||||
docker build --no-cache -t opea/chatqna-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile .
|
||||
cd ../../..
|
||||
```
|
||||
|
||||
### 5. Build Conversational React UI Docker Image (Optional)
|
||||
|
||||
Build frontend Docker image that enables Conversational experience with ChatQnA megaservice via below command:
|
||||
|
||||
**Export the value of the public IP address of your Xeon server to the `host_ip` environment variable**
|
||||
|
||||
```bash
|
||||
cd GenAIExamples/ChatQnA/ui
|
||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8912/v1/chatqna"
|
||||
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6043/v1/dataprep/ingest"
|
||||
docker build --no-cache -t opea/chatqna-conversation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy --build-arg BACKEND_SERVICE_ENDPOINT=$BACKEND_SERVICE_ENDPOINT --build-arg DATAPREP_SERVICE_ENDPOINT=$DATAPREP_SERVICE_ENDPOINT -f ./docker/Dockerfile.react .
|
||||
cd ../../..
|
||||
```
|
||||
|
||||
### 6. Build Nginx Docker Image
|
||||
|
||||
```bash
|
||||
cd GenAIComps
|
||||
docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/third_parties/nginx/src/Dockerfile .
|
||||
```
|
||||
|
||||
Then run the command `docker images`, you will have the following 5 Docker Images:
|
||||
|
||||
1. `opea/dataprep:latest`
|
||||
2. `opea/retriever:latest`
|
||||
3. `opea/chatqna:latest`
|
||||
4. `opea/chatqna-ui:latest`
|
||||
5. `opea/nginx:latest`
|
||||
|
||||
## Start Microservices
|
||||
|
||||
### Required Models
|
||||
|
||||
By default, the embedding, reranking and LLM models are set to a default value as listed below:
|
||||
|
||||
| Service | Model |
|
||||
| --------- | ----------------------------------- |
|
||||
| Embedding | BAAI/bge-base-en-v1.5 |
|
||||
| Reranking | BAAI/bge-reranker-base |
|
||||
| LLM | meta-llama/Meta-Llama-3-8B-Instruct |
|
||||
|
||||
Change the `xxx_MODEL_ID` below for your needs.
|
||||
|
||||
### Setup Environment Variables
|
||||
|
||||
Since the `compose.yaml` will consume some environment variables, you need to set them up in advance as below.
|
||||
|
||||
**Export the value of the public IP address of your Xeon server to the `host_ip` environment variable**
|
||||
|
||||
> Change the External_Public_IP below with the actual IPV4 value
|
||||
|
||||
```bash
|
||||
export host_ip="External_Public_IP"
|
||||
```
|
||||
|
||||
> Change to your actual Huggingface API Token value
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
**Append the value of the public IP address to the no_proxy list if you are in a proxy environment**
|
||||
|
||||
```bash
|
||||
export no_proxy=${your_no_proxy},chatqna-xeon-ui-server,chatqna-xeon-backend-server,dataprep-mariadb-vector,tei-embedding-service,retriever,tei-reranking-service,tgi-service,vllm-service
|
||||
```
|
||||
|
||||
```bash
|
||||
export no_proxy=${your_no_proxy}
|
||||
export http_proxy=${your_http_proxy}
|
||||
export https_proxy=${your_http_proxy}
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
|
||||
export MARIADB_DATABASE="vectordb"
|
||||
export MARIADB_USER="chatqna"
|
||||
export MARIADB_PASSWORD="password"
|
||||
```
|
||||
|
||||
Note: Please replace with `host_ip` with you external IP address, do not use localhost.
|
||||
|
||||
### Start all the services Docker Containers
|
||||
|
||||
> Before running the docker compose command, you need to be in the folder that has the docker compose yaml file
|
||||
|
||||
```bash
|
||||
cd GenAIExamples/ChatQnA/docker_compose/intel/cpu/xeon/
|
||||
docker compose -f compose_mariadb.yaml up -d
|
||||
```
|
||||
|
||||
### Validate Microservices
|
||||
|
||||
Follow the instructions to validate MicroServices.
|
||||
For details on how to verify the correctness of the response, refer to [how-to-validate_service](../../hpu/gaudi/how_to_validate_service.md).
|
||||
|
||||
1. TEI Embedding Service
|
||||
|
||||
```bash
|
||||
curl ${host_ip}:6040/embed \
|
||||
-X POST \
|
||||
-d '{"inputs":"What is Deep Learning?"}' \
|
||||
-H 'Content-Type: application/json'
|
||||
```
|
||||
|
||||
2. Retriever Microservice
|
||||
|
||||
To consume the retriever microservice, you need to generate a mock embedding vector by Python script. The length of embedding vector
|
||||
is determined by the embedding model.
|
||||
Here we use the model `EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"`, which vector size is 768.
|
||||
|
||||
Check the vector dimension of your embedding model, set `your_embedding` dimension equals to it.
|
||||
|
||||
```bash
|
||||
export your_embedding=$(python3 -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)")
|
||||
curl http://${host_ip}:6045/v1/retrieval \
|
||||
-X POST \
|
||||
-d '{"text":"What is the revenue of Nike in 2023?","embedding":"'"${your_embedding}"'"}' \
|
||||
-H 'Content-Type: application/json'
|
||||
```
|
||||
|
||||
3. TEI Reranking Service
|
||||
|
||||
```bash
|
||||
curl http://${host_ip}:6041/rerank \
|
||||
-X POST \
|
||||
-d '{"query":"What is Deep Learning?", "texts": ["Deep Learning is not...", "Deep learning is..."]}' \
|
||||
-H 'Content-Type: application/json'
|
||||
```
|
||||
|
||||
4. LLM Backend Service
|
||||
|
||||
In the first startup, this service will take more time to download, load and warm up the model. After it's finished, the service will be ready.
|
||||
|
||||
Try the command below to check whether the LLM service is ready.
|
||||
|
||||
```bash
|
||||
docker logs vllm-service 2>&1 | grep complete
|
||||
```
|
||||
|
||||
If the service is ready, you will get the response like below.
|
||||
|
||||
```text
|
||||
INFO: Application startup complete.
|
||||
```
|
||||
|
||||
Then try the `cURL` command below to validate vLLM service.
|
||||
|
||||
```bash
|
||||
curl http://${host_ip}:6042/v1/chat/completions \
|
||||
-X POST \
|
||||
-d '{"model": "meta-llama/Meta-Llama-3-8B-Instruct", "messages": [{"role": "user", "content": "What is Deep Learning?"}], "max_tokens":17}' \
|
||||
-H 'Content-Type: application/json'
|
||||
```
|
||||
|
||||
5. MegaService
|
||||
|
||||
```bash
|
||||
curl http://${host_ip}:8912/v1/chatqna -H "Content-Type: application/json" -d '{
|
||||
"messages": "What is the revenue of Nike in 2023?"
|
||||
}'
|
||||
```
|
||||
|
||||
6. Dataprep Microservice(Optional)
|
||||
|
||||
If you want to update the default knowledge base, you can use the following commands:
|
||||
|
||||
Update Knowledge Base via Local File Upload:
|
||||
|
||||
```bash
|
||||
curl -X POST "http://${host_ip}:6043/v1/dataprep/ingest" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "files=@./your_file.pdf"
|
||||
```
|
||||
|
||||
This command updates a knowledge base by uploading a local file for processing. Update the file path according to your environment.
|
||||
|
||||
Add Knowledge Base via HTTP Links:
|
||||
|
||||
```bash
|
||||
curl -X POST "http://${host_ip}:6043/v1/dataprep/ingest" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F 'link_list=["https://opea.dev"]'
|
||||
```
|
||||
|
||||
## Launch the UI
|
||||
|
||||
To access the frontend, open the following URL in your browser: http://{host_ip}:5173. By default, the UI runs on port 5173 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below:
|
||||
|
||||
```yaml
|
||||
chatqna-xeon-ui-server:
|
||||
image: opea/chatqna-ui:latest
|
||||
...
|
||||
ports:
|
||||
- "80:5173"
|
||||
```
|
||||
|
||||

|
||||
|
||||
Here is an example of running ChatQnA:
|
||||
|
||||

|
||||
@@ -1,185 +0,0 @@
|
||||
# Copyright (C) 2025 MariaDB Foundation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
services:
|
||||
mariadb-server:
|
||||
image: mariadb:latest
|
||||
container_name: mariadb-server
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
- MARIADB_DATABASE=${MARIADB_DATABASE}
|
||||
- MARIADB_USER=${MARIADB_USER}
|
||||
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
|
||||
- MARIADB_RANDOM_ROOT_PASSWORD=1
|
||||
healthcheck:
|
||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
start_period: 10s
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
dataprep-mariadb-vector:
|
||||
image: ${REGISTRY:-opea}/dataprep:${TAG:-latest}
|
||||
container_name: dataprep-mariadb-vector
|
||||
depends_on:
|
||||
mariadb-server:
|
||||
condition: service_healthy
|
||||
tei-embedding-service:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "6007:5000"
|
||||
environment:
|
||||
no_proxy: ${no_proxy}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
DATAPREP_COMPONENT_NAME: "OPEA_DATAPREP_MARIADBVECTOR"
|
||||
MARIADB_CONNECTION_URL: mariadb+mariadbconnector://${MARIADB_USER}:${MARIADB_PASSWORD}@mariadb-server:3306/${MARIADB_DATABASE}
|
||||
TEI_ENDPOINT: http://tei-embedding-service:80
|
||||
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:5000/v1/health_check || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 50
|
||||
restart: unless-stopped
|
||||
tei-embedding-service:
|
||||
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
|
||||
container_name: tei-embedding-server
|
||||
ports:
|
||||
- "6006:80"
|
||||
volumes:
|
||||
- "${MODEL_CACHE:-./data}:/data"
|
||||
shm_size: 1g
|
||||
environment:
|
||||
no_proxy: ${no_proxy}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
|
||||
retriever:
|
||||
image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
|
||||
container_name: retriever-mariadb-vector
|
||||
depends_on:
|
||||
mariadb-server:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "7000:7000"
|
||||
ipc: host
|
||||
environment:
|
||||
no_proxy: ${no_proxy}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
MARIADB_CONNECTION_URL: mariadb+mariadbconnector://${MARIADB_USER}:${MARIADB_PASSWORD}@mariadb-server:3306/${MARIADB_DATABASE}
|
||||
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
|
||||
LOGFLAG: ${LOGFLAG}
|
||||
RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_MARIADBVECTOR"
|
||||
restart: unless-stopped
|
||||
tei-reranking-service:
|
||||
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
|
||||
container_name: tei-reranking-server
|
||||
ports:
|
||||
- "8808:80"
|
||||
volumes:
|
||||
- "${MODEL_CACHE:-./data}:/data"
|
||||
shm_size: 1g
|
||||
environment:
|
||||
no_proxy: ${no_proxy}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
|
||||
HF_HUB_DISABLE_PROGRESS_BARS: 1
|
||||
HF_HUB_ENABLE_HF_TRANSFER: 0
|
||||
command: --model-id ${RERANK_MODEL_ID} --auto-truncate
|
||||
vllm-service:
|
||||
image: ${REGISTRY:-opea}/vllm:${TAG:-latest}
|
||||
container_name: vllm-service
|
||||
ports:
|
||||
- "9009:80"
|
||||
volumes:
|
||||
- "${MODEL_CACHE:-./data}:/root/.cache/huggingface/hub"
|
||||
shm_size: 128g
|
||||
environment:
|
||||
no_proxy: ${no_proxy}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
HF_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
|
||||
LLM_MODEL_ID: ${LLM_MODEL_ID}
|
||||
VLLM_TORCH_PROFILER_DIR: "/mnt"
|
||||
VLLM_CPU_KVCACHE_SPACE: 40
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://$host_ip:9009/health || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 100
|
||||
command: --model $LLM_MODEL_ID --host 0.0.0.0 --port 80
|
||||
chatqna-xeon-backend-server:
|
||||
image: ${REGISTRY:-opea}/chatqna:${TAG:-latest}
|
||||
container_name: chatqna-xeon-backend-server
|
||||
depends_on:
|
||||
mariadb-server:
|
||||
condition: service_healthy
|
||||
dataprep-mariadb-vector:
|
||||
condition: service_healthy
|
||||
tei-embedding-service:
|
||||
condition: service_started
|
||||
retriever:
|
||||
condition: service_started
|
||||
tei-reranking-service:
|
||||
condition: service_started
|
||||
vllm-service:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8888:8888"
|
||||
environment:
|
||||
- no_proxy=${no_proxy}
|
||||
- https_proxy=${https_proxy}
|
||||
- http_proxy=${http_proxy}
|
||||
- MEGA_SERVICE_HOST_IP=chatqna-xeon-backend-server
|
||||
- EMBEDDING_SERVER_HOST_IP=tei-embedding-service
|
||||
- EMBEDDING_SERVER_PORT=${EMBEDDING_SERVER_PORT:-80}
|
||||
- RETRIEVER_SERVICE_HOST_IP=retriever
|
||||
- RERANK_SERVER_HOST_IP=tei-reranking-service
|
||||
- RERANK_SERVER_PORT=${RERANK_SERVER_PORT:-80}
|
||||
- LLM_SERVER_HOST_IP=vllm-service
|
||||
- LLM_SERVER_PORT=80
|
||||
- LLM_MODEL=${LLM_MODEL_ID}
|
||||
- LOGFLAG=${LOGFLAG}
|
||||
ipc: host
|
||||
restart: always
|
||||
chatqna-xeon-ui-server:
|
||||
image: ${REGISTRY:-opea}/chatqna-ui:${TAG:-latest}
|
||||
container_name: chatqna-xeon-ui-server
|
||||
depends_on:
|
||||
- chatqna-xeon-backend-server
|
||||
ports:
|
||||
- "5173:5173"
|
||||
environment:
|
||||
- no_proxy=${no_proxy}
|
||||
- https_proxy=${https_proxy}
|
||||
- http_proxy=${http_proxy}
|
||||
ipc: host
|
||||
restart: always
|
||||
chatqna-xeon-nginx-server:
|
||||
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
|
||||
container_name: chatqna-xeon-nginx-server
|
||||
depends_on:
|
||||
- chatqna-xeon-backend-server
|
||||
- chatqna-xeon-ui-server
|
||||
ports:
|
||||
- "${NGINX_PORT:-80}:80"
|
||||
environment:
|
||||
- no_proxy=${no_proxy}
|
||||
- https_proxy=${https_proxy}
|
||||
- http_proxy=${http_proxy}
|
||||
- FRONTEND_SERVICE_IP=chatqna-xeon-ui-server
|
||||
- FRONTEND_SERVICE_PORT=5173
|
||||
- BACKEND_SERVICE_NAME=chatqna
|
||||
- BACKEND_SERVICE_IP=chatqna-xeon-backend-server
|
||||
- BACKEND_SERVICE_PORT=8888
|
||||
- DATAPREP_SERVICE_IP=dataprep-mariadb-vector
|
||||
- DATAPREP_SERVICE_PORT=5000
|
||||
ipc: host
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2025 MariaDB Foundation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
if [ -z "${HUGGINGFACEHUB_API_TOKEN}" ]; then
|
||||
echo "Error: HUGGINGFACEHUB_API_TOKEN is not set. Please set HUGGINGFACEHUB_API_TOKEN."
|
||||
fi
|
||||
|
||||
export host_ip=$(hostname -I | awk '{print $1}')
|
||||
export MARIADB_DATABASE="vectordb"
|
||||
export MARIADB_USER="chatqna"
|
||||
export MARIADB_PASSWORD="password"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
|
||||
export LOGFLAG=""
|
||||
export no_proxy="$no_proxy,chatqna-xeon-ui-server,chatqna-xeon-backend-server,dataprep-redis-service,tei-embedding-service,retriever,tei-reranking-service,tgi-service,vllm-service,jaeger,prometheus,grafana,node-exporter"
|
||||
export LLM_SERVER_PORT=9000
|
||||
export NGINX_PORT=80
|
||||
@@ -24,8 +24,8 @@ function build_docker_images() {
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="chatqna chatqna-ui dataprep retriever llm-faqgen vllm-gaudi nginx"
|
||||
|
||||
@@ -24,8 +24,8 @@ function build_docker_images() {
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="chatqna chatqna-ui dataprep retriever vllm-gaudi guardrails nginx"
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2025 MariaDB Foundation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
IMAGE_REPO=${IMAGE_REPO:-"opea"}
|
||||
IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||
export REGISTRY=${IMAGE_REPO}
|
||||
export TAG=${IMAGE_TAG}
|
||||
export MODEL_CACHE=${model_cache:-"./data"}
|
||||
|
||||
WORKPATH=$(dirname "$PWD")
|
||||
LOG_PATH="$WORKPATH/tests"
|
||||
ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
git clone https://github.com/vllm-project/vllm.git && cd vllm
|
||||
VLLM_VER="v0.8.3"
|
||||
echo "Check out vLLM tag ${VLLM_VER}"
|
||||
git checkout ${VLLM_VER} &> /dev/null
|
||||
# make sure NOT change the pwd
|
||||
cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="chatqna chatqna-ui dataprep retriever vllm nginx"
|
||||
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker images && sleep 1s
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon
|
||||
export MARIADB_DATABASE="vectordb"
|
||||
export MARIADB_USER="chatqna"
|
||||
export MARIADB_PASSWORD="test"
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export host_ip=${ip_address}
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f compose_mariadb.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
n=0
|
||||
until [[ "$n" -ge 100 ]]; do
|
||||
docker logs vllm-service > ${LOG_PATH}/vllm_service_start.log 2>&1
|
||||
if grep -q complete ${LOG_PATH}/vllm_service_start.log; then
|
||||
break
|
||||
fi
|
||||
sleep 5s
|
||||
n=$((n+1))
|
||||
done
|
||||
}
|
||||
|
||||
function validate_service() {
|
||||
local URL="$1"
|
||||
local EXPECTED_RESULT="$2"
|
||||
local SERVICE_NAME="$3"
|
||||
local DOCKER_NAME="$4"
|
||||
local INPUT_DATA="$5"
|
||||
|
||||
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL")
|
||||
if [ "$HTTP_STATUS" -eq 200 ]; then
|
||||
echo "[ $SERVICE_NAME ] HTTP status is 200. Checking content..."
|
||||
|
||||
local CONTENT=$(curl -s -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL" | tee ${LOG_PATH}/${SERVICE_NAME}.log)
|
||||
|
||||
if echo "$CONTENT" | grep -q "$EXPECTED_RESULT"; then
|
||||
echo "[ $SERVICE_NAME ] Content is as expected."
|
||||
else
|
||||
echo "[ $SERVICE_NAME ] Content does not match the expected result: $CONTENT"
|
||||
docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "[ $SERVICE_NAME ] HTTP status is not 200. Received status was $HTTP_STATUS"
|
||||
docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log
|
||||
exit 1
|
||||
fi
|
||||
sleep 1s
|
||||
}
|
||||
|
||||
function validate_microservices() {
|
||||
# Check if the microservices are running correctly.
|
||||
sleep 3m
|
||||
|
||||
# tei for embedding service
|
||||
validate_service \
|
||||
"${ip_address}:6006/embed" \
|
||||
"\[\[" \
|
||||
"tei-embedding" \
|
||||
"tei-embedding-server" \
|
||||
'{"inputs":"What is Deep Learning?"}'
|
||||
|
||||
# retrieval microservice
|
||||
test_embedding=$(python3 -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)")
|
||||
validate_service \
|
||||
"${ip_address}:7000/v1/retrieval" \
|
||||
" " \
|
||||
"retrieval" \
|
||||
"retriever-mariadb-vector" \
|
||||
"{\"text\":\"What is the revenue of Nike in 2023?\",\"embedding\":${test_embedding}}"
|
||||
|
||||
# tei for rerank microservice
|
||||
validate_service \
|
||||
"${ip_address}:8808/rerank" \
|
||||
'{"index":1,"score":' \
|
||||
"tei-rerank" \
|
||||
"tei-reranking-server" \
|
||||
'{"query":"What is Deep Learning?", "texts": ["Deep Learning is not...", "Deep learning is..."]}'
|
||||
|
||||
# vllm for llm service
|
||||
validate_service \
|
||||
"${ip_address}:9009/v1/chat/completions" \
|
||||
"content" \
|
||||
"vllm-llm" \
|
||||
"vllm-service" \
|
||||
'{"model": "meta-llama/Meta-Llama-3-8B-Instruct", "messages": [{"role": "user", "content": "What is Deep Learning?"}], "max_tokens": 17}'
|
||||
}
|
||||
|
||||
function validate_megaservice() {
|
||||
# Curl the Mega Service
|
||||
validate_service \
|
||||
"${ip_address}:8888/v1/chatqna" \
|
||||
"Nike" \
|
||||
"mega-chatqna" \
|
||||
"chatqna-xeon-backend-server" \
|
||||
'{"messages": "What is the revenue of Nike in 2023?"}'
|
||||
|
||||
}
|
||||
|
||||
function stop_docker() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon
|
||||
docker compose -f compose_mariadb.yaml down
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
|
||||
}
|
||||
|
||||
main
|
||||
@@ -24,8 +24,8 @@ function build_docker_images() {
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="chatqna chatqna-ui dataprep retriever vllm-gaudi nginx"
|
||||
|
||||
@@ -24,8 +24,8 @@ function build_docker_images() {
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="chatqna chatqna-ui dataprep retriever vllm-gaudi nginx"
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
ARG IMAGE_REPO=opea
|
||||
ARG BASE_TAG=latest
|
||||
FROM $IMAGE_REPO/comps-base:$BASE_TAG
|
||||
FROM opea/comps-base:$BASE_TAG
|
||||
|
||||
COPY ./codegen.py $HOME/codegen.py
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ services:
|
||||
codegen:
|
||||
build:
|
||||
args:
|
||||
IMAGE_REPO: ${REGISTRY}
|
||||
BASE_TAG: ${TAG}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
no_proxy: ${no_proxy}
|
||||
@@ -41,7 +39,6 @@ services:
|
||||
build:
|
||||
context: GenAIComps
|
||||
dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu
|
||||
extends: codegen
|
||||
image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest}
|
||||
vllm:
|
||||
build:
|
||||
|
||||
@@ -27,19 +27,25 @@ export no_proxy=${no_proxy},${ip_address}
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
# Download Gaudi vllm of latest tag
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
echo "Check out vLLM tag ${VLLM_FORK_VER}"
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
echo "Check out vLLM tag ${VLLM_VER}"
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="codegen codegen-gradio-ui llm-textgen vllm-gaudi dataprep retriever embedding"
|
||||
@@ -244,36 +250,24 @@ function main() {
|
||||
stop_docker "${docker_compose_profiles[${i}]}"
|
||||
done
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
# build docker images
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
# loop all profiles
|
||||
for ((i = 0; i < len_profiles; i++)); do
|
||||
echo "Process [${i}]: ${docker_compose_profiles[$i]}, ${docker_llm_container_names[${i}]}"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services "${docker_compose_profiles[${i}]}" "${docker_llm_container_names[${i}]}"
|
||||
echo "::endgroup::"
|
||||
docker ps -a
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices "${docker_llm_container_names[${i}]}"
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_gradio"
|
||||
validate_gradio
|
||||
echo "::endgroup::"
|
||||
|
||||
stop_docker "${docker_compose_profiles[${i}]}"
|
||||
sleep 5s
|
||||
done
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
@@ -17,13 +17,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="codegen codegen-ui llm-textgen"
|
||||
@@ -158,35 +164,18 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
cd $WORKPATH
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,19 @@ export no_proxy=${no_proxy},${ip_address}
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
git clone https://github.com/vllm-project/vllm.git && cd vllm
|
||||
VLLM_VER="v0.8.3"
|
||||
@@ -250,28 +256,17 @@ function main() {
|
||||
for ((i = 0; i < len_profiles; i++)); do
|
||||
echo "Process [${i}]: ${docker_compose_profiles[$i]}, ${docker_llm_container_names[${i}]}"
|
||||
docker ps -a
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services "${docker_compose_profiles[${i}]}" "${docker_llm_container_names[${i}]}"
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices "${docker_llm_container_names[${i}]}"
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_gradio"
|
||||
validate_gradio
|
||||
echo "::endgroup::"
|
||||
|
||||
stop_docker "${docker_compose_profiles[${i}]}"
|
||||
sleep 5s
|
||||
done
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
@@ -17,13 +17,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="vllm-rocm llm-textgen codegen codegen-ui"
|
||||
@@ -158,35 +164,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
cd $WORKPATH
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
ARG IMAGE_REPO=opea
|
||||
ARG BASE_TAG=latest
|
||||
FROM $IMAGE_REPO/comps-base:$BASE_TAG
|
||||
FROM opea/comps-base:$BASE_TAG
|
||||
|
||||
COPY ./code_translation.py $HOME/code_translation.py
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export http_proxy="Your_HTTP_Proxy" # http proxy if any
|
||||
export https_proxy="Your_HTTPs_Proxy" # https proxy if any
|
||||
export no_proxy=localhost,127.0.0.1,$host_ip # additional no proxies if needed
|
||||
export NGINX_PORT=${your_nginx_port} # your usable port for nginx, 80 for example
|
||||
source docker_compose/intel/set_env.sh
|
||||
source ./set_env.sh
|
||||
```
|
||||
|
||||
Consult the section on [CodeTrans Service configuration](#codetrans-configuration) for information on how service specific configuration parameters affect deployments.
|
||||
|
||||
@@ -46,7 +46,7 @@ export http_proxy="Your_HTTP_Proxy" # http proxy if any
|
||||
export https_proxy="Your_HTTPs_Proxy" # https proxy if any
|
||||
export no_proxy=localhost,127.0.0.1,$host_ip # additional no proxies if needed
|
||||
export NGINX_PORT=${your_nginx_port} # your usable port for nginx, 80 for example
|
||||
source docker_compose/intel/set_env.sh
|
||||
source ./set_env.sh
|
||||
```
|
||||
|
||||
Consult the section on [CodeTrans Service configuration](#codetrans-configuration) for information on how service specific configuration parameters affect deployments.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
pushd "../../../" > /dev/null
|
||||
pushd "../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
@@ -5,8 +5,6 @@ services:
|
||||
codetrans:
|
||||
build:
|
||||
args:
|
||||
IMAGE_REPO: ${REGISTRY:-opea}
|
||||
BASE_TAG: ${TAG:-latest}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
no_proxy: ${no_proxy}
|
||||
@@ -47,5 +45,4 @@ services:
|
||||
build:
|
||||
context: GenAIComps
|
||||
dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu
|
||||
extends: codetrans
|
||||
image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest}
|
||||
|
||||
@@ -17,17 +17,22 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="codetrans codetrans-ui llm-textgen vllm-gaudi nginx"
|
||||
@@ -37,12 +42,12 @@ function build_docker_images() {
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel
|
||||
cd $WORKPATH/docker_compose
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export NGINX_PORT=80
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
cd hpu/gaudi
|
||||
cd intel/hpu/gaudi
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
@@ -155,35 +160,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="codetrans codetrans-ui llm-textgen nginx"
|
||||
@@ -155,35 +161,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,14 +17,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
git clone https://github.com/vllm-project/vllm.git && cd vllm
|
||||
VLLM_VER="v0.8.3"
|
||||
echo "Check out vLLM tag ${VLLM_VER}"
|
||||
@@ -39,13 +44,13 @@ function build_docker_images() {
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel
|
||||
cd $WORKPATH/docker_compose
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
|
||||
export NGINX_PORT=80
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
cd cpu/xeon/
|
||||
cd intel/cpu/xeon/
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
@@ -158,35 +163,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="codetrans codetrans-ui llm-textgen nginx"
|
||||
@@ -34,13 +40,13 @@ function build_docker_images() {
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel
|
||||
cd $WORKPATH/docker_compose
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
|
||||
export NGINX_PORT=80
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
cd hpu/gaudi/
|
||||
cd intel/hpu/gaudi/
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
@@ -161,35 +167,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="codetrans codetrans-ui llm-textgen nginx"
|
||||
@@ -34,13 +40,13 @@ function build_docker_images() {
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel
|
||||
cd $WORKPATH/docker_compose
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
|
||||
export NGINX_PORT=80
|
||||
export host_ip=${ip_address}
|
||||
source set_env.sh
|
||||
cd cpu/xeon/
|
||||
cd intel/cpu/xeon/
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
|
||||
|
||||
@@ -161,35 +167,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,19 @@ ip_address=$(hostname -I | awk '{print $1}')
|
||||
|
||||
function build_docker_images() {
|
||||
opea_branch=${opea_branch:-"main"}
|
||||
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
|
||||
if [[ "${opea_branch}" != "main" ]]; then
|
||||
cd $WORKPATH
|
||||
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
|
||||
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
|
||||
find . -type f -name "Dockerfile*" | while read -r file; do
|
||||
echo "Processing file: $file"
|
||||
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
cd $WORKPATH/docker_image_build
|
||||
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="vllm-rocm llm-textgen codetrans codetrans-ui nginx"
|
||||
@@ -154,35 +160,17 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservices"
|
||||
validate_microservices
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,8 @@
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pushd "../../" > /dev/null
|
||||
ls -l
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export host_ip=${ip_address}
|
||||
export DBQNA_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export host_ip=""
|
||||
export DBQNA_HUGGINGFACEHUB_API_TOKEN=""
|
||||
export DBQNA_TGI_SERVICE_PORT=8008
|
||||
export DBQNA_TGI_LLM_ENDPOINT="http://${host_ip}:${DBQNA_TGI_SERVICE_PORT}"
|
||||
export DBQNA_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3"
|
||||
@@ -19,4 +14,3 @@ export POSTGRES_PASSWORD="testpwd"
|
||||
export POSTGRES_DB="chinook"
|
||||
export DBQNA_TEXT_TO_SQL_PORT=9090
|
||||
export DBQNA_UI_PORT=5174
|
||||
export build_texttosql_url="${ip_address}:${DBQNA_TEXT_TO_SQL_PORT}/v1"
|
||||
|
||||
19
DBQnA/docker_compose/intel/cpu/xeon/set_env.sh
Executable file → Normal file
19
DBQnA/docker_compose/intel/cpu/xeon/set_env.sh
Executable file → Normal file
@@ -2,19 +2,26 @@
|
||||
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export host_ip=${ip_address}
|
||||
#export host_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
if [ -z "${HUGGINGFACEHUB_API_TOKEN}" ]; then
|
||||
echo "Error: HUGGINGFACEHUB_API_TOKEN is not set. Please set HUGGINGFACEHUB_API_TOKEN."
|
||||
fi
|
||||
|
||||
if [ -z "${host_ip}" ]; then
|
||||
echo "Error: host_ip is not set. Please set host_ip first."
|
||||
fi
|
||||
export no_proxy=$no_proxy,$host_ip,dbqna-xeon-react-ui-server,text2sql-service,tgi-service,postgres-container
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export HF_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export TGI_PORT=8008
|
||||
export TGI_LLM_ENDPOINT="http://${host_ip}:${TGI_PORT}"
|
||||
export LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3"
|
||||
export POSTGRES_USER=postgres
|
||||
export POSTGRES_PASSWORD=testpwd
|
||||
export POSTGRES_DB=chinook
|
||||
export TGI_PORT=8008
|
||||
export TEXT2SQL_PORT=9090
|
||||
export TGI_LLM_ENDPOINT="http://${host_ip}:${TGI_PORT}"
|
||||
export LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3"
|
||||
"set_env.sh" 27L, 974B
|
||||
|
||||
11
DBQnA/docker_compose/set_env.sh
Executable file
11
DBQnA/docker_compose/set_env.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
pushd "../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export TGI_PORT=8008
|
||||
export TGI_LLM_ENDPOINT="http://${your_ip}:${TGI_PORT}"
|
||||
export LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3"
|
||||
@@ -7,8 +7,6 @@ services:
|
||||
context: GenAIComps
|
||||
dockerfile: comps/text2sql/src/Dockerfile
|
||||
args:
|
||||
IMAGE_REPO: ${REGISTRY:-opea}
|
||||
BASE_TAG: ${TAG:-latest}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
no_proxy: ${no_proxy}
|
||||
@@ -18,6 +16,8 @@ services:
|
||||
context: ../ui
|
||||
dockerfile: ./docker/Dockerfile.react
|
||||
args:
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
no_proxy: ${no_proxy}
|
||||
texttosql_url: ${build_texttosql_url}
|
||||
extends: text2sql
|
||||
image: ${REGISTRY:-opea}/text2sql-react-ui:${TAG:-latest}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# DBQnA E2E test scripts
|
||||
|
||||
## Set the required environment variable
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
## Run test
|
||||
|
||||
On Intel Xeon with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_xeon.sh
|
||||
```
|
||||
|
||||
On AMD ROCm with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_rocm.sh
|
||||
```
|
||||
@@ -4,20 +4,24 @@
|
||||
|
||||
set -xe
|
||||
|
||||
IMAGE_REPO=${IMAGE_REPO:-"opea"}
|
||||
IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||
export REGISTRY=${IMAGE_REPO}
|
||||
export TAG=${IMAGE_TAG}
|
||||
|
||||
WORKPATH=$(dirname "$PWD")
|
||||
LOG_PATH="$WORKPATH/tests"
|
||||
ip_address=$(hostname -I | awk '{print $1}')
|
||||
tgi_port=8008
|
||||
tgi_volume=$WORKPATH/data
|
||||
|
||||
export host_ip=${ip_address}
|
||||
source $WORKPATH/docker_compose/amd/gpu/rocm/set_env.sh
|
||||
|
||||
export DBQNA_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export DBQNA_TGI_SERVICE_PORT=8008
|
||||
export DBQNA_TGI_LLM_ENDPOINT="http://${host_ip}:${DBQNA_TGI_SERVICE_PORT}"
|
||||
export DBQNA_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3"
|
||||
export MODEL_ID=${DBQNA_LLM_MODEL_ID}
|
||||
export POSTGRES_USER="postgres"
|
||||
export POSTGRES_PASSWORD="testpwd"
|
||||
export POSTGRES_DB="chinook"
|
||||
export DBQNA_TEXT_TO_SQL_PORT=9090
|
||||
export DBQNA_UI_PORT=5174
|
||||
export build_texttosql_url="${ip_address}:${DBQNA_TEXT_TO_SQL_PORT}/v1"
|
||||
export MODEL_CACHE=${model_cache:-"/var/lib/GenAI/data"}
|
||||
|
||||
function build_docker_images() {
|
||||
@@ -32,7 +36,7 @@ function build_docker_images() {
|
||||
docker images && sleep 1s
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
function start_service() {
|
||||
cd "$WORKPATH"/docker_compose/amd/gpu/rocm
|
||||
# Start Docker Containers
|
||||
docker compose up -d > "${LOG_PATH}"/start_services_with_compose.log
|
||||
@@ -53,8 +57,7 @@ function validate_microservice() {
|
||||
-d '{"input_text": "Find the total number of Albums.","conn_str": {"user": "'${POSTGRES_USER}'","password": "'${POSTGRES_PASSWORD}'","host": "'${ip_address}'", "port": "5442", "database": "'${POSTGRES_DB}'" }}' \
|
||||
-H 'Content-Type: application/json')
|
||||
|
||||
if echo "$result" | jq -e '.result.output' > /dev/null 2>&1; then
|
||||
# if [[ $result == *"output"* ]]; then
|
||||
if [[ $result == *"output"* ]]; then
|
||||
echo $result
|
||||
echo "Result correct."
|
||||
else
|
||||
@@ -102,31 +105,16 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservice"
|
||||
build_docker_images
|
||||
start_service
|
||||
sleep 10s
|
||||
validate_microservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ export MODEL_CACHE=${model_cache:-"./data"}
|
||||
WORKPATH=$(dirname "$PWD")
|
||||
LOG_PATH="$WORKPATH/tests"
|
||||
ip_address=$(hostname -I | awk '{print $1}')
|
||||
tgi_port=8008
|
||||
|
||||
function build_docker_images() {
|
||||
cd $WORKPATH/docker_image_build
|
||||
@@ -27,9 +28,16 @@ function build_docker_images() {
|
||||
docker images && sleep 1s
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
function start_service() {
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon
|
||||
source ./set_env.sh
|
||||
export model="mistralai/Mistral-7B-Instruct-v0.3"
|
||||
export LLM_MODEL_ID=${model}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export POSTGRES_USER=postgres
|
||||
export POSTGRES_PASSWORD=testpwd
|
||||
export POSTGRES_DB=chinook
|
||||
export TEXT2SQL_PORT=9090
|
||||
export TGI_LLM_ENDPOINT="http://${ip_address}:${tgi_port}"
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f compose.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
@@ -52,8 +60,7 @@ function validate_microservice() {
|
||||
-d '{"input_text": "Find the total number of Albums.","conn_str": {"user": "'${POSTGRES_USER}'","password": "'${POSTGRES_PASSWORD}'","host": "'${ip_address}'", "port": "5442", "database": "'${POSTGRES_DB}'" }}' \
|
||||
-H 'Content-Type: application/json')
|
||||
|
||||
if echo "$result" | jq -e '.result.output' > /dev/null 2>&1; then
|
||||
# if [[ $result == *"output"* ]]; then
|
||||
if [[ $result == *"output"* ]]; then
|
||||
echo $result
|
||||
echo "Result correct."
|
||||
else
|
||||
@@ -101,31 +108,16 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
build_docker_images
|
||||
start_service
|
||||
|
||||
echo "::group::start_services"
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_microservice"
|
||||
validate_microservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_frontend"
|
||||
validate_frontend
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
ARG IMAGE_REPO=opea
|
||||
ARG BASE_TAG=latest
|
||||
FROM $IMAGE_REPO/comps-base:$BASE_TAG
|
||||
FROM opea/comps-base:$BASE_TAG
|
||||
|
||||
COPY ./retrieval_tool.py $HOME/retrieval_tool.py
|
||||
|
||||
|
||||
@@ -5,25 +5,3 @@
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
ip_address=$(hostname -I | awk '{print $1}')
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:6006"
|
||||
export TEI_RERANKING_ENDPOINT="http://${ip_address}:8808"
|
||||
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
|
||||
export RETRIEVER_SERVICE_HOST_IP=${ip_address}
|
||||
export RERANK_SERVICE_HOST_IP=${ip_address}
|
||||
export LLM_SERVICE_HOST_IP=${ip_address}
|
||||
export host_ip=${ip_address}
|
||||
export RERANK_TYPE="tei"
|
||||
export LOGFLAG=true
|
||||
|
||||
export REDIS_URL="redis://${ip_address}:6379"
|
||||
export INDEX_NAME="rag-redis"
|
||||
|
||||
export MILVUS_HOST=${ip_address}
|
||||
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
|
||||
|
||||
@@ -5,26 +5,3 @@
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
ip_address=$(hostname -I | awk '{print $1}')
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:8090"
|
||||
export TEI_RERANKING_ENDPOINT="http://${ip_address}:8808"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
|
||||
export RETRIEVER_SERVICE_HOST_IP=${ip_address}
|
||||
export RERANK_SERVICE_HOST_IP=${ip_address}
|
||||
export host_ip=${ip_address}
|
||||
export RERANK_TYPE="tei"
|
||||
export LOGFLAG=true
|
||||
|
||||
export REDIS_URL="redis://${ip_address}:6379"
|
||||
export INDEX_NAME="rag-redis"
|
||||
|
||||
|
||||
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
|
||||
export MILVUS_HOST=${ip_address}
|
||||
export LLM_SERVICE_HOST_IP=${ip_address}
|
||||
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
|
||||
|
||||
@@ -5,8 +5,6 @@ services:
|
||||
doc-index-retriever:
|
||||
build:
|
||||
args:
|
||||
IMAGE_REPO: ${REGISTRY:-opea}
|
||||
BASE_TAG: ${TAG:-latest}
|
||||
http_proxy: ${http_proxy}
|
||||
https_proxy: ${https_proxy}
|
||||
no_proxy: ${no_proxy}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# DocIndexRetriever E2E test scripts
|
||||
|
||||
## Set the required environment variable
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
## Run test
|
||||
|
||||
On Intel Xeon with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_xeon.sh
|
||||
```
|
||||
|
||||
On Intel Gaudi with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_gaudi.sh
|
||||
```
|
||||
|
||||
On AMD ROCm with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_rocm.sh
|
||||
```
|
||||
|
||||
On AMD ROCm with vLLM:
|
||||
|
||||
```bash
|
||||
bash test_compose_vllm_on_rocm.sh
|
||||
```
|
||||
@@ -20,21 +20,38 @@ function build_docker_images() {
|
||||
if [ ! -d "GenAIComps" ] ; then
|
||||
git clone --single-branch --branch "${opea_branch:-"main"}" https://github.com/opea-project/GenAIComps.git
|
||||
fi
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
service_list="dataprep embedding retriever reranking doc-index-retriever"
|
||||
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
|
||||
docker pull ghcr.io/huggingface/tei-gaudi:1.5.0
|
||||
docker pull quay.io/coreos/etcd:v3.5.5
|
||||
docker pull minio/minio:RELEASE.2023-03-20T20-16-18Z
|
||||
docker pull milvusdb/milvus:v2.4.6
|
||||
docker images && sleep 1s
|
||||
|
||||
echo "Docker images built!"
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
echo "Starting Docker Services...."
|
||||
cd $WORKPATH/docker_compose/intel/hpu/gaudi
|
||||
source ./set_env.sh
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:8090"
|
||||
export TEI_RERANKING_ENDPOINT="http://${ip_address}:8808"
|
||||
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
|
||||
export MILVUS_HOST=${ip_address}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
|
||||
export RETRIEVER_SERVICE_HOST_IP=${ip_address}
|
||||
export RERANK_SERVICE_HOST_IP=${ip_address}
|
||||
export LLM_SERVICE_HOST_IP=${ip_address}
|
||||
export host_ip=${ip_address}
|
||||
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
|
||||
export RERANK_TYPE="tei"
|
||||
export LOGFLAG=true
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f compose_milvus.yaml up -d
|
||||
@@ -110,27 +127,19 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
echo "Dump current docker ps"
|
||||
docker ps
|
||||
start_time=$(date +%s)
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
end_time=$(date +%s)
|
||||
duration=$((end_time-start_time))
|
||||
echo "Mega service start duration is $duration s"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,21 +20,37 @@ function build_docker_images() {
|
||||
if [ ! -d "GenAIComps" ] ; then
|
||||
git clone --single-branch --branch "${opea_branch:-"main"}" https://github.com/opea-project/GenAIComps.git
|
||||
fi
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
service_list="dataprep embedding retriever reranking doc-index-retriever"
|
||||
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
|
||||
docker pull quay.io/coreos/etcd:v3.5.5
|
||||
docker pull minio/minio:RELEASE.2023-03-20T20-16-18Z
|
||||
docker pull milvusdb/milvus:v2.4.6
|
||||
docker images && sleep 1s
|
||||
|
||||
echo "Docker images built!"
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
echo "Starting Docker Services...."
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon
|
||||
source ./set_env.sh
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:6006"
|
||||
export TEI_RERANKING_ENDPOINT="http://${ip_address}:8808"
|
||||
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
|
||||
export MILVUS_HOST=${ip_address}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
|
||||
export RETRIEVER_SERVICE_HOST_IP=${ip_address}
|
||||
export RERANK_SERVICE_HOST_IP=${ip_address}
|
||||
export LLM_SERVICE_HOST_IP=${ip_address}
|
||||
export host_ip=${ip_address}
|
||||
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
|
||||
export RERANK_TYPE="tei"
|
||||
export LOGFLAG=true
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f compose_milvus.yaml up -d
|
||||
@@ -110,27 +126,19 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
echo "Dump current docker ps"
|
||||
docker ps
|
||||
start_time=$(date +%s)
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
end_time=$(date +%s)
|
||||
duration=$((end_time-start_time))
|
||||
echo "Mega service start duration is $duration s"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,21 +21,33 @@ function build_docker_images() {
|
||||
if [ ! -d "GenAIComps" ] ; then
|
||||
git clone --single-branch --branch "${opea_branch:-"main"}" https://github.com/opea-project/GenAIComps.git
|
||||
fi
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker pull redis/redis-stack:7.2.0-v9
|
||||
docker pull ghcr.io/huggingface/tei-gaudi:1.5.0
|
||||
docker images && sleep 1s
|
||||
echo "Docker images built!"
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
echo "Starting Docker Services...."
|
||||
cd $WORKPATH/docker_compose/intel/hpu/gaudi
|
||||
source ./set_env.sh
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:8090"
|
||||
export TEI_RERANKING_ENDPOINT="http://${ip_address}:8808"
|
||||
export REDIS_URL="redis://${ip_address}:6379"
|
||||
export INDEX_NAME="rag-redis"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
|
||||
export RETRIEVER_SERVICE_HOST_IP=${ip_address}
|
||||
export RERANK_SERVICE_HOST_IP=${ip_address}
|
||||
export host_ip=${ip_address}
|
||||
export RERANK_TYPE="tei"
|
||||
export LOGFLAG=true
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose up -d
|
||||
@@ -104,27 +116,19 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
echo "Dump current docker ps"
|
||||
docker ps
|
||||
start_time=$(date +%s)
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
end_time=$(date +%s)
|
||||
duration=$((end_time-start_time))
|
||||
echo "Mega service start duration is $duration s"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,21 +21,35 @@ function build_docker_images() {
|
||||
if [ ! -d "GenAIComps" ] ; then
|
||||
git clone --single-branch --branch "${opea_branch:-"main"}" https://github.com/opea-project/GenAIComps.git
|
||||
fi
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
service_list="dataprep embedding retriever reranking doc-index-retriever"
|
||||
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6
|
||||
docker pull redis/redis-stack:7.2.0-v9
|
||||
docker images && sleep 1s
|
||||
|
||||
echo "Docker images built!"
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
echo "Starting Docker Services...."
|
||||
cd $WORKPATH/docker_compose/intel/cpu/xeon
|
||||
source ./set_env.sh
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:6006"
|
||||
export TEI_RERANKING_ENDPOINT="http://${ip_address}:8808"
|
||||
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
|
||||
export REDIS_URL="redis://${ip_address}:6379"
|
||||
export INDEX_NAME="rag-redis"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
|
||||
export RETRIEVER_SERVICE_HOST_IP=${ip_address}
|
||||
export RERANK_SERVICE_HOST_IP=${ip_address}
|
||||
export LLM_SERVICE_HOST_IP=${ip_address}
|
||||
export host_ip=${ip_address}
|
||||
export RERANK_TYPE="tei"
|
||||
export LOGFLAG=true
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose up -d
|
||||
@@ -111,27 +125,20 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
echo "Dump current docker ps"
|
||||
docker ps
|
||||
|
||||
echo "::group::start_services"
|
||||
start_time=$(date +%s)
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
end_time=$(date +%s)
|
||||
duration=$((end_time-start_time))
|
||||
echo "Mega service start duration is $duration s"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@ function build_docker_images() {
|
||||
if [ ! -d "GenAIComps" ] ; then
|
||||
git clone --single-branch --branch "${opea_branch:-"main"}" https://github.com/opea-project/GenAIComps.git
|
||||
fi
|
||||
pushd GenAIComps
|
||||
echo "GenAIComps test commit is $(git rev-parse HEAD)"
|
||||
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
|
||||
popd && sleep 1s
|
||||
|
||||
service_list="dataprep embedding retriever doc-index-retriever"
|
||||
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
@@ -119,27 +114,19 @@ function stop_docker() {
|
||||
|
||||
function main() {
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::build_docker_images"
|
||||
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::start_services"
|
||||
echo "Dump current docker ps"
|
||||
docker ps
|
||||
start_time=$(date +%s)
|
||||
start_services
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::validate_megaservice"
|
||||
end_time=$(date +%s)
|
||||
duration=$((end_time-start_time))
|
||||
echo "Mega service start duration is $duration s"
|
||||
validate_megaservice
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::stop_docker"
|
||||
stop_docker
|
||||
echo "::endgroup::"
|
||||
|
||||
docker system prune -f
|
||||
echo y | docker system prune
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -239,16 +239,13 @@ curl http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-F "language=en" \
|
||||
```
|
||||
|
||||
Note that the `-F "messages="` flag is required, even for file uploads. Multiple files can be uploaded in a single call with multiple `-F "files=@/path"` inputs.
|
||||
|
||||
### Query with audio and video
|
||||
|
||||
> Audio and video can be passed as base64 strings or uploaded by providing a local file path.
|
||||
> Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI.
|
||||
|
||||
Audio:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "audio", "messages": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}'
|
||||
@@ -260,21 +257,11 @@ curl http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=audio" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp3, .wav)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
Video:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "video", "messages": "convert your video to base64 data type"}'
|
||||
@@ -286,15 +273,6 @@ curl http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=video" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp4)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
### Query with long context
|
||||
|
||||
@@ -21,35 +21,40 @@ This section describes how to quickly deploy and test the DocSum service manuall
|
||||
6. [Test the Pipeline](#test-the-pipeline)
|
||||
7. [Cleanup the Deployment](#cleanup-the-deployment)
|
||||
|
||||
### Access the Code and Set Up Environment
|
||||
### Access the Code
|
||||
|
||||
Clone the GenAIExample repository and access the ChatQnA Intel Xeon platform Docker Compose files and supporting scripts:
|
||||
|
||||
```bash
|
||||
```
|
||||
git clone https://github.com/opea-project/GenAIExamples.git
|
||||
cd GenAIExamples/DocSum/docker_compose/intel
|
||||
source set_env.sh
|
||||
cd cpu/xeon/
|
||||
cd GenAIExamples/DocSum/docker_compose/intel/cpu/xeon/
|
||||
```
|
||||
|
||||
NOTE: by default vLLM does "warmup" at start, to optimize its performance for the specified model and the underlying platform, which can take long time. For development (and e.g. autoscaling) it can be skipped with `export VLLM_SKIP_WARMUP=true`.
|
||||
Checkout a released version, such as v1.2:
|
||||
|
||||
Checkout a released version, such as v1.3:
|
||||
|
||||
```bash
|
||||
git checkout v1.3
|
||||
```
|
||||
git checkout v1.2
|
||||
```
|
||||
|
||||
### Generate a HuggingFace Access Token
|
||||
|
||||
Some HuggingFace resources, such as some models, are only accessible if you have an access token. If you do not already have a HuggingFace access token, you can create one by first creating an account by following the steps provided at [HuggingFace](https://huggingface.co/) and then generating a [user access token](https://huggingface.co/docs/transformers.js/en/guides/private#step-1-generating-a-user-access-token).
|
||||
|
||||
### Configure the Deployment Environment
|
||||
|
||||
To set up environment variables for deploying DocSum services, source the _set_env.sh_ script in this directory:
|
||||
|
||||
```
|
||||
source ./set_env.sh
|
||||
```
|
||||
|
||||
The _set_env.sh_ script will prompt for required and optional environment variables used to configure the DocSum services. If a value is not entered, the script will use a default value for the same. It will also generate a _.env_ file defining the desired configuration. Consult the section on [DocSum Service configuration](#docsum-service-configuration) for information on how service specific configuration parameters affect deployments.
|
||||
|
||||
### Deploy the Services Using Docker Compose
|
||||
|
||||
To deploy the DocSum services, execute the `docker compose up` command with the appropriate arguments. For a default deployment, execute:
|
||||
|
||||
```bash
|
||||
cd cpu/xeon/
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
@@ -73,13 +78,13 @@ Please refer to the table below to build different microservices from source:
|
||||
|
||||
After running docker compose, check if all the containers launched via docker compose have started:
|
||||
|
||||
```bash
|
||||
```
|
||||
docker ps -a
|
||||
```
|
||||
|
||||
For the default deployment, the following 5 containers should have started:
|
||||
|
||||
```bash
|
||||
```
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
748f577b3c78 opea/whisper:latest "python whisper_s…" 5 minutes ago Up About a minute 0.0.0.0:7066->7066/tcp, :::7066->7066/tcp docsum-xeon-whisper-server
|
||||
4eq8b7034fd9 opea/docsum-gradio-ui:latest "docker-entrypoint.s…" 5 minutes ago Up About a minute 0.0.0.0:5173->5173/tcp, :::5173->5173/tcp docsum-xeon-ui-server
|
||||
@@ -104,7 +109,7 @@ curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
|
||||
To stop the containers associated with the deployment, execute the following command:
|
||||
|
||||
```bash
|
||||
```
|
||||
docker compose -f compose.yaml down
|
||||
```
|
||||
|
||||
@@ -151,19 +156,16 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.txt, .docx, .pdf)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
-F "language=en" \
|
||||
```
|
||||
|
||||
Note that the `-F "messages="` flag is required, even for file uploads. Multiple files can be uploaded in a single call with multiple `-F "files=@/path"` inputs.
|
||||
|
||||
### Query with audio and video
|
||||
|
||||
> Audio and video can be passed as base64 strings or uploaded by providing a local file path.
|
||||
> Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI.
|
||||
|
||||
Audio:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "audio", "messages": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}'
|
||||
@@ -175,21 +177,11 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=audio" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp3, .wav)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
Video:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "video", "messages": "convert your video to base64 data type"}'
|
||||
@@ -201,15 +193,6 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=video" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp4)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
### Query with long context
|
||||
|
||||
@@ -23,35 +23,40 @@ This section describes how to quickly deploy and test the DocSum service manuall
|
||||
6. [Test the Pipeline](#test-the-pipeline)
|
||||
7. [Cleanup the Deployment](#cleanup-the-deployment)
|
||||
|
||||
### Access the Code and Set Up Environment
|
||||
### Access the Code
|
||||
|
||||
Clone the GenAIExample repository and access the DocSum Intel® Gaudi® platform Docker Compose files and supporting scripts:
|
||||
Clone the GenAIExample repository and access the ChatQnA Intel® Gaudi® platform Docker Compose files and supporting scripts:
|
||||
|
||||
```bash
|
||||
```
|
||||
git clone https://github.com/opea-project/GenAIExamples.git
|
||||
cd GenAIExamples/DocSum/docker_compose/intel
|
||||
source set_env.sh
|
||||
cd hpu/gaudi/
|
||||
cd GenAIExamples/DocSum/docker_compose/intel/hpu/gaudi/
|
||||
```
|
||||
|
||||
NOTE: by default vLLM does "warmup" at start, to optimize its performance for the specified model and the underlying platform, which can take long time. For development (and e.g. autoscaling) it can be skipped with `export VLLM_SKIP_WARMUP=true`.
|
||||
Checkout a released version, such as v1.2:
|
||||
|
||||
Checkout a released version, such as v1.3:
|
||||
|
||||
```bash
|
||||
git checkout v1.3
|
||||
```
|
||||
git checkout v1.2
|
||||
```
|
||||
|
||||
### Generate a HuggingFace Access Token
|
||||
|
||||
Some HuggingFace resources, such as some models, are only accessible if you have an access token. If you do not already have a HuggingFace access token, you can create one by first creating an account by following the steps provided at [HuggingFace](https://huggingface.co/) and then generating a [user access token](https://huggingface.co/docs/transformers.js/en/guides/private#step-1-generating-a-user-access-token).
|
||||
|
||||
### Configure the Deployment Environment
|
||||
|
||||
To set up environment variables for deploying DocSum services, source the _set_env.sh_ script in this directory:
|
||||
|
||||
```
|
||||
source ./set_env.sh
|
||||
```
|
||||
|
||||
The _set_env.sh_ script will prompt for required and optional environment variables used to configure the DocSum services. If a value is not entered, the script will use a default value for the same. It will also generate a _.env_ file defining the desired configuration. Consult the section on [DocSum Service configuration](#docsum-service-configuration) for information on how service specific configuration parameters affect deployments.
|
||||
|
||||
### Deploy the Services Using Docker Compose
|
||||
|
||||
To deploy the DocSum services, execute the `docker compose up` command with the appropriate arguments. For a default deployment, execute:
|
||||
|
||||
```bash
|
||||
cd hpu/gaudi/
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
@@ -75,13 +80,13 @@ Please refer to the table below to build different microservices from source:
|
||||
|
||||
After running docker compose, check if all the containers launched via docker compose have started:
|
||||
|
||||
```bash
|
||||
```
|
||||
docker ps -a
|
||||
```
|
||||
|
||||
For the default deployment, the following 5 containers should have started:
|
||||
|
||||
```bash
|
||||
```
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
748f577b3c78 opea/whisper:latest "python whisper_s…" 5 minutes ago Up About a minute 0.0.0.0:7066->7066/tcp, :::7066->7066/tcp docsum-gaudi-whisper-server
|
||||
4eq8b7034fd9 opea/docsum-gradio-ui:latest "docker-entrypoint.s…" 5 minutes ago Up About a minute 0.0.0.0:5173->5173/tcp, :::5173->5173/tcp docsum-gaudi-ui-server
|
||||
@@ -106,7 +111,7 @@ curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
|
||||
To stop the containers associated with the deployment, execute the following command:
|
||||
|
||||
```bash
|
||||
```
|
||||
docker compose -f compose.yaml down
|
||||
```
|
||||
|
||||
@@ -156,16 +161,13 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "language=en" \
|
||||
```
|
||||
|
||||
Note that the `-F "messages="` flag is required, even for file uploads. Multiple files can be uploaded in a single call with multiple `-F "files=@/path"` inputs.
|
||||
|
||||
### Query with audio and video
|
||||
|
||||
> Audio and video can be passed as base64 strings or uploaded by providing a local file path.
|
||||
> Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI.
|
||||
|
||||
Audio:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "audio", "messages": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}'
|
||||
@@ -177,21 +179,11 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=audio" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp3, .wav)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
Video:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "video", "messages": "convert your video to base64 data type"}'
|
||||
@@ -203,15 +195,6 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=video" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp4)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
### Query with long context
|
||||
|
||||
@@ -18,7 +18,6 @@ services:
|
||||
OMPI_MCA_btl_vader_single_copy_mechanism: none
|
||||
LLM_MODEL_ID: ${LLM_MODEL_ID}
|
||||
NUM_CARDS: ${NUM_CARDS}
|
||||
VLLM_SKIP_WARMUP: ${VLLM_SKIP_WARMUP:-false}
|
||||
VLLM_TORCH_PROFILER_DIR: "/mnt"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:80/health || exit 1"]
|
||||
|
||||
@@ -6,10 +6,10 @@ pushd "../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export host_ip=$(hostname -I | awk '{print $1}') # Example: host_ip="192.168.1.1"
|
||||
export no_proxy="${no_proxy},${host_ip}" # Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1"
|
||||
export http_proxy=$http_proxy
|
||||
export https_proxy=$https_proxy
|
||||
export host_ip=$(hostname -I | awk '{print $1}') # Example: host_ip="192.168.1.1"
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
|
||||
export LLM_ENDPOINT_PORT=8008
|
||||
@@ -29,8 +29,3 @@ export BACKEND_SERVICE_PORT=8888
|
||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
||||
|
||||
export LOGFLAG=True
|
||||
|
||||
export NUM_CARDS=1
|
||||
export BLOCK_SIZE=128
|
||||
export MAX_NUM_SEQS=256
|
||||
export MAX_SEQ_LEN_TO_CAPTURE=2048
|
||||
@@ -63,20 +63,6 @@ def read_pdf(file):
|
||||
return docs
|
||||
|
||||
|
||||
def encode_file_to_base64(file_path):
|
||||
"""Encode the content of a file to a base64 string.
|
||||
|
||||
Args:
|
||||
file_path (str): The path to the file to be encoded.
|
||||
|
||||
Returns:
|
||||
str: The base64 encoded string of the file content.
|
||||
"""
|
||||
with open(file_path, "rb") as f:
|
||||
base64_str = base64.b64encode(f.read()).decode("utf-8")
|
||||
return base64_str
|
||||
|
||||
|
||||
def video2audio(
|
||||
video_base64: str,
|
||||
) -> str:
|
||||
@@ -177,6 +163,7 @@ class DocSumService:
|
||||
|
||||
async def handle_request(self, request: Request, files: List[UploadFile] = File(default=None)):
|
||||
"""Accept pure text, or files .txt/.pdf.docx, audio/video base64 string."""
|
||||
|
||||
if "application/json" in request.headers.get("content-type"):
|
||||
data = await request.json()
|
||||
stream_opt = data.get("stream", True)
|
||||
@@ -206,24 +193,25 @@ class DocSumService:
|
||||
uid = str(uuid.uuid4())
|
||||
file_path = f"/tmp/{uid}"
|
||||
|
||||
import aiofiles
|
||||
if data_type is not None and data_type in ["audio", "video"]:
|
||||
raise ValueError(
|
||||
"Audio and Video file uploads are not supported in docsum with curl request, \
|
||||
please use the UI or pass base64 string of the content directly."
|
||||
)
|
||||
|
||||
async with aiofiles.open(file_path, "wb") as f:
|
||||
await f.write(await file.read())
|
||||
else:
|
||||
import aiofiles
|
||||
|
||||
async with aiofiles.open(file_path, "wb") as f:
|
||||
await f.write(await file.read())
|
||||
|
||||
if data_type == "text":
|
||||
docs = read_text_from_file(file, file_path)
|
||||
elif data_type in ["audio", "video"]:
|
||||
docs = encode_file_to_base64(file_path)
|
||||
else:
|
||||
raise ValueError(f"Data type not recognized: {data_type}")
|
||||
os.remove(file_path)
|
||||
|
||||
os.remove(file_path)
|
||||
|
||||
if isinstance(docs, list):
|
||||
file_summaries.extend(docs)
|
||||
else:
|
||||
file_summaries.append(docs)
|
||||
if isinstance(docs, list):
|
||||
file_summaries.extend(docs)
|
||||
else:
|
||||
file_summaries.append(docs)
|
||||
|
||||
if file_summaries:
|
||||
prompt = handle_message(chat_request.messages) + "\n".join(file_summaries)
|
||||
|
||||
@@ -147,7 +147,7 @@ nano ~/docsum-k8s-install/GenAIExamples/DocSum/kubernetes/helm/rocm-tgi-values.y
|
||||
#### If ROCm vLLM used
|
||||
```bash
|
||||
cd ~/docsum-k8s-install/GenAIInfra/helm-charts
|
||||
scripts/update_dependency.sh
|
||||
./update_dependency.sh
|
||||
helm dependency update docsum
|
||||
helm upgrade --install docsum docsum \
|
||||
--set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} \
|
||||
@@ -157,7 +157,7 @@ helm upgrade --install docsum docsum \
|
||||
#### If ROCm TGI used
|
||||
```bash
|
||||
cd ~/docsum-k8s-install/GenAIInfra/helm-charts
|
||||
scripts/update_dependency.sh
|
||||
./update_dependency.sh
|
||||
helm dependency update docsum
|
||||
helm upgrade --install docsum docsum \
|
||||
--set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} \
|
||||
|
||||
@@ -16,7 +16,7 @@ echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||
export REGISTRY=${IMAGE_REPO}
|
||||
export TAG=${IMAGE_TAG}
|
||||
source $WORKPATH/docker_compose/intel/set_env.sh
|
||||
source $WORKPATH/docker_compose/set_env.sh
|
||||
|
||||
export MODEL_CACHE=${model_cache:-"./data"}
|
||||
|
||||
@@ -50,8 +50,8 @@ function build_docker_images() {
|
||||
popd && sleep 1s
|
||||
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null && cd ../
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="docsum docsum-gradio-ui whisper llm-docsum vllm-gaudi"
|
||||
@@ -237,20 +237,6 @@ function validate_megaservice_multimedia() {
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking audio data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"well" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"media" "" \
|
||||
"type=audio" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.wav" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in json format"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
@@ -272,20 +258,6 @@ function validate_megaservice_multimedia() {
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"bye" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"media" "" \
|
||||
"type=video" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.mp4" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
}
|
||||
|
||||
function validate_megaservice_long_text() {
|
||||
|
||||
@@ -17,7 +17,7 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||
export REGISTRY=${IMAGE_REPO}
|
||||
export TAG=${IMAGE_TAG}
|
||||
|
||||
source $WORKPATH/docker_compose/intel/set_env.sh
|
||||
source $WORKPATH/docker_compose/set_env.sh
|
||||
export MODEL_CACHE=${model_cache:-"./data"}
|
||||
|
||||
export MAX_INPUT_TOKENS=2048
|
||||
@@ -237,20 +237,6 @@ function validate_megaservice_multimedia() {
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking audio data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"well" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"media" "" \
|
||||
"type=audio" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.wav" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in json format"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
@@ -272,20 +258,6 @@ function validate_megaservice_multimedia() {
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"bye" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"media" "" \
|
||||
"type=video" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.mp4" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
}
|
||||
|
||||
function validate_megaservice_long_text() {
|
||||
|
||||
@@ -16,7 +16,7 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||
export REGISTRY=${IMAGE_REPO}
|
||||
export TAG=${IMAGE_TAG}
|
||||
|
||||
source $WORKPATH/docker_compose/intel/set_env.sh
|
||||
source $WORKPATH/docker_compose/set_env.sh
|
||||
export MODEL_CACHE=${model_cache:-"./data"}
|
||||
|
||||
export MAX_INPUT_TOKENS=2048
|
||||
@@ -229,20 +229,6 @@ function validate_megaservice_multimedia() {
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking audio data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"well" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"media" "" \
|
||||
"type=audio" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.wav" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in json format"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
@@ -264,20 +250,6 @@ function validate_megaservice_multimedia() {
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"bye" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"docsum-gaudi-backend-server" \
|
||||
"media" "" \
|
||||
"type=video" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.mp4" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
}
|
||||
|
||||
function validate_megaservice_long_text() {
|
||||
|
||||
@@ -16,7 +16,7 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||
export REGISTRY=${IMAGE_REPO}
|
||||
export TAG=${IMAGE_TAG}
|
||||
|
||||
source $WORKPATH/docker_compose/intel/set_env.sh
|
||||
source $WORKPATH/docker_compose/set_env.sh
|
||||
export MODEL_CACHE=${model_cache:-"./data"}
|
||||
|
||||
export MAX_INPUT_TOKENS=2048
|
||||
@@ -229,20 +229,6 @@ function validate_megaservice_multimedia() {
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking audio data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"well" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"media" "" \
|
||||
"type=audio" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.wav" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in json format"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
@@ -264,20 +250,6 @@ function validate_megaservice_multimedia() {
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
|
||||
echo ">>> Checking video data in form format, upload file"
|
||||
validate_service \
|
||||
"${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum" \
|
||||
"bye" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"docsum-xeon-backend-server" \
|
||||
"media" "" \
|
||||
"type=video" \
|
||||
"messages=" \
|
||||
"files=@$ROOT_FOLDER/data/test.mp4" \
|
||||
"max_tokens=32" \
|
||||
"language=en" \
|
||||
"stream=False"
|
||||
}
|
||||
|
||||
function validate_megaservice_long_text() {
|
||||
|
||||
@@ -22,12 +22,76 @@ logger = logging.getLogger(__name__)
|
||||
class DocSumUI:
|
||||
def __init__(self):
|
||||
"""Initialize the DocSumUI class with accepted file types, headers, and backend service endpoint."""
|
||||
self.ACCEPTED_TEXT_FILE_TYPES = [".pdf", ".doc", ".docx"]
|
||||
self.ACCEPTED_AUDIO_FILE_TYPES = [".mp3", ".wav"]
|
||||
self.ACCEPTED_VIDEO_FILE_TYPES = [".mp4"]
|
||||
self.ACCEPTED_FILE_TYPES = ["pdf", "doc", "docx"]
|
||||
self.HEADERS = {"Content-Type": "application/json"}
|
||||
self.BACKEND_SERVICE_ENDPOINT = os.getenv("BACKEND_SERVICE_ENDPOINT", "http://localhost:8888/v1/docsum")
|
||||
|
||||
def encode_file_to_base64(self, file_path):
|
||||
"""Encode the content of a file to a base64 string.
|
||||
|
||||
Args:
|
||||
file_path (str): The path to the file to be encoded.
|
||||
|
||||
Returns:
|
||||
str: The base64 encoded string of the file content.
|
||||
"""
|
||||
logger.info(">>> Encoding file to base64: %s", file_path)
|
||||
with open(file_path, "rb") as f:
|
||||
base64_str = base64.b64encode(f.read()).decode("utf-8")
|
||||
return base64_str
|
||||
|
||||
def read_file(self, file):
|
||||
"""Read and process the content of a file.
|
||||
|
||||
Args:
|
||||
file (file-like object): The file to be read.
|
||||
|
||||
Returns:
|
||||
str: The content of the file or an error message if the file type is unsupported.
|
||||
"""
|
||||
self.page_content = ""
|
||||
self.pages = []
|
||||
|
||||
if file.name.endswith(".pdf"):
|
||||
loader = PyPDFLoader(file)
|
||||
elif file.name.endswith((".doc", ".docx")):
|
||||
loader = Docx2txtLoader(file)
|
||||
else:
|
||||
msg = f"Unsupported file type '{file.name}'. Choose from {self.ACCEPTED_FILE_TYPES}"
|
||||
logger.error(msg)
|
||||
return msg
|
||||
|
||||
for page in loader.lazy_load():
|
||||
self.page_content += page.page_content
|
||||
|
||||
return self.page_content
|
||||
|
||||
def read_audio_file(self, file):
|
||||
"""Read and process the content of an audio file.
|
||||
|
||||
Args:
|
||||
file (file-like object): The audio file to be read.
|
||||
|
||||
Returns:
|
||||
str: The base64 encoded content of the audio file.
|
||||
"""
|
||||
logger.info(">>> Reading audio file: %s", file.name)
|
||||
base64_str = self.encode_file_to_base64(file)
|
||||
return base64_str
|
||||
|
||||
def read_video_file(self, file):
|
||||
"""Read and process the content of a video file.
|
||||
|
||||
Args:
|
||||
file (file-like object): The video file to be read.
|
||||
|
||||
Returns:
|
||||
str: The base64 encoded content of the video file.
|
||||
"""
|
||||
logger.info(">>> Reading video file: %s", file.name)
|
||||
base64_str = self.encode_file_to_base64(file)
|
||||
return base64_str
|
||||
|
||||
def is_valid_url(self, url):
|
||||
try:
|
||||
result = urlparse(url)
|
||||
@@ -64,107 +128,78 @@ class DocSumUI:
|
||||
|
||||
return self.page_content
|
||||
|
||||
def process_response(self, response):
|
||||
if response.status_code == 200:
|
||||
try:
|
||||
# Check if the specific log path is in the response text
|
||||
if "/logs/LLMChain/final_output" in response.text:
|
||||
# Extract the relevant part of the response
|
||||
temp = ast.literal_eval(
|
||||
[
|
||||
i.split("data: ")[1]
|
||||
for i in response.text.split("\n\n")
|
||||
if "/logs/LLMChain/final_output" in i
|
||||
][0]
|
||||
)["ops"]
|
||||
|
||||
# Find the final output value
|
||||
final_output = [i["value"] for i in temp if i["path"] == "/logs/LLMChain/final_output"][0]
|
||||
return final_output["text"]
|
||||
else:
|
||||
# Perform string replacements to clean the response text
|
||||
cleaned_text = response.text
|
||||
replacements = [
|
||||
("'\n\ndata: b'", ""),
|
||||
("data: b' ", ""),
|
||||
("</s>'\n\ndata: [DONE]\n\n", ""),
|
||||
("\n\ndata: b", ""),
|
||||
("'\n\n", ""),
|
||||
("'\n", ""),
|
||||
('''\'"''', ""),
|
||||
]
|
||||
for old, new in replacements:
|
||||
cleaned_text = cleaned_text.replace(old, new)
|
||||
return cleaned_text
|
||||
except (IndexError, KeyError, ValueError) as e:
|
||||
# Handle potential errors during parsing
|
||||
logger.error("Error parsing response: %s", e)
|
||||
return response.text
|
||||
|
||||
def generate_summary(self, document, document_type="text"):
|
||||
def generate_summary(self, doc_content, document_type="text"):
|
||||
"""Generate a summary for the given document content.
|
||||
|
||||
Args:
|
||||
document (str): The content or path of the document.
|
||||
doc_content (str): The content of the document.
|
||||
document_type (str): The type of the document (default is "text").
|
||||
|
||||
Returns:
|
||||
str: The generated summary or an error message.
|
||||
"""
|
||||
|
||||
logger.info(">>> BACKEND_SERVICE_ENDPOINT - %s", self.BACKEND_SERVICE_ENDPOINT)
|
||||
|
||||
data = {"max_tokens": 256, "type": document_type, "messages": ""}
|
||||
data = {"max_tokens": 256, "type": document_type, "messages": doc_content}
|
||||
|
||||
if os.path.exists(document):
|
||||
file_header = "text/plain"
|
||||
file_ext = os.path.splitext(document)[-1]
|
||||
if file_ext == ".pdf":
|
||||
file_header = "application/pdf"
|
||||
elif file_ext in [".doc", ".docx"]:
|
||||
file_header = "application/octet-stream"
|
||||
elif file_ext in self.ACCEPTED_AUDIO_FILE_TYPES + self.ACCEPTED_VIDEO_FILE_TYPES:
|
||||
file_header = f"{document_type}/{file_ext[-3:]}"
|
||||
files = {"files": (os.path.basename(document), open(document, "rb"), file_header)}
|
||||
try:
|
||||
response = requests.post(
|
||||
url=self.BACKEND_SERVICE_ENDPOINT,
|
||||
headers={},
|
||||
files=files,
|
||||
data=data,
|
||||
proxies={"http_proxy": os.environ["http_proxy"], "https_proxy": os.environ["https_proxy"]},
|
||||
)
|
||||
try:
|
||||
response = requests.post(
|
||||
url=self.BACKEND_SERVICE_ENDPOINT,
|
||||
headers=self.HEADERS,
|
||||
data=json.dumps(data),
|
||||
proxies={"http_proxy": os.environ["http_proxy"], "https_proxy": os.environ["https_proxy"]},
|
||||
)
|
||||
|
||||
return self.process_response(response)
|
||||
if response.status_code == 200:
|
||||
try:
|
||||
# Check if the specific log path is in the response text
|
||||
if "/logs/LLMChain/final_output" in response.text:
|
||||
# Extract the relevant part of the response
|
||||
temp = ast.literal_eval(
|
||||
[
|
||||
i.split("data: ")[1]
|
||||
for i in response.text.split("\n\n")
|
||||
if "/logs/LLMChain/final_output" in i
|
||||
][0]
|
||||
)["ops"]
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error("Request exception: %s", e)
|
||||
return str(e)
|
||||
# Find the final output value
|
||||
final_output = [i["value"] for i in temp if i["path"] == "/logs/LLMChain/final_output"][0]
|
||||
return final_output["text"]
|
||||
else:
|
||||
# Perform string replacements to clean the response text
|
||||
cleaned_text = response.text
|
||||
replacements = [
|
||||
("'\n\ndata: b'", ""),
|
||||
("data: b' ", ""),
|
||||
("</s>'\n\ndata: [DONE]\n\n", ""),
|
||||
("\n\ndata: b", ""),
|
||||
("'\n\n", ""),
|
||||
("'\n", ""),
|
||||
('''\'"''', ""),
|
||||
]
|
||||
for old, new in replacements:
|
||||
cleaned_text = cleaned_text.replace(old, new)
|
||||
return cleaned_text
|
||||
except (IndexError, KeyError, ValueError) as e:
|
||||
# Handle potential errors during parsing
|
||||
logger.error("Error parsing response: %s", e)
|
||||
return response.text
|
||||
|
||||
else:
|
||||
data["messages"] = document
|
||||
try:
|
||||
response = requests.post(
|
||||
url=self.BACKEND_SERVICE_ENDPOINT,
|
||||
headers=self.HEADERS,
|
||||
data=json.dumps(data),
|
||||
proxies={"http_proxy": os.environ["http_proxy"], "https_proxy": os.environ["https_proxy"]},
|
||||
)
|
||||
|
||||
return self.process_response(response)
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error("Request exception: %s", e)
|
||||
return str(e)
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error("Request exception: %s", e)
|
||||
return str(e)
|
||||
|
||||
return str(response.status_code)
|
||||
|
||||
def create_upload_ui(self, label, file_types, document_type="text"):
|
||||
def create_upload_ui(self, label, file_types, process_function, document_type="text"):
|
||||
"""Create a Gradio UI for file uploads.
|
||||
|
||||
Args:
|
||||
label (str): The label for the upload button.
|
||||
file_types (list): The list of accepted file types.
|
||||
document_type (str): The document type (text, audio, or video). Default is text.
|
||||
process_function (function): The function to process the uploaded file.
|
||||
|
||||
Returns:
|
||||
gr.Blocks: The Gradio Blocks object representing the upload UI.
|
||||
@@ -179,7 +214,7 @@ class DocSumUI:
|
||||
label="Text Summary", placeholder="Summarized text will be displayed here"
|
||||
)
|
||||
upload_btn.upload(
|
||||
lambda file: self.generate_summary(file, document_type=document_type),
|
||||
lambda file: self.generate_summary(process_function(file), document_type=document_type),
|
||||
upload_btn,
|
||||
generated_text,
|
||||
)
|
||||
@@ -228,21 +263,24 @@ class DocSumUI:
|
||||
|
||||
# File Upload UI
|
||||
file_ui = self.create_upload_ui(
|
||||
label=f"Please upload a document ({', '.join(self.ACCEPTED_TEXT_FILE_TYPES)})",
|
||||
file_types=self.ACCEPTED_TEXT_FILE_TYPES,
|
||||
label="Please upload a document (.pdf, .doc, .docx)",
|
||||
file_types=[".pdf", ".doc", ".docx"],
|
||||
process_function=self.read_file,
|
||||
)
|
||||
|
||||
# Audio Upload UI
|
||||
audio_ui = self.create_upload_ui(
|
||||
label=f"Please upload audio file ({', '.join(self.ACCEPTED_AUDIO_FILE_TYPES)})",
|
||||
file_types=self.ACCEPTED_AUDIO_FILE_TYPES,
|
||||
label="Please upload audio file (.wav, .mp3)",
|
||||
file_types=[".wav", ".mp3"],
|
||||
process_function=self.read_audio_file,
|
||||
document_type="audio",
|
||||
)
|
||||
|
||||
# Video Upload UI
|
||||
video_ui = self.create_upload_ui(
|
||||
label=f"Please upload video file ({', '.join(self.ACCEPTED_VIDEO_FILE_TYPES)})",
|
||||
file_types=self.ACCEPTED_VIDEO_FILE_TYPES,
|
||||
label="Please upload Video file (.mp4)",
|
||||
file_types=[".mp4"],
|
||||
process_function=self.read_video_file,
|
||||
document_type="video",
|
||||
)
|
||||
|
||||
|
||||
@@ -5,13 +5,3 @@
|
||||
pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
export MODEL_PATH=${MODEL_PATH}
|
||||
export DOC_PATH=${DOC_PATH}
|
||||
export UI_TMPFILE_PATH=${UI_TMPFILE_PATH}
|
||||
export HOST_IP=${HOST_IP}
|
||||
export LLM_MODEL=${LLM_MODEL}
|
||||
export HF_ENDPOINT=${HF_ENDPOINT}
|
||||
export vLLM_ENDPOINT=${vLLM_ENDPOINT}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export no_proxy="localhost, 127.0.0.1, 192.168.1.1"
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# EdgeCraftRAG E2E test scripts
|
||||
|
||||
## Set the required environment variable
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
## Run test
|
||||
|
||||
On Intel ARC with TGI:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_arc.sh
|
||||
```
|
||||
|
||||
On Intel ARC with vLLM:
|
||||
|
||||
```bash
|
||||
bash test_compose_vllm_on_arc.sh
|
||||
```
|
||||
@@ -46,10 +46,18 @@ function build_docker_images() {
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
export MODEL_PATH=${MODEL_PATH}
|
||||
export DOC_PATH=${DOC_PATH}
|
||||
export UI_UPLOAD_PATH=${UI_UPLOAD_PATH}
|
||||
export HOST_IP=${HOST_IP}
|
||||
export LLM_MODEL=${LLM_MODEL}
|
||||
export HF_ENDPOINT=${HF_ENDPOINT}
|
||||
export vLLM_ENDPOINT=${vLLM_ENDPOINT}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export no_proxy="localhost, 127.0.0.1, 192.168.1.1"
|
||||
|
||||
cd $WORKPATH/docker_compose/intel/gpu/arc
|
||||
source set_env.sh
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f $COMPOSE_FILE up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
sleep 20
|
||||
|
||||
@@ -53,8 +53,17 @@ function build_docker_images() {
|
||||
}
|
||||
|
||||
function start_services() {
|
||||
export MODEL_PATH=${MODEL_PATH}
|
||||
export DOC_PATH=${DOC_PATH}
|
||||
export UI_TMPFILE_PATH=${UI_TMPFILE_PATH}
|
||||
export HOST_IP=${HOST_IP}
|
||||
export LLM_MODEL=${LLM_MODEL}
|
||||
export HF_ENDPOINT=${HF_ENDPOINT}
|
||||
export vLLM_ENDPOINT=${vLLM_ENDPOINT}
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export no_proxy="localhost, 127.0.0.1, 192.168.1.1"
|
||||
|
||||
cd $WORKPATH/docker_compose/intel/gpu/arc
|
||||
source set_env.sh
|
||||
|
||||
# Start Docker Containers
|
||||
docker compose -f $COMPOSE_FILE up -d > ${LOG_PATH}/start_services_with_compose.log
|
||||
|
||||
3
EdgeCraftRAG/ui/vue/components.d.ts
vendored
3
EdgeCraftRAG/ui/vue/components.d.ts
vendored
@@ -18,10 +18,12 @@ declare module 'vue' {
|
||||
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
|
||||
ADescriptions: typeof import('ant-design-vue/es')['Descriptions']
|
||||
ADescriptionsItem: typeof import('ant-design-vue/es')['DescriptionsItem']
|
||||
ADivider: typeof import('ant-design-vue/es')['Divider']
|
||||
ADrawer: typeof import('ant-design-vue/es')['Drawer']
|
||||
AEmpty: typeof import('ant-design-vue/es')['Empty']
|
||||
AForm: typeof import('ant-design-vue/es')['Form']
|
||||
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
||||
AImage: typeof import('ant-design-vue/es')['Image']
|
||||
AInput: typeof import('ant-design-vue/es')['Input']
|
||||
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
|
||||
ALayout: typeof import('ant-design-vue/es')['Layout']
|
||||
@@ -29,6 +31,7 @@ declare module 'vue' {
|
||||
ALayoutHeader: typeof import('ant-design-vue/es')['LayoutHeader']
|
||||
AModal: typeof import('ant-design-vue/es')['Modal']
|
||||
APagination: typeof import('ant-design-vue/es')['Pagination']
|
||||
APopover: typeof import('ant-design-vue/es')['Popover']
|
||||
ARadio: typeof import('ant-design-vue/es')['Radio']
|
||||
ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
|
||||
ARow: typeof import('ant-design-vue/es')['Row']
|
||||
|
||||
@@ -12,16 +12,13 @@
|
||||
"@vueuse/i18n": "^4.0.0-beta.12",
|
||||
"ant-design-vue": "^4.0.0-rc.6",
|
||||
"axios": "^1.7.9",
|
||||
"clipboard": "^2.0.11",
|
||||
"dayjs": "^1.11.13",
|
||||
"echarts": "^5.5.1",
|
||||
"event-source-polyfill": "^1.0.31",
|
||||
"highlight.js": "^11.11.1",
|
||||
"http": "^0.0.1-security",
|
||||
"js-cookie": "^3.0.5",
|
||||
"lodash": "^4.17.21",
|
||||
"marked": "^15.0.6",
|
||||
"pinia": "^3.0.2",
|
||||
"pinia": "^2.3.0",
|
||||
"pinia-plugin-persistedstate": "^4.2.0",
|
||||
"qs": "^6.13.1",
|
||||
"socket.io-client": "^4.8.1",
|
||||
|
||||
@@ -59,9 +59,9 @@ function build_vllm_docker_image() {
|
||||
git clone https://github.com/HabanaAI/vllm-fork.git
|
||||
fi
|
||||
cd ./vllm-fork
|
||||
|
||||
VLLM_FORK_VER=v0.7.2+Gaudi-1.21.0
|
||||
git checkout ${VLLM_FORK_VER} &> /dev/null
|
||||
# VLLM_VER=$(git describe --tags "$(git rev-list --tags --max-count=1)")
|
||||
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
|
||||
git checkout ${VLLM_VER} &> /dev/null
|
||||
docker build --no-cache -f Dockerfile.hpu -t $vllm_image --shm-size=128g . --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$vllm_image failed"
|
||||
|
||||
@@ -18,7 +18,7 @@ Quick Start Deployment Steps:
|
||||
2. Run Docker Compose.
|
||||
3. Consume the GraphRAG Service.
|
||||
|
||||
Note: If you do not have Docker installed you can [install Docker](https://docs.docker.com/engine/install/) first
|
||||
Note: If you do not have docker installed you can run this script to install docker : `bash docker_compose/install_docker.sh`
|
||||
|
||||
### Quick Start: 1.Setup Environment Variable
|
||||
|
||||
|
||||
35
GraphRAG/docker_compose/install_docker.sh
Normal file
35
GraphRAG/docker_compose/install_docker.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2024 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Update the package index
|
||||
sudo apt-get -y update
|
||||
|
||||
# Install prerequisites
|
||||
sudo apt-get -y install ca-certificates curl --no-install-recommends --fix-missing
|
||||
|
||||
# Create the directory for the Docker GPG key
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
|
||||
# Add Docker's official GPG key
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
|
||||
# Set permissions for the GPG key
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
# Add Docker repository to the sources list
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# Update the package index with Docker packages
|
||||
sudo apt-get -y update
|
||||
|
||||
# Install Docker packages
|
||||
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --no-install-recommends --fix-missing
|
||||
|
||||
# add existing user
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# Optional: Verify that Docker is installed correctly
|
||||
sudo docker --version
|
||||
@@ -10,9 +10,6 @@ pushd "../../../../../" > /dev/null
|
||||
source .set_env.sh
|
||||
popd > /dev/null
|
||||
|
||||
host_ip=$(hostname -I | awk '{print $1}')
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export HF_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export TEI_EMBEDDER_PORT=11633
|
||||
export LLM_ENDPOINT_PORT=11634
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
@@ -20,6 +17,7 @@ export OPENAI_EMBEDDING_MODEL="text-embedding-3-small"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3.1-8B-Instruct"
|
||||
export OPENAI_LLM_MODEL="gpt-4o"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3.1-8B-Instruct"
|
||||
export TGI_LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
||||
export NEO4J_PORT1=11631
|
||||
export NEO4J_PORT2=11632
|
||||
@@ -34,4 +32,3 @@ export MAX_TOTAL_TOKENS=8192
|
||||
export DATA_PATH="/mnt/nvme2n1/hf_cache"
|
||||
export DATAPREP_PORT=11103
|
||||
export RETRIEVER_PORT=11635
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# GraphRAG E2E test scripts
|
||||
|
||||
## Set the required environment variable
|
||||
|
||||
```bash
|
||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||
```
|
||||
|
||||
## Run test
|
||||
|
||||
On Intel Gaudi:
|
||||
|
||||
```bash
|
||||
bash test_compose_on_gaudi.sh
|
||||
```
|
||||
@@ -41,7 +41,31 @@ function build_docker_images() {
|
||||
|
||||
function start_services() {
|
||||
cd $WORKPATH/docker_compose/intel/hpu/gaudi
|
||||
source set_env.sh
|
||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
export HF_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||
|
||||
export TEI_EMBEDDER_PORT=11633
|
||||
export LLM_ENDPOINT_PORT=11634
|
||||
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
|
||||
export OPENAI_EMBEDDING_MODEL="text-embedding-3-small"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3.1-8B-Instruct"
|
||||
export OPENAI_LLM_MODEL="gpt-4o"
|
||||
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}"
|
||||
export LLM_MODEL_ID="meta-llama/Meta-Llama-3.1-8B-Instruct"
|
||||
export TGI_LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
||||
export NEO4J_PORT1=11631
|
||||
export NEO4J_PORT2=11632
|
||||
export NEO4J_URI="bolt://${host_ip}:${NEO4J_PORT2}"
|
||||
export NEO4J_URL="bolt://${host_ip}:${NEO4J_PORT2}"
|
||||
export NEO4J_USERNAME="neo4j"
|
||||
export NEO4J_PASSWORD="neo4jtest"
|
||||
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:5000/v1/dataprep/ingest"
|
||||
export LOGFLAG=True
|
||||
export MAX_INPUT_TOKENS=4096
|
||||
export MAX_TOTAL_TOKENS=8192
|
||||
export DATAPREP_PORT=11103
|
||||
export RETRIEVER_PORT=11635
|
||||
export MEGA_SERVICE_PORT=8888
|
||||
unset OPENAI_API_KEY
|
||||
|
||||
# Start Docker Containers
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user