Open tonybaloney opened 6 years ago
the issue is this: https://github.com/StackStorm/st2/blob/master/requirements.txt#L25
We intentionally pin it to an older version because we had issues with upgrades in the past (in fact, we had a lot of issues with upgrading most of the oslo libraries so we tried to not touch and update it because it worked).
We can look into upgrading it again and hope it doesn't break anything this time.
Managing dependencies is always a PITA, especially when you are dealing with user content (packs). That's why we try to isolate user content as much as possible in a virtual environment, but sadly some system dependencies are still shared and used by the pack virtual environments.
I looked into upgrading oslo.config
and oslo.utils
, but it's sadly a big mess.
Upgrading to latest version of oslo config, substantially slows importing of the modules which rely on oslo.config. For example, importing of /data/stanley/contrib/runners/python_runner/python_runner/python_action_wrapper.py
goes from 0.12s
to 0.50s
which is unacceptable at the moment.
I tried to dig in, but it's a big rabbit hole and not much we can do about it, because we don't directly control code in oslo.config.
So sadly, for the time being, we can't upgrade because it negatively affects the performance.
@tonybaloney As far as a work-around goes - if you need to use newer version of oslo.config
in your pack, you can try adding a more recent version of oslo.config
in your pack requirements.txt
.
I believe that should work.
Can you please also clarify how you encountered that problem?
All the StackStorm code should work just fine with the oslo.config
version we currently use so I assume it affects some custom pack which relies on newer version of oslo.log
(or some openstack library) or similar.
@Kami see the Infoblox pack https://github.com/StackStorm-Exchange/stackstorm-infoblox/blob/master/requirements.txt
Note the changes made https://github.com/tonybaloney/infoblox-client/compare/infobloxopen:master...master
@Kami I am looking at getting the oslo.config
upgraded as it supports different configuration backends (like remote_file). I have created a Hashicorp Vault plugin that allows me to pull all the information out of Vault instead of storing the credentials in a plain text file.
What tests did you run to view the performance hit? I would like to try and observe if the latest release of oslo.conf
has this issue.
@Xorso Updating to a new release added a huge overhead to just importing that module which subsequently slowed every service startup and initialization (https://github.com/StackStorm/st2/issues/4160#issuecomment-394386433).
The most critical part was and is the Python runner action execution which must be fast. There we try to keep imports at the minimum and avoid any expensive imports.
Should be able to check that using profimp
or similar by using different oslo.config
releases - https://github.com/StackStorm/st2/blob/master/contrib/runners/python_runner/tests/integration/test_python_action_process_wrapper.py#L17.
Maybe they fixed / improved on it in a recent release, it has been a while since I last looked into it.
Looks like there still is a bit of a difference. profimp
is reporting that 6.6 is 243.91ms compared to 41.67ms for 1.6.1. That seems to be at the .24 seconds you mentioned earlier but seems faster than the .5s. That was running it on my MacBook Pro. I am guessing that big of an increase is something that still isn't acceptable?
Hello from the future! This issue is rearing its head for additional reasons now. If you configure a pack with python version 3.10 or newer, you run into import errors because the required version of oslo.config
(1.12.x) is using imports from the builtin collections
module that were deprecated in Python 3.3 (in 2012), and removed in Python 3.10.
This StackOverflow post pretty much sums up the issue
Currently, no installations run (by default) with Python 3.10 or newer, but manually configuring /etc/st2/st2.conf
to have actionrunner.python_binary
to point to a binary versioned 3.10, 3.11, or newer of these reveals this issue. Since #4571 was merged, this can be currently overcome by just installing a newer version of oslo.config
at the pack level (via the requirements.txt
-- version 8.8.0 seems to have worked for me) This will need to be addressed whenever this project decides to move beyond Python3.9.
ISSUE TYPE
STACKSTORM VERSION
OS / ENVIRONMENT / INSTALL METHOD
one-line install
SUMMARY
StackStorm requires a specific version of
oslo.config
. This version does not supportmutable
as an argument.The newer versions of
oslo.config
do.The issue is that when installing a newer version of
oslo.log
, it will depend upon this setting. So any packs which inadvertantly useoslo.log
will crash.STEPS TO REPRODUCE
oslo.log>1.8.0
EXPECTED RESULTS
No error :-)
ACTUAL RESULTS