StackStorm / st2

StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, incident responses, troubleshooting, deployments, and more for DevOps and SREs. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html
https://stackstorm.com/
Apache License 2.0
6.07k stars 747 forks source link

when I install pack in stackstorm, how to let python's requirement.txt file installed in order? #5589

Open simonli866 opened 2 years ago

simonli866 commented 2 years ago

Hi, This is the installation process:

图片

nzlosh commented 2 years ago

It looks like the pandas version being pinned doesn't support Python3.6. Downgrade the pandas requirement or run St2 on a distribution that provides Python3.8 such as Ubuntu 20.04.

simonli866 commented 2 years ago

Yes, I noticed the problem. But how can i do this without changing the Python version of st2? So I would like to ask how to ensure that the dependency packages in the requirement.txt file can be executed without changing the order. @nzlosh

nzlosh commented 2 years ago

I don't understand what you mean by changing the order. As far as I can tell there's a versioning problem rather than an ordering problem.

Since pandas==1.3 is specified in requirements.txt and isn't available for Python3.6, the version of pandas must be set to one that supports Python3.6 so that pip can install it into the packs virtual environment.

simonli866 commented 2 years ago

图片 For example, I defined the requirement.txt , but when executed, pip is not installed first. This will cause the installation to fail.
I wonder if there is a way to install the packages defined in the current file sequentially in st2 without changing the environment. @nzlosh

simonli866 commented 2 years ago

The reason for not changing the environment is that I'm using stackStorm HA and I'm not sure if changing the base environment will affect other actions or functions

nzlosh commented 2 years ago

pip should not be arbitrarily be upgraded, the latest version of pip doesn't support Python3.6. I don't know the specific reasons for pinning pip to 20.3.3 but it is tested by St2 and is known to support Py3.6 and Py3.8.

The situation you're facing appears to be mainly caused by the latest versions of module dependencies not supporting Python3.6. Python3.6 is end of life already, so you'd be best switching to an OS that uses a newer version of Python3.8.

I don't use docker/kubernetes to run St2 so I'll let others offer help with that.