writinwaters
commited on
Commit
ยท
0b0038a
1
Parent(s):
cbc9d81
Updated Launch service from source (#856)
Browse files### What problem does this PR solve?
Some nitpicking editorial updates.
### Type of change
- [x] Documentation Update
README.md
CHANGED
|
@@ -191,88 +191,99 @@ $ chmod +x ./entrypoint.sh
|
|
| 191 |
$ docker compose up -d
|
| 192 |
```
|
| 193 |
|
| 194 |
-
## ๐ ๏ธ Launch
|
| 195 |
|
| 196 |
-
To launch the service from source
|
| 197 |
|
| 198 |
-
1. Clone the repository
|
| 199 |
-
```bash
|
| 200 |
-
$ git clone https://github.com/infiniflow/ragflow.git
|
| 201 |
-
$ cd ragflow/
|
| 202 |
-
```
|
| 203 |
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
$
|
| 207 |
-
|
| 208 |
-
$ pip install -r requirements.txt
|
| 209 |
-
```
|
| 210 |
-
If CUDA version is greater than 12.0, execute the following additional commands:
|
| 211 |
-
```bash
|
| 212 |
-
$ pip uninstall -y onnxruntime-gpu
|
| 213 |
-
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
|
| 214 |
-
```
|
| 215 |
|
| 216 |
-
|
| 217 |
-
```bash
|
| 218 |
-
$ cp docker/entrypoint.sh .
|
| 219 |
-
$ vi entrypoint.sh
|
| 220 |
-
```
|
| 221 |
-
Use the following commands to obtain the Python path and the ragflow project path:
|
| 222 |
-
```bash
|
| 223 |
-
$ which python
|
| 224 |
-
$ pwd
|
| 225 |
-
```
|
| 226 |
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
|
| 229 |
-
|
| 230 |
|
| 231 |
-
```bash
|
| 232 |
-
#
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
-
|
| 246 |
-
Ensure that the settings in **docker/.env** match those in **conf/service_conf.yaml**. The IP addresses and ports for related services in **service_conf.yaml** should be changed to the local machine IP and ports exposed by the container.
|
| 247 |
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
$
|
| 251 |
-
|
| 252 |
-
```
|
| 253 |
|
| 254 |
-
|
| 255 |
-
```bash
|
| 256 |
-
$ cd web
|
| 257 |
-
$ npm install --registry=https://registry.npmmirror.com --force
|
| 258 |
-
$ vim .umirc.ts
|
| 259 |
-
# Modify proxy.target to 127.0.0.1:9380
|
| 260 |
-
$ npm run dev
|
| 261 |
-
```
|
| 262 |
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
$
|
| 270 |
-
$
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 276 |
|
| 277 |
## ๐ Documentation
|
| 278 |
|
|
|
|
| 191 |
$ docker compose up -d
|
| 192 |
```
|
| 193 |
|
| 194 |
+
## ๐ ๏ธ Launch service from source
|
| 195 |
|
| 196 |
+
To launch the service from source:
|
| 197 |
|
| 198 |
+
1. Clone the repository:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
+
```bash
|
| 201 |
+
$ git clone https://github.com/infiniflow/ragflow.git
|
| 202 |
+
$ cd ragflow/
|
| 203 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
+
2. Create a virtual environment, ensuring that Anaconda or Miniconda is installed:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
+
```bash
|
| 208 |
+
$ conda create -n ragflow python=3.11.0
|
| 209 |
+
$ conda activate ragflow
|
| 210 |
+
$ pip install -r requirements.txt
|
| 211 |
+
```
|
| 212 |
+
|
| 213 |
+
```bash
|
| 214 |
+
# If your CUDA version is higher than 12.0, run the following additional commands:
|
| 215 |
+
$ pip uninstall -y onnxruntime-gpu
|
| 216 |
+
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
|
| 217 |
+
```
|
| 218 |
|
| 219 |
+
3. Copy the entry script and configure environment variables:
|
| 220 |
|
| 221 |
+
```bash
|
| 222 |
+
# Get the Python path:
|
| 223 |
+
$ which python
|
| 224 |
+
# Get the ragflow project path:
|
| 225 |
+
$ pwd
|
| 226 |
+
```
|
| 227 |
+
|
| 228 |
+
```bash
|
| 229 |
+
$ cp docker/entrypoint.sh .
|
| 230 |
+
$ vi entrypoint.sh
|
| 231 |
+
```
|
| 232 |
|
| 233 |
+
```bash
|
| 234 |
+
# Adjust configurations according to your actual situation (the following two export commands are newly added):
|
| 235 |
+
# - Assign the result of `which python` to `PY`.
|
| 236 |
+
# - Assign the result of `pwd` to `PYTHONPATH`.
|
| 237 |
+
# - Comment out `LD_LIBRARY_PATH`, if it is configured.
|
| 238 |
+
# - Optional: Add Hugging Face mirror.
|
| 239 |
+
PY=${PY}
|
| 240 |
+
export PYTHONPATH=${PYTHONPATH}
|
| 241 |
+
export HF_ENDPOINT=https://hf-mirror.com
|
| 242 |
+
```
|
| 243 |
|
| 244 |
+
4. Launch the third-party services (MinIO, Elasticsearch, Redis, and MySQL):
|
|
|
|
| 245 |
|
| 246 |
+
```bash
|
| 247 |
+
$ cd docker
|
| 248 |
+
$ docker compose -f docker-compose-base.yml up -d
|
| 249 |
+
```
|
|
|
|
| 250 |
|
| 251 |
+
5. Check the configuration files, ensuring that:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
|
| 253 |
+
- The settings in **docker/.env** match those in **conf/service_conf.yaml**.
|
| 254 |
+
- The IP addresses and ports for related services in **service_conf.yaml** match the local machine IP and ports exposed by the container.
|
| 255 |
+
|
| 256 |
+
6. Launch the RAGFlow backend service:
|
| 257 |
+
|
| 258 |
+
```bash
|
| 259 |
+
$ chmod +x ./entrypoint.sh
|
| 260 |
+
$ bash ./entrypoint.sh
|
| 261 |
+
```
|
| 262 |
+
|
| 263 |
+
7. Launch the frontend service:
|
| 264 |
+
|
| 265 |
+
```bash
|
| 266 |
+
$ cd web
|
| 267 |
+
$ npm install --registry=https://registry.npmmirror.com --force
|
| 268 |
+
$ vim .umirc.ts
|
| 269 |
+
# Update proxy.target to 127.0.0.1:9380
|
| 270 |
+
$ npm run dev
|
| 271 |
+
```
|
| 272 |
+
|
| 273 |
+
8. Deploy the frontend service:
|
| 274 |
+
|
| 275 |
+
```bash
|
| 276 |
+
$ cd web
|
| 277 |
+
$ npm install --registry=https://registry.npmmirror.com --force
|
| 278 |
+
$ umi build
|
| 279 |
+
$ mkdir -p /ragflow/web
|
| 280 |
+
$ cp -r dist /ragflow/web
|
| 281 |
+
$ apt install nginx -y
|
| 282 |
+
$ cp ../docker/nginx/proxy.conf /etc/nginx
|
| 283 |
+
$ cp ../docker/nginx/nginx.conf /etc/nginx
|
| 284 |
+
$ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
|
| 285 |
+
$ systemctl start nginx
|
| 286 |
+
```
|
| 287 |
|
| 288 |
## ๐ Documentation
|
| 289 |
|