Skip to content

Conversation

@Kami
Copy link
Member

@Kami Kami commented Jun 28, 2018

Based on #569 - it fixes path to the st2 virtual environment.

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.

@bigmstone @m4dcoder @Kami @enykeev

Re #569, #570 and this PR.

We shouldn't run any long-running, downloading, installing or compiling executions in deb/rpm post-install scriptlets (eg. when user installs the package).
Instead all the python dependencies and stuff should be bundled during the package build stage.

That's the main point of this dh_virtualenv packaging work we did before: off-load the installation executions on build time, not on run-time or install-time.

Please find the way to run install on build-time and bundle changes in virtualenv.

@arm4b
Copy link
Member

arm4b commented Jun 28, 2018

To be clear, this is what happens on st2 package install time, while processing like that should be done on deb/rpm build time and already bundled in a shipped package:

  Installing : st2-2.8dev-77.x86_64                                         3/3 
[872b7678]      Installing orchestra runner
[872b7678]      running install
[872b7678]      running bdist_egg
[872b7678]      running egg_info
[872b7678]      creating stackstorm_runner_orchestra.egg-info
[872b7678]      writing requirements to stackstorm_runner_orchestra.egg-info/requires.txt
[872b7678]      writing stackstorm_runner_orchestra.egg-info/PKG-INFO
[872b7678]      writing top-level names to stackstorm_runner_orchestra.egg-info/top_level.txt
[872b7678]      writing dependency_links to stackstorm_runner_orchestra.egg-info/dependency_links.txt
[872b7678]      writing entry points to stackstorm_runner_orchestra.egg-info/entry_points.txt
[872b7678]      writing manifest file 'stackstorm_runner_orchestra.egg-info/SOURCES.txt'
[872b7678]      reading manifest file 'stackstorm_runner_orchestra.egg-info/SOURCES.txt'
[872b7678]      reading manifest template 'MANIFEST.in'
[872b7678]      warning: no files found matching '__init__.py'
[872b7678]      warning: no files found matching 'README.rst'
[872b7678]      warning: no files found matching 'CHANGELOG.rst'
[872b7678]      warning: no files found matching 'LICENSE'
[872b7678]      warning: no previously-included files matching '*.pyc' found anywhere in distribution
[872b7678]      writing manifest file 'stackstorm_runner_orchestra.egg-info/SOURCES.txt'
[872b7678]      installing library code to build/bdist.linux-x86_64/egg
[872b7678]      running install_lib
[872b7678]      running build_py
[872b7678]      creating build
[872b7678]      creating build/lib
[872b7678]      creating build/lib/functions
[872b7678]      copying functions/st2kv.py -> build/lib/functions
[872b7678]      copying functions/__init__.py -> build/lib/functions
[872b7678]      creating build/lib/orchestra_runner
[872b7678]      copying orchestra_runner/__init__.py -> build/lib/orchestra_runner
[872b7678]      copying orchestra_runner/orchestra_runner.py -> build/lib/orchestra_runner
[872b7678]      creating build/lib/tests
[872b7678]      creating build/lib/tests/unit
[872b7678]      copying tests/unit/test_orchestra_data_flow.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/base.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/test_functions.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/test_orchestra_basic.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/test_orchestra_cancel.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/test_orchestra_error_handling.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/test_orchestra_pause_and_resume.py -> build/lib/tests/unit
[872b7678]      copying tests/unit/__init__.py -> build/lib/tests/unit
[872b7678]      creating build/lib/tests/integration
[872b7678]      copying tests/integration/test_functions.py -> build/lib/tests/integration
[872b7678]      copying tests/integration/__init__.py -> build/lib/tests/integration
[872b7678]      copying orchestra_runner/runner.yaml -> build/lib/orchestra_runner
[872b7678]      creating build/bdist.linux-x86_64
[872b7678]      creating build/bdist.linux-x86_64/egg
[872b7678]      creating build/bdist.linux-x86_64/egg/functions
[872b7678]      copying build/lib/functions/st2kv.py -> build/bdist.linux-x86_64/egg/functions
[872b7678]      copying build/lib/functions/__init__.py -> build/bdist.linux-x86_64/egg/functions
[872b7678]      creating build/bdist.linux-x86_64/egg/tests
[872b7678]      creating build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/test_orchestra_data_flow.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/base.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/test_functions.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/test_orchestra_basic.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/test_orchestra_cancel.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/test_orchestra_error_handling.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/test_orchestra_pause_and_resume.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      copying build/lib/tests/unit/__init__.py -> build/bdist.linux-x86_64/egg/tests/unit
[872b7678]      creating build/bdist.linux-x86_64/egg/tests/integration
[872b7678]      copying build/lib/tests/integration/test_functions.py -> build/bdist.linux-x86_64/egg/tests/integration
[872b7678]      copying build/lib/tests/integration/__init__.py -> build/bdist.linux-x86_64/egg/tests/integration
[872b7678]      creating build/bdist.linux-x86_64/egg/orchestra_runner
[872b7678]      copying build/lib/orchestra_runner/__init__.py -> build/bdist.linux-x86_64/egg/orchestra_runner
[872b7678]      copying build/lib/orchestra_runner/orchestra_runner.py -> build/bdist.linux-x86_64/egg/orchestra_runner
[872b7678]      copying build/lib/orchestra_runner/runner.yaml -> build/bdist.linux-x86_64/egg/orchestra_runner
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/functions/st2kv.py to st2kv.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/functions/__init__.py to __init__.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/test_orchestra_data_flow.py to test_orchestra_data_flow.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/base.py to base.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/test_functions.py to test_functions.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/test_orchestra_basic.py to test_orchestra_basic.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/test_orchestra_cancel.py to test_orchestra_cancel.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/test_orchestra_error_handling.py to test_orchestra_error_handling.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/test_orchestra_pause_and_resume.py to test_orchestra_pause_and_resume.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/unit/__init__.py to __init__.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/integration/test_functions.py to test_functions.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/tests/integration/__init__.py to __init__.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/orchestra_runner/__init__.py to __init__.pyc
[872b7678]      byte-compiling build/bdist.linux-x86_64/egg/orchestra_runner/orchestra_runner.py to orchestra_runner.pyc
[872b7678]      creating build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      copying stackstorm_runner_orchestra.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
[872b7678]      creating dist
[872b7678]      creating 'dist/stackstorm_runner_orchestra-2.5.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
[872b7678]      removing 'build/bdist.linux-x86_64/egg' (and everything under it)
[872b7678]      Processing stackstorm_runner_orchestra-2.5.0-py2.7.egg
[872b7678]      creating /opt/stackstorm/st2/lib/python2.7/site-packages/stackstorm_runner_orchestra-2.5.0-py2.7.egg
[872b7678]      Extracting stackstorm_runner_orchestra-2.5.0-py2.7.egg to /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Adding stackstorm-runner-orchestra 2.5.0 to easy-install.pth file
[872b7678]      
[872b7678]      Installed /opt/stackstorm/st2/lib/python2.7/site-packages/stackstorm_runner_orchestra-2.5.0-py2.7.egg
[872b7678]      Processing dependencies for stackstorm-runner-orchestra==2.5.0
[872b7678]      Searching for orchestra==0.1
[872b7678]      Best match: orchestra 0.1
[872b7678]      Adding orchestra 0.1 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for yaql==1.1.3
[872b7678]      Best match: yaql 1.1.3
[872b7678]      Adding yaql 1.1.3 to easy-install.pth file
[872b7678]      Installing yaql script to /opt/stackstorm/st2/bin
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for stevedore==1.28.0
[872b7678]      Best match: stevedore 1.28.0
[872b7678]      Adding stevedore 1.28.0 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for six==1.11.0
[872b7678]      Best match: six 1.11.0
[872b7678]      Adding six 1.11.0 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for PyYAML==3.12
[872b7678]      Best match: PyYAML 3.12
[872b7678]      Adding PyYAML 3.12 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for python-dateutil==2.7.3
[872b7678]      Best match: python-dateutil 2.7.3
[872b7678]      Adding python-dateutil 2.7.3 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for networkx==1.11
[872b7678]      Best match: networkx 1.11
[872b7678]      Adding networkx 1.11 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for jsonschema==2.6.0
[872b7678]      Best match: jsonschema 2.6.0
[872b7678]      Adding jsonschema 2.6.0 to easy-install.pth file
[872b7678]      Installing jsonschema script to /opt/stackstorm/st2/bin
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for Jinja2==2.10
[872b7678]      Best match: Jinja2 2.10
[872b7678]      Adding Jinja2 2.10 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for Babel==2.6.0
[872b7678]      Best match: Babel 2.6.0
[872b7678]      Adding Babel 2.6.0 to easy-install.pth file
[872b7678]      Installing pybabel script to /opt/stackstorm/st2/bin
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for pbr==4.0.4
[872b7678]      Best match: pbr 4.0.4
[872b7678]      Adding pbr 4.0.4 to easy-install.pth file
[872b7678]      Installing pbr script to /opt/stackstorm/st2/bin
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for ply==3.11
[872b7678]      Best match: ply 3.11
[872b7678]      Adding ply 3.11 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for decorator==4.3.0
[872b7678]      Best match: decorator 4.3.0
[872b7678]      Adding decorator 4.3.0 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for functools32==3.2.3.post2
[872b7678]      Best match: functools32 3.2.3.post2
[872b7678]      Adding functools32 3.2.3.post2 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for MarkupSafe==1.0
[872b7678]      Best match: MarkupSafe 1.0
[872b7678]      Adding MarkupSafe 1.0 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Searching for pytz==2018.4
[872b7678]      Best match: pytz 2018.4
[872b7678]      Adding pytz 2018.4 to easy-install.pth file
[872b7678]      
[872b7678]      Using /opt/stackstorm/st2/lib/python2.7/site-packages
[872b7678]      Finished processing dependencies for stackstorm-runner-orchestra==2.5.0

