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

Updating pyenv locally to reduce Travis time #1726

Merged
merged 6 commits into from
Feb 12, 2019

Conversation

delapuente
Copy link
Contributor

@delapuente delapuente commented Jan 29, 2019

Summary

This pull request avoid updating brew by manually installing python-build, which is the pyenv plugin in charge of downloading and compiling the Python interpreters. It turns out, python-build can be installed standalone. The PR also adds a cache for the interpreter so if it already exists, it is not compiled twice.

@1ucian0
Copy link
Member

1ucian0 commented Jan 29, 2019

Numbers with the improvement?

@delapuente delapuente force-pushed the reducint-times branch 3 times, most recently from 2665d82 to 25cf287 Compare January 29, 2019 23:24
Most of the time spent on iOS instances came from:
  * Updating brew so pyenv is able to install the latest Python
versions.
  * Building the Python versions.

The patch removes the need of brew by installing pyenv directly. This
pyenv is then used to build the three Python interpreters that we
support. Now, we cache these builds. Finally we setup the Python
environment in the same way we did before the patch.

Now the fixing downloads and build the three environments thrice in the
worst case (when there is no cache) and updating a Python version, (which
is expected for Python 7) requires clearing the cache.
@delapuente delapuente requested a review from kdk as a code owner February 11, 2019 19:17
@delapuente
Copy link
Contributor Author

delapuente commented Feb 12, 2019

Around 15 minutes total considering now we test Python 3.5 in MacOS. Should we test Python 3.6 and 3.7 only? @diego-plan9 @1ucian0 ?

@delapuente delapuente changed the title [WIP] Updating pyenv locally to reduce Travis time Updating pyenv locally to reduce Travis time Feb 12, 2019
@delapuente
Copy link
Contributor Author

@1ucian0 this is ready.

@diego-plan9 diego-plan9 merged commit 510d076 into Qiskit:master Feb 12, 2019
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
* Aggressively caching pyenv directory.

Most of the time spent on iOS instances came from:
  * Updating brew so pyenv is able to install the latest Python
versions.
  * Building the Python versions.

The patch removes the need of brew by installing pyenv directly. This
pyenv is then used to build the three Python interpreters that we
support. Now, we cache these builds. Finally we setup the Python
environment in the same way we did before the patch.

Now the fixing downloads and build the three environments thrice in the
worst case (when there is no cache) and updating a Python version, (which
is expected for Python 7) requires clearing the cache.

* Now each version is responsible of the proper Python version

* Restoring tests
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.

None yet

3 participants