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

HA: comment out Action Runner config virtualenv_opts = --always-copy #4891

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

punkrokk
Copy link
Member

@punkrokk punkrokk commented Mar 21, 2020

The problematic sample here is: virtualenv_opts = --always-copy from the st2-ha sample config.

This caused considerable frustration while following the ST2-HA setup guide.

[actionrunner]
logging = /etc/st2/logging.actionrunner.conf
**virtualenv_opts = --always-copy**

virtualenv_opts should be set in EL6, but from what I can tell, not in Ubuntu or EL >=7

There's a possibility that this should be comments out here also:

[actionrunner]
logging = /etc/st2/logging.actionrunner.conf
virtualenv_opts = --always-copy

but I suspect it may be used in testing.

@punkrokk punkrokk added this to the 3.2.0 milestone Mar 21, 2020
@pull-request-size pull-request-size bot added the size/XS PR that changes 0-9 lines. Quick fix/merge. label Mar 21, 2020
@punkrokk punkrokk added the bug label Mar 21, 2020
@arm4b
Copy link
Member

arm4b commented Mar 21, 2020

Can you describe in more detail what error did you get and what kind of unexpected behavior did you see?
Why it's not needed in U16, U18, EL7 and EL8? Is the issue only in HA config or in general installation?

@punkrokk
Copy link
Member Author

punkrokk commented Mar 22, 2020

@armab - the issue is only with the HA st2.conf. It looks like it’s an artifact of when CentOS 6 was around.

When I build a blueprint box with ST2 HA config from the docs, I get an OSError that as I chase it down makes no sense.

Here is the error:


error: st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Setting up virtualenv for pack "github" (/opt/stackstorm/packs/github)
st2.actions.python.SetupVirtualEnvironmentAction: INFO     Virtualenv path "/opt/stackstorm/virtualenvs/github" doesn't exist
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Creating virtualenv for pack "github" in "/opt/stackstorm/virtualenvs/github"
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Creating virtualenv in "/opt/stackstorm/virtualenvs/github" using Python binary "/opt/stackstorm/st2/bin/python"
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Running command "/opt/stackstorm/st2/bin/virtualenv -p /opt/stackstorm/st2/bin/python --always-copy --no-download /opt/stackstorm/virtualenvs/github" to create virtualenv.
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/python_runner/python_action_wrapper.py", line 333, in <module>
    obj.run()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/python_runner/python_action_wrapper.py", line 192, in run
    output = action.run(**self._parameters)
  File "/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_virtualenv.py", line 88, in run
    no_download=no_download)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/util/virtualenvs.py", line 97, in setup_pack_virtualenv
    use_python3=use_python3, no_download=no_download)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/util/virtualenvs.py", line 209, in create_virtualenv
    (virtualenv_path, stderr))
Exception: Failed to create virtualenv in "/opt/stackstorm/virtualenvs/github": Traceback (most recent call last):
  File "/opt/stackstorm/st2/bin/virtualenv", line 6, in <module>
    from virtualenv import main
ImportError: cannot import name main


traceback: None
failed_on: install pack dependencies
start_timestamp: Fri, 20 Mar 2020 18:28:41 UTC
end_timestamp: Fri, 20 Mar 2020 18:28:46 UTC

Here is the slack chat about it:

https://stackstorm-community.slack.com/archives/C066APT88/p1584636848194400

And it’s newer thread in #development

https://stackstorm-community.slack.com/archives/CSBELJ78A/p1584758847223300

I think is ask, why is it In the HA ST2.conf and not the standard one.

@arm4b
Copy link
Member

arm4b commented Mar 22, 2020

Thanks for more info.

I see now
https://github.com/StackStorm/st2-packages/blob/1fb2f7a60e5d88895a5dfed79c55edc68482dc43/packages/st2/Makefile#L115-L117

Adjusting st2.conf is handled by the packaging automatically depending on OS flavor and so virtualenv_opts is removed for EL-like systems (7 and 8), but remains for Ubuntu and EL6.

The issue here is that HA suggested custom st2.conf. The PR makes sense and issue only with the custom st2 config. st2.package.conf remains as before.

conf/HA/st2.conf.sample Outdated Show resolved Hide resolved
Co-Authored-By: Eugen C. <armab@users.noreply.github.com>
@punkrokk punkrokk requested a review from arm4b March 23, 2020 20:57
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@punkrokk punkrokk merged commit 74e476b into master Mar 24, 2020
@cognifloyd cognifloyd deleted the always-copy-bad branch July 24, 2022 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug size/XS PR that changes 0-9 lines. Quick fix/merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants