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

Additional dependencies #234

Closed
cdalvaro opened this issue Mar 7, 2024 Discussed in #233 · 2 comments · Fixed by #236
Closed

Additional dependencies #234

cdalvaro opened this issue Mar 7, 2024 Discussed in #233 · 2 comments · Fixed by #236
Assignees
Labels
enhancement New feature or request suggestions-accepted Suggestions are welcome

Comments

@cdalvaro
Copy link
Owner

cdalvaro commented Mar 7, 2024

Discussed in #233

Originally posted by abhi1693 March 7, 2024
What is the best way to install additional dependencies into the container so that it persists across reboots?

As requested by @abhi1693, it's a good enhancement for this project to add support for additional dependencies.

The main idea is to be able to install python packages when the container starts before running salt-master so modules that require extra packages can fulfill their requirements.

Two approaches can be taken:

  • Install dependencies providing a requirements.txt file
  • Specify python packages using an environment variable

Both approaches can be implemented. Since one method can be more suitable than the other depending each configuration.

I think we can use the environment variables PYTHON_PACKAGES_FILE and PYTHON_PACKAGES to specify the requirements.txt file and a list of packages, respectively.

Allowing both systems at the same time can be confusing, so the first one will take priority over the second one. So, when the env variable PYTHON_PACKAGES_FILE is defined, PYTHON_PACKAGES will be ignored.

PYTHON_PACKAGES will be directly forwarded to the pip install command. So, as long it respects pip install format, all pip functionality will be supported.

@cdalvaro cdalvaro added enhancement New feature or request suggestions-accepted Suggestions are welcome labels Mar 7, 2024
@cdalvaro cdalvaro self-assigned this Mar 7, 2024
@abhi1693
Copy link

abhi1693 commented Mar 7, 2024

I think I would prefer requirements.txt. So, if I understand correctly, the entrypoint will read this file and invoke salt-pip install <pkg> on startup? Salt packages its own python if I'm not wrong so running salt-pip seems more preferable than pip install to me.

@cdalvaro
Copy link
Owner Author

cdalvaro commented Mar 7, 2024

I think I would prefer requirements.txt. So, if I understand correctly, the entrypoint will read this file and invoke salt-pip install <pkg> on startup? Salt packages its own python if I'm not wrong so running salt-pip seems more preferable than pip install to me.

🎯 That's it! I think I'll have ready tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request suggestions-accepted Suggestions are welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants