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

Ensure Python 3.6 or 3.7 is installed on all CI shards #7483

Merged
merged 10 commits into from Apr 3, 2019

Conversation

Projects
None yet
2 participants
@Eric-Arellano
Copy link
Contributor

commented Apr 2, 2019

Problem

Once all CI shards are guaranteed to have Python 3, we can port our more complex build-support scripts to Python 3, which will allow us to reduce technical debt and to bring benefits like better argument parsing.

In particular, we want to be able to use Python 3 in those scripts so that we can use subprocess.run().

Solution

For Linux, Travis pre-installs Python 3.6 and 3.7. We simply tell Travis we want those installed, and then set pyenv global to resolve everything for no performance cost.

OSX shards do not have Python 3 installed by default (at least for certain osx_images), so we use Pyenv to install on all shards. This is no longer very costly to do so thanks to caching Pyenv through
#7470.

Result

All shards now have Python 3.6 or 3.7.

Once we update the Centos6 Docker image in #7064, every where in CI will have Python 3. We can in the meantime now start porting scripts if we are confident they are never used by Docker.

@Eric-Arellano Eric-Arellano changed the title WIP: Ensure Python 3.6 or 3.7 is installed on all CI shards Ensure Python 3.6 or 3.7 is installed on all CI shards Apr 3, 2019

@Eric-Arellano Eric-Arellano requested review from cosmicexplorer, illicitonion and stuhood and removed request for cosmicexplorer Apr 3, 2019

@stuhood

stuhood approved these changes Apr 3, 2019

Copy link
Member

left a comment

Thanks, nice cleanup.

@Eric-Arellano Eric-Arellano merged commit cba72ae into pantsbuild:master Apr 3, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:py3-all-shards branch Apr 3, 2019

cosmicexplorer added a commit that referenced this pull request Apr 5, 2019

Install Python 2.7 and 3.6 on Centos6 base image through Pyenv (#7064)
### Problem

We have used a python 3 interpreter in CI for a while now, using `pyenv` to install this in our Dockerfiles instead of relying on CentOS's `scl` features, which don't allow for multiple pythons at a time. Using `pyenv` to install Python 2.7 as well instead of relying on the package manager allows us to upgrade or modify the image without screwing up our Python installation.

That work began in this PR and ended up in #6981, #7352, #7418, #7483, and more, but it then led to having to duplicate code across `travis_ci` and `travis_ci_py36` Dockerfiles. Using `pyenv` to install python in our `travis_ci` images also involves a significant setup time in bootstrap phases to install our desired pythons. Installing Python in the CentOS 6 base image avoids having to install Python at all in our CI, which saves us minutes in the bootstrap phase.

### Solution

- Use Pyenv to install Python 2.7 and Python 3.6 in the `centos6` Dockerfile.
- Remove `travis_cy_py36`.
- Modify the `travis_ci` Dockerfile to bootstrap pyenv itself if not available.

### Result

We get some CI time back in the bootstrap phase.

### TODO

- [ ] merge this PR
- [ ] publish the new `centos6` image to dockerhub at `pantsbuild/centos6:latest`
- [ ] merge a followup PR removing the manual pyenv bootstrapping from the `travis_ci` image.

stuhood added a commit that referenced this pull request Apr 8, 2019

Install Python 2.7 and 3.6 on Centos6 base image through Pyenv (#7064)
### Problem

We have used a python 3 interpreter in CI for a while now, using `pyenv` to install this in our Dockerfiles instead of relying on CentOS's `scl` features, which don't allow for multiple pythons at a time. Using `pyenv` to install Python 2.7 as well instead of relying on the package manager allows us to upgrade or modify the image without screwing up our Python installation.

That work began in this PR and ended up in #6981, #7352, #7418, #7483, and more, but it then led to having to duplicate code across `travis_ci` and `travis_ci_py36` Dockerfiles. Using `pyenv` to install python in our `travis_ci` images also involves a significant setup time in bootstrap phases to install our desired pythons. Installing Python in the CentOS 6 base image avoids having to install Python at all in our CI, which saves us minutes in the bootstrap phase.

### Solution

- Use Pyenv to install Python 2.7 and Python 3.6 in the `centos6` Dockerfile.
- Remove `travis_cy_py36`.
- Modify the `travis_ci` Dockerfile to bootstrap pyenv itself if not available.

### Result

We get some CI time back in the bootstrap phase.

### TODO

- [ ] merge this PR
- [ ] publish the new `centos6` image to dockerhub at `pantsbuild/centos6:latest`
- [ ] merge a followup PR removing the manual pyenv bootstrapping from the `travis_ci` image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.