Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build image and launch from source in README #2658

Merged
merged 8 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 87 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
- 🔎 [System Architecture](#-system-architecture)
- 🎬 [Get Started](#-get-started)
- 🔧 [Configurations](#-configurations)
- 🪛 [Build the docker image without embedding models](#-build-the-docker-image-without-embedding-models)
- 🪚 [Build the docker image including embedding models](#-build-the-docker-image-including-embedding-models)
- 🔨 [Launch service from source for development](#-launch-service-from-source-for-development)
- 📚 [Documentation](#-documentation)
- 📜 [Roadmap](#-roadmap)
- 🏄 [Community](#-community)
Expand Down Expand Up @@ -166,12 +169,12 @@ Try our demo at [https://demo.ragflow.io](https://demo.ragflow.io).
_The following output confirms a successful launch of the system:_

```bash
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/


* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
Expand Down Expand Up @@ -208,6 +211,84 @@ Updates to the above configurations require a reboot of all containers to take e
> $ docker-compose -f docker/docker-compose.yml up -d
> ```

## 🪛 Build the Docker image without embedding models

This image is approximately 1 GB in size and relies on external LLM and embedding services.

```bash
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/
pip3 install huggingface-hub
python3 download_deps.py # embedding models
docker build -f Dockerfile.slim -t infiniflow/ragflow:dev-slim .
```

## 🪚 Build the Docker image including embedding models

This image includes embedding models and is approximately 9 GB in size, and so relies on external LLM services only.

```bash
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/
pip3 install huggingface-hub
python3 download_deps.py # embedding models
docker build -f Dockerfile -t infiniflow/ragflow:dev .
```

## 🔨 Launch service from source for development

1. Install Poetry, or skip this step if it is already installed:
```bash
curl -sSL https://install.python-poetry.org | python3 -
```

2. Clone the source code and install Python dependencies:
```bash
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/
export POETRY_VIRTUALENVS_CREATE=true POETRY_VIRTUALENVS_IN_PROJECT=true
~/.local/bin/poetry install --sync --no-root # install RAGFlow dependent python modules
```

3. Launch the dependent services (MinIO, Elasticsearch, Redis, and MySQL) using Docker Compose:
```bash
docker compose -f docker/docker-compose-base.yml up -d
```

Add the following line to `/etc/hosts` to resolve all hosts specified in **docker/service_conf.yaml** to `127.0.0.1`:
```
127.0.0.1 es01 mysql minio redis
```
In **docker/service_conf.yaml**, update mysql port to `5455` and es port to `1200`, as specified in **docker/.env**.
JinHai-CN marked this conversation as resolved.
Show resolved Hide resolved

4. If you cannot access HuggingFace, set the `HF_ENDPOINT` environment variable to use a mirror site:

```bash
export HF_ENDPOINT=https://hf-mirror.com
```

5. Launch backend service:
```bash
source .venv/bin/activate
export PYTHONPATH=$(pwd)
bash docker/launch_backend_service.sh
```

6. Install frontend dependencies:
```bash
cd web
npm install --force
```
7. Configure frontend to update `proxy.target` in **.umirc.ts** to `http://127.0.0.1:9380`:
8. Launch frontend service:
```bash
npm run dev
```

_The following output confirms a successful launch of the system:_

![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)

## 📚 Documentation

- [Quickstart](https://ragflow.io/docs/dev/)
Expand Down
11 changes: 5 additions & 6 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,11 @@
_以下の出力は、システムが正常に起動したことを確認するものです:_

```bash
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/

* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
Expand Down
11 changes: 5 additions & 6 deletions README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,11 @@
_다음 출력 결과로 시스템이 성공적으로 시작되었음을 확인합니다:_

```bash
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/

* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
Expand Down
11 changes: 5 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,11 @@
_出现以下界面提示说明服务器启动成功:_

```bash
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/

* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
Expand Down
11 changes: 5 additions & 6 deletions api/ragflow_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ def update_progress():

if __name__ == '__main__':
print(r"""
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/

""", flush=True)
stat_logger.info(
Expand Down
28 changes: 28 additions & 0 deletions docker/launch_backend_service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# unset http proxy which maybe set by docker daemon
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/

PY=python3
if [[ -z "$WS" || $WS -lt 1 ]]; then
WS=1
fi

function task_exe(){
while [ 1 -eq 1 ];do
$PY rag/svr/task_executor.py $1;
done
}

for ((i=0;i<WS;i++))
do
task_exe $i &
done

while [ 1 -eq 1 ];do
$PY api/ragflow_server.py
done

wait;
11 changes: 5 additions & 6 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,11 @@ This section provides instructions on setting up the RAGFlow server on Linux. If
_The following output confirms a successful launch of the system:_

```bash
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/

* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
Expand Down
11 changes: 5 additions & 6 deletions docs/references/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,11 @@ You will not log in to RAGFlow unless the server is fully initialized. Run `dock
*The server is successfully initialized, if your system displays the following:*

```
____ ______ __
/ __ \ ____ _ ____ _ / ____// /____ _ __
/ /_/ // __ `// __ `// /_ / // __ \| | /| / /
/ _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/

* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
Expand Down