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

Fix dh-virtualenv packages build, avoid updating pip to latest v10.0 #549

Merged
merged 5 commits into from
Apr 17, 2018

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Apr 17, 2018

Related to: StackStorm/st2-dockerfiles#58 StackStorm/st2-dockerfiles#59 StackStorm/st2-dockerfiles#60

pip recently released new v10.0 which broke the dh-virtualenv packages build.

So here is the rabbit hole.
While we use & pin virtualenv 15.1.0 which advertizes to install pip 9.0.1 (https://virtualenv.pypa.io/en/stable/changes/#id1) it doesn't happen in reality.

Obviously, at it happens in software world, it's not a bug but a feature, - virtualenv since 14.0.1 installs latest available (!) pip version by default when user creates a new virtualenv (see pypa/virtualenv#1044 and pypa/virtualenv#1157).

To avoid this behavior in virtualenv and stick with expected associated pip version, --no-download flag was added (see https://virtualenv.pypa.io/en/stable/changes/#id12):

Download new releases of the preinstalled software from PyPI when there are new releases available. This behavior can be disabled using --no-download.

Well, it means that once we updated to newer virtualenv version (14.0.1+) which installs latest pip by default, we opened a can of worms.

TODO

@bigmstone
Copy link
Contributor

bigmstone commented Apr 17, 2018

@armab I assume tests will be 💚once you update dh-virtualenv fork?

Just did a bit more digging into the circle report (Hate when I have to download the output). Answered my own question.

@Kami
Copy link
Member

Kami commented Apr 17, 2018

Good catch - I confirmed this nasty virtualenv env behavior locally.

vagrant@local$ virtualenv footest
New python executable in /data/st2docs/footest/bin/python
Installing setuptools, pip, wheel...done.
vagrant@local$ footest/bin/pip --version
pip 10.0.0 from /data/st2docs/footest/local/lib/python2.7/site-packages/pip (python 2.7)
vagrant@local$ virtualenv --no-download footest2
New python executable in /data/st2docs/footest2/bin/python
Installing setuptools, pip, wheel...done.
vagrant@local$ footest2/bin/pip --version
pip 9.0.1 from /data/st2docs/footest2/local/lib/python2.7/site-packages (python 2.7)

It looks like we might indeed need to update all of our Makefiles where we use virtualenv to create virtualenv and pass in --no-download to use pip 9.0.1 for the time being.

@Kami
Copy link
Member

Kami commented Apr 17, 2018

As far as st2 pack install goes - I confirmed it results in the same behavior since we also use latest version of virtualenv there.

So while it does install latest version of pip (10.0.0) it doesn't seem to break packs. In theory it shouldn't, because (in ideal world) packs should never import from pip or do anything like that.

Having said that, I still think it's probably safer and better (and results in more reproducible virtualenv creations) to pass --no-download flag to virtualenv binary while creating a pack virtual environment.

armab added 4 commits April 17, 2018 21:57
Prevent virtualenv from installing latest available pip version
Probably confused with `apt-get update` which fetches packages meta.
Everything should be pre-packaged in Docker image.
@arm4b arm4b removed the WIP label Apr 17, 2018
@arm4b arm4b merged commit 582c074 into master Apr 17, 2018
@arm4b arm4b deleted the fix/dh-virtualenv branch April 17, 2018 21:54
@Kami
Copy link
Member

Kami commented Apr 18, 2018

Nice work - thanks!

I will merge two st2 PRs into master, test them on staging unstable on all the distros (really just "st2 pack install" needs to be tested) and start working on 2.7.1 when everything is in order :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants