FEATURE: per pack virtualenv_opts
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
A significant problem for the ansible pack is that pack users need more requirements than just ansible based on the playbooks or ansible plugins/lookups they are trying to run (see StackStorm-Exchange/stackstorm-ansible#5).
One way to solve this would be to allow packs to say: "I need access to system packages". This can be accomplished across all packs by setting:
[actionrunner]
virtualenv_opts = --system-site-packages
But I hesitate to do that for all packs because I don't want to deal with elusive bugs in StackStorm when I upgrade something unrelated on the system.
So, please add a way to set virtualenv_opts on a per pack basis, or perhaps a flag that says "use --system-site-packages.
A cursory look through the code suggests that at least these places would need to change:
- st2common/st2common/util/virtualenvs
- setup_pack_virtualenv() needs an opts arg.
- create_virtualenv() needs an opts arg merged with global
virtualenv_optson lines 129, 141
- contrib/packs/actions/pack_mgmt/setup_virtualenv
- run() would need to get config or metadata for each pack to add any pack specific extra options.
- st2common/st2common/content/bootstrap
- setup_virtualenvs() would need the same config/metadata lookup as above.
Would we want this to be something in pack config or metadata, and if metadata, should there be an option in the pack config to disable or change the behavior?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with st2common/st2common/util/virtualenvs.py, especially setup_pack_virtualenv() and create_virtualenv(), then trace callers in contrib/packs/actions/pack_mgmt/setup_virtualenv.py and st2common/st2common/content/bootstrap.py. Determine how pack configuration or metadata should provide extra virtualenv options and how those options interact with global virtualenv_opts. Done means per-pack options can be selected during both setup paths without changing existing global behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100