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

[Feature Request]: Dynamically create the service_conf.yaml file by replacing environment variables from .env #3322

Closed
1 task done
gschmutz opened this issue Nov 10, 2024 · 6 comments

Comments

@gschmutz
Copy link
Contributor

gschmutz commented Nov 10, 2024

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

Manually editing the service_conf.yaml file and keeping it in sync with the .env file could be avoided by dynamically replacing the values by the environment variables.

Describe the feature you'd like

Instead of manually having to edit the service_conf.yaml file and mapping it into the docker container at runtime, a template file could be used and the values replaced by the environment variables from the .env file.

ragflow:
  host: ${RAGFLOW_HOST:-0.0.0.0}
  http_port: 9380
mysql:
  name: '${MYSQL_DBNAME:-rag_flow}'
  user: '${MYSQL_USER:-root}'
  password: '${MYSQL_PASSWORD:-infini_rag_flow}'
  host: '${MYSQL_HOST:-mysql}'
  port: 3306
  max_connections: 100
  stale_timeout: 30
...

This template file needs to be copied into the docker image so that it is available for the replacement.

The replacement of the env vars would be done in the entrypoint.sh file and the mapping of the service_conf.yaml file in the docker-compose.yaml is no longer necessary.

Describe implementation you've considered

see description above.

I have it working locally and could submit a pull request with the changes.

Documentation, adoption, use case

No response

Additional information

No response

@KevinHuSh
Copy link
Collaborator

Waiting for that good PR...
Appreciate it.

@gschmutz
Copy link
Contributor Author

gschmutz commented Nov 11, 2024

Just submitted the PR. Also changed the documentation accordingly. I decided to name the template file service_conf.yaml.template to distinguish it from the service_conf.yaml file, which is generated and used at runtime.

And I was only able to change the EN version of the documentation ;-)

@gschmutz
Copy link
Contributor Author

gschmutz commented Nov 11, 2024

@KevinHuSh by the way, the reason why I needed this feature, is the fact that I want to add RAGFlow to the Platys Modern Data Platform stack, a flexible way to generate docker-compose.yml files with various combinations of components (soon including RAGFlow).

yuzhichang added a commit that referenced this issue Nov 12, 2024
…t variables from .env (#3341)

### What problem does this PR solve?

This pull request implements the feature mentioned in #3322. 

Instead of manually having to edit the `service_conf.yaml` file when
changes have been made to `.env` and mapping it into the docker
container at runtime, a template file is used and the values replaced by
the environment variables from the `.env` file when the container is
started.
 

### Type of change

- [X] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
Co-authored-by: Zhichang Yu <yuzhichang@gmail.com>
@yuzhichang
Copy link
Member

@gschmutz ragflow uses one of elasticsearch and infinity as the chunk store. It chould be an issue for Platys to select one.

@gschmutz
Copy link
Contributor Author

@gschmutz ragflow uses one of elasticsearch and infinity as the chunk store. It chould be an issue for Platys to select one.

Hi @yuzhichang just saw the changes in the docker-compose-base.yaml, will integrate it into Platys, thanks for letting me know. Also wasn't aware of Infinity.

@yuzhichang
Copy link
Member

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants