StackStorm / StackStorm/st2

FEATURE: per pack virtualenv_opts

Open
#3,650 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.