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

Files changed (1) hide show
  1. README.md +81 -70
README.md CHANGED
@@ -191,88 +191,99 @@ $ chmod +x ./entrypoint.sh
191
  $ docker compose up -d
192
  ```
193
 
194
- ## ๐Ÿ› ๏ธ Launch Service from Source
195
 
196
- To launch the service from source, please follow these steps:
197
 
198
- 1. Clone the repository
199
- ```bash
200
- $ git clone https://github.com/infiniflow/ragflow.git
201
- $ cd ragflow/
202
- ```
203
 
204
- 2. Create a virtual environment (ensure Anaconda or Miniconda is installed)
205
- ```bash
206
- $ conda create -n ragflow python=3.11.0
207
- $ conda activate ragflow
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
- 3. Copy the entry script and configure environment variables
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
- Set the output of `which python` as the value for `PY` and the output of `pwd` as the value for `PYTHONPATH`.
 
 
 
 
 
 
 
 
 
 
228
 
229
- If `LD_LIBRARY_PATH` is already configured, it can be commented out.
230
 
231
- ```bash
232
- # Adjust configurations according to your actual situation; the two export commands are newly added.
233
- PY=${PY}
234
- export PYTHONPATH=${PYTHONPATH}
235
- # Optional: Add Hugging Face mirror
236
- export HF_ENDPOINT=https://hf-mirror.com
237
- ```
 
 
 
 
238
 
239
- 4. Start the base services
240
- ```bash
241
- $ cd docker
242
- $ docker compose -f docker-compose-base.yml up -d
243
- ```
 
 
 
 
 
244
 
245
- 5. Check the configuration files
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
- 6. Launch the service
249
- ```bash
250
- $ chmod +x ./entrypoint.sh
251
- $ bash ./entrypoint.sh
252
- ```
253
 
254
- 7. Start the WebUI service
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
- 8. Deploy the WebUI service
264
- ```bash
265
- $ cd web
266
- $ npm install --registry=https://registry.npmmirror.com --force
267
- $ umi build
268
- $ mkdir -p /ragflow/web
269
- $ cp -r dist /ragflow/web
270
- $ apt install nginx -y
271
- $ cp ../docker/nginx/proxy.conf /etc/nginx
272
- $ cp ../docker/nginx/nginx.conf /etc/nginx
273
- $ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
274
- $ systemctl start nginx
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