@Kami
Copy link
Member Author

Kami commented Jun 28, 2018

@armab I agree (as far as a long term solution goes).

We had a discussion on this on Slack and here - StackStorm/st2#4210 (comment)

I would prefer to do it the right way, but we are already a bit late with v2.8.0 and doing it correct way is a lot more involved.

We started preparing the foundation for runners as a packages in the past, but we weren't in a rush to move and ship runners as packages (build wheels and handle them as any other Python dependencies).

Everything worked just fine as it was, so there was no rush, but Orchestra uses stevedore to dynamically load filter plugins (good thing, imo) and that won't work with the current approach.

We either need to do a workaround similar to one here for v2.8.0 or do it correctly.

I'm we decide to go with "do it correctly for v2.8.0", I'm sure that will delay the release for at least 3 days and it's also not something I want to rush (big code and packaging changes days before release) so I would prefer to do the right way in 2.9.0, if possible.

One compromise for v2.8.0 would be to look into building a wheel and doing that on the build time, but still use current runner loading code in StackStorm/st2.

This is not ideal, because once we install runners as Python packages in st2 virtual environment, most of the loading code in st2 is redundant (and could potentially cause issues), but this way we reduce the scope of work for v2.8.0.

@bigmstone I saw the discussion on Slack, I'm fine with doing it in the Makefile which you linked where we already handle other wheels.

One option would also be to not support st2kv functions in Orchestra in v2.8.0, but that's for others to decide.

@enykeev
Copy link
Member

enykeev commented Jun 28, 2018

Just to be clear, the change will still work for airgapped envs?

@enykeev enykeev changed the title Fix path to st2 virtual environmet Fix path to st2 virtual environment Jun 28, 2018
@Kami
Copy link
Member Author

Kami commented Jun 28, 2018

@enykeev In theory it should since all other Orchestra requirements should already be installed in st2 virtualenv then (we are only running setup.py install to install stevedore plugins), but I'm with @armab on that one.

Still messy and I would prefer to go with some other approach as described above.

@Kami
Copy link
Member Author

Kami commented Jun 29, 2018

Superseded by #572.

@Kami Kami closed this Jun 29, 2018
@Kami Kami deleted the fix_venv_path branch June 29, 2018 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants