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

Skip recreating the virtualenv if it already exists #3221

Closed
edmorley opened this issue Nov 2, 2017 · 5 comments
Closed

Skip recreating the virtualenv if it already exists #3221

edmorley opened this issue Nov 2, 2017 · 5 comments
Labels
Improvement Minor improvement to code Needed: more information A reply from issue author is required

Comments

@edmorley
Copy link

edmorley commented Nov 2, 2017

Hi!

I noticed looking at the build log, that even with a cached build directory, time was wasted trying to recreate the virtualenv.

For example from this log, there is:

$ python2.7 -mvirtualenv --no-site-packages --no-download /home/docs/checkouts/readthedocs.org/user_builds/treeherder/envs/latest 

New python executable in /home/docs/checkouts/readthedocs.org/user_builds/treeherder/envs/latest/bin/python2.7
Also creating executable in /home/docs/checkouts/readthedocs.org/user_builds/treeherder/envs/latest/bin/python
Installing setuptools, pip, wheel...done.

 Command time: 2s Return: 0 

Whilst it's only a few seconds, it would still be good to avoid recreating the virtualenv if not necessary (if needed a python/pip version check could be added to ensure they get upgraded if needed).

(Reducing the end-to-end time will hopefully avoid the problems we're seeing with jobs overlapping and hitting #2901)

Many thanks :-)

@RichardLitt RichardLitt added the Improvement Minor improvement to code label Nov 3, 2017
@safwanrahman
Copy link
Member

There are some problem about removing the existing package that are not in your requirements.
Like, foo is installed and later removed from the requirements. But if the virtualenv does not recreate, foo will be in the virtualenv. In this way, if a broken package come to the vritualenv, it will be hard to remove that!

@edmorley
Copy link
Author

Oh I thought that the installed packages were already being re-used (otherwise why is there the clear cache feature?), and so this issue was about stopping the virtualenv being reinstalled over the top of an existing dirty virtualenv. However from your comment it seems that the virtualenv isn't ever re-used at all?

@stsewd
Copy link
Member

stsewd commented May 10, 2018

@stsewd
Copy link
Member

stsewd commented May 10, 2018

I think this feature is not needed if the cache directory is outside the virtual environment, right?

@stsewd stsewd added the Needed: more information A reply from issue author is required label May 10, 2018
@stsewd
Copy link
Member

stsewd commented Jul 6, 2018

Closing this as I think is not needed because we already cached the packages installed in the virtual environment and we can't reuse the virtual environment.

@stsewd stsewd closed this as completed Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: more information A reply from issue author is required
Projects
None yet
Development

No branches or pull requests

4 participants