Skip to content

Commit

Permalink
Added two developer guide and removed from README ' builder docker im…
Browse files Browse the repository at this point in the history
…age' and 'launch service from source' (infiniflow#2590)

### What problem does this PR solve?


### Type of change

- [x] Documentation Update
  • Loading branch information
writinwaters authored Sep 26, 2024
1 parent ff4205c commit 8141efb
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 385 deletions.
20 changes: 8 additions & 12 deletions docs/references/CONTRIBUTING.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
---
sidebar_position: 0
slug: /contribution_guidelines
---

# Contribution guidelines

Thanks for wanting to contribute to RAGFlow. This document offers guidlines and major considerations for submitting your contributions.
This document offers guidlines and major considerations for submitting your contributions to RAGFlow.

- To report a bug, file a [GitHub issue](https://github.com/infiniflow/ragflow/issues/new/choose) with us.
- For further questions, you can explore existing discussions or initiate a new one in [Discussions](https://github.com/orgs/infiniflow/discussions).


## What you can contribute

The list below mentions some contributions you can make, but it is not a complete list.
Expand All @@ -27,7 +21,7 @@ The list below mentions some contributions you can make, but it is not a complet
### General workflow

1. Fork our GitHub repository.
2. Clone your fork to your local machine:
2. Clone your fork to your local machine:
`git clone git@github.com:<yourname>/ragflow.git`
3. Create a local branch:
`git checkout -b my-branch`
Expand All @@ -39,14 +33,16 @@ The list below mentions some contributions you can make, but it is not a complet

### Before filing a PR

- Consider splitting a large PR into multiple smaller, standalone PRs to keep a traceable development history.
- Consider splitting a large PR into multiple smaller, standalone PRs to keep a traceable development history.
- Ensure that your PR addresses just one issue, or keep any unrelated changes small.
- Add test cases when contributing new features. They demonstrate that your code functions correctly and protect against potential issues from future changes.
### Describing your PR

### Describing your PR

- Ensure that your PR title is concise and clear, providing all the required information.
- Refer to a corresponding GitHub issue in your PR description if applicable.
- Refer to a corresponding GitHub issue in your PR description if applicable.
- Include sufficient design details for *breaking changes* or *API changes* in your description.

### Reviewing & merging a PR
- Ensure that your PR passes all Continuous Integration (CI) tests before merging it.

Ensure that your PR passes all Continuous Integration (CI) tests before merging it.
79 changes: 2 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
- 🔎 [System Architecture](#-system-architecture)
- 🎬 [Get Started](#-get-started)
- 🔧 [Configurations](#-configurations)
- 🛠️ [Build RAGFlow image](#-build-ragflow-image)
- 🛠️ [Launch service from source for development](#-launch-service-from-source-for-development)
- 📚 [Documentation](#-documentation)
- 📜 [Roadmap](#-roadmap)
- 🏄 [Community](#-community)
Expand Down Expand Up @@ -188,7 +186,7 @@ Try our demo at [https://demo.ragflow.io](https://demo.ragflow.io).
> See [llm_api_key_setup](https://ragflow.io/docs/dev/llm_api_key_setup) for more information.
_The show is now on!_
_The show is on!_
## 🔧 Configurations
Expand All @@ -210,79 +208,6 @@ Updates to the above configurations require a reboot of all containers to take e
> $ docker-compose -f docker/docker-compose.yml up -d
> ```
## 🛠️ Build RAGFlow image
To build the Docker images from source:
```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
$ docker build -f Dockerfile.scratch -t infiniflow/ragflow:dev .
```
## 🛠️ Launch service from source for development
To launch the service from source:
1. Clone the repository:
```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
```
2. Install all python dependencies in a newly created virtual environment named `.venv`:
```bash
$ curl -sSL https://install.python-poetry.org | python3 -
$ $HOME/.local/bin/poetry install --sync --no-root
```
3. Copy the entry script and configure environment variables:
```bash
# Adjust configurations according to your actual situation (the following two export commands are newly added):
# - Comment out `LD_LIBRARY_PATH`, if it is configured.
# - Optional: Add Hugging Face mirror.
source ~/.venv/bin/activate
export PYTHONPATH=$(pwd)
export HF_ENDPOINT=https://hf-mirror.com
```
4. Launch the third-party services (MinIO, Elasticsearch, Redis, and MySQL):
```bash
$ docker compose -f docker/docker-compose-base.yml up -d
```
5. Adjust configurations
Add the following line to `/etc/hosts` to resolve all hosts in `docker/service_conf.yaml` to `127.0.0.1`:
```
127.0.0.1 es01 mysql minio redis
```
Edit `docker/service_conf.yaml` to change mysql port to `5455` and es port to `1200`, as specified in `docker/.env`.
6. Launch the RAGFlow backend service:
Comment out the `nginx` line in `docker/entrypoint.sh` and run the script:
```bash
$ bash docker/entrypoint.sh
```
7. Launch the frontend service:
```bash
$ cd web
$ npm install --force
$ vim .umirc.ts
# Update proxy.target to http://127.0.0.1:9380
$ npm run dev
```
8. In your web browser, enter `http://127.0.0.1/`.
## 📚 Documentation
- [Quickstart](https://ragflow.io/docs/dev/)
Expand All @@ -302,4 +227,4 @@ See the [RAGFlow Roadmap 2024](https://github.com/infiniflow/ragflow/issues/162)
## 🙌 Contributing
RAGFlow flourishes via open-source collaboration. In this spirit, we embrace diverse contributions from the community. If you would like to be a part, review our [Contribution Guidelines](./docs/references/CONTRIBUTING.md) first.
RAGFlow flourishes via open-source collaboration. In this spirit, we embrace diverse contributions from the community. If you would like to be a part, review our [Contribution Guidelines](./CONTRIBUTING.md) first.
75 changes: 1 addition & 74 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,79 +194,6 @@
> $ docker-compose up -d
> ```
## 🛠️ ソースからビルドする
ソースからDockerイメージをビルドするには:
```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
$ docker build -t infiniflow/ragflow:v0.11.0 .
$ cd ragflow/docker
$ chmod +x ./entrypoint.sh
$ docker compose up -d
```
## 🛠️ ソースコードからサービスを起動する方法

ソースコードからサービスを起動する場合は、以下の手順に従ってください:

1. リポジトリをクローンします
```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
```

2. 仮想環境を作成します(AnacondaまたはMinicondaがインストールされていることを確認してください)
```bash
$ conda create -n ragflow python=3.11.0
$ conda activate ragflow
$ pip install -r requirements.txt
```
CUDAのバージョンが12.0以上の場合、以下の追加コマンドを実行してください:
```bash
$ pip uninstall -y onnxruntime-gpu
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
```

3. エントリースクリプトをコピーし、環境変数を設定します
```bash
$ cp docker/entrypoint.sh .
$ vi entrypoint.sh
```
以下のコマンドで Python のパスとragflowプロジェクトのパスを取得します:
```bash
$ which python
$ pwd
```

`which python` の出力を `PY` の値として、`pwd` の出力を `PYTHONPATH` の値として設定します。

`LD_LIBRARY_PATH` が既に設定されている場合は、コメントアウトできます。

```bash
# 実際の状況に応じて設定を調整してください。以下の二つの export は新たに追加された設定です
PY=${PY}
export PYTHONPATH=${PYTHONPATH}
# オプション:Hugging Face ミラーを追加
export HF_ENDPOINT=https://hf-mirror.com
```

4. 基本サービスを起動します
```bash
$ cd docker
$ docker compose -f docker-compose-base.yml up -d
```

5. 設定ファイルを確認します
**docker/.env** 内の設定が**conf/service_conf.yaml**内の設定と一致していることを確認してください。**service_conf.yaml**内の関連サービスのIPアドレスとポートは、ローカルマシンのIPアドレスとコンテナが公開するポートに変更する必要があります。

6. サービスを起動します
```bash
$ chmod +x ./entrypoint.sh
$ bash ./entrypoint.sh
```

## 📚 ドキュメンテーション
- [Quickstart](https://ragflow.io/docs/dev/)
Expand All @@ -286,4 +213,4 @@ $ bash ./entrypoint.sh
## 🙌 コントリビュート
RAGFlow はオープンソースのコラボレーションによって発展してきました。この精神に基づき、私たちはコミュニティからの多様なコントリビュートを受け入れています。 参加を希望される方は、まず [コントリビューションガイド](./docs/references/CONTRIBUTING.md)をご覧ください。
RAGFlow はオープンソースのコラボレーションによって発展してきました。この精神に基づき、私たちはコミュニティからの多様なコントリビュートを受け入れています。 参加を希望される方は、まず [コントリビューションガイド](./CONTRIBUTING.md)をご覧ください。
107 changes: 1 addition & 106 deletions README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,111 +198,6 @@
> $ docker-compose up -d
> ```
## 🛠️ 소스에서 빌드하기
Docker 이미지를 소스에서 빌드하려면:
```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
$ docker build -t infiniflow/ragflow:dev .
$ cd ragflow/docker
$ chmod +x ./entrypoint.sh
$ docker compose up -d
```

## 🛠️ 소스에서 서비스 시작하기

서비스를 소스에서 시작하려면:

1. 레포지토리를 클론하세요:

```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
```

2. 가상 환경을 생성하고, Anaconda 또는 Miniconda가 설치되어 있는지 확인하세요:
```bash
$ conda create -n ragflow python=3.11.0
$ conda activate ragflow
$ pip install -r requirements.txt
```

```bash
# CUDA 버전이 12.0보다 높은 경우, 다음 명령어를 추가로 실행하세요:
$ pip uninstall -y onnxruntime-gpu
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
```

3. 진입 스크립트를 복사하고 환경 변수를 설정하세요:
```bash
# 파이썬 경로를 받아옵니다:
$ which python
# RAGFlow 프로젝트 경로를 받아옵니다:
$ pwd
```

```bash
$ cp docker/entrypoint.sh .
$ vi entrypoint.sh
```

```bash
# 실제 상황에 맞게 설정 조정하기 (다음 두 개의 export 명령어는 새로 추가되었습니다):
# - `which python`의 결과를 `PY`에 할당합니다.
# - `pwd`의 결과를 `PYTHONPATH`에 할당합니다.
# - `LD_LIBRARY_PATH`가 설정되어 있는 경우 주석 처리합니다.
# - 선택 사항: Hugging Face 미러 추가.
PY=${PY}
export PYTHONPATH=${PYTHONPATH}
export HF_ENDPOINT=https://hf-mirror.com
```

4. 다른 서비스(MinIO, Elasticsearch, Redis, MySQL)를 시작하세요:
```bash
$ cd docker
$ docker compose -f docker-compose-base.yml up -d
```

5. 설정 파일을 확인하여 다음 사항을 확인하세요:
- **docker/.env**의 설정이 **conf/service_conf.yaml**의 설정과 일치하는지 확인합니다.
- **service_conf.yaml**의 관련 서비스에 대한 IP 주소와 포트가 로컬 머신의 IP 주소와 컨테이너에서 노출된 포트와 일치하는지 확인합니다.


6. RAGFlow 백엔드 서비스를 시작합니다:

```bash
$ chmod +x ./entrypoint.sh
$ bash ./entrypoint.sh
```

7. 프론트엔드 서비스를 시작합니다:

```bash
$ cd web
$ npm install --registry=https://registry.npmmirror.com --force
$ vim .umirc.ts
# proxy.target을 http://127.0.0.1:9380로 업데이트합니다.
$ npm run dev
```

8. 프론트엔드 서비스를 배포합니다:

```bash
$ cd web
$ npm install --registry=https://registry.npmmirror.com --force
$ umi build
$ mkdir -p /ragflow/web
$ cp -r dist /ragflow/web
$ apt install nginx -y
$ cp ../docker/nginx/proxy.conf /etc/nginx
$ cp ../docker/nginx/nginx.conf /etc/nginx
$ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
$ systemctl start nginx
```

## 📚 문서
- [Quickstart](https://ragflow.io/docs/dev/)
Expand All @@ -322,4 +217,4 @@ $ docker compose up -d
## 🙌 컨트리뷰션
RAGFlow는 오픈소스 협업을 통해 발전합니다. 이러한 정신을 바탕으로, 우리는 커뮤니티의 다양한 기여를 환영합니다. 참여하고 싶으시다면, 먼저 [가이드라인](./docs/references/CONTRIBUTING.md)을 검토해 주세요.
RAGFlow는 오픈소스 협업을 통해 발전합니다. 이러한 정신을 바탕으로, 우리는 커뮤니티의 다양한 기여를 환영합니다. 참여하고 싶으시다면, 먼저 [가이드라인](./CONTRIBUTING.md)을 검토해 주세요.
Loading

0 comments on commit 8141efb

Please sign in to comment.