Move docker image pulling for wheel buidler to pre-run (#5645)

This commit is contained in:
Alex Gaynor 2020-12-13 14:59:34 -05:00 committed by GitHub
parent 206300d1e4
commit a8bb7b03bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 36 deletions

View file

@ -29,6 +29,7 @@
- job:
name: pyca-cryptography-build-wheel
abstract: true
pre-run: .zuul.playbooks/playbooks/wheel/pre.yaml
run: .zuul.playbooks/playbooks/wheel/main.yaml
- job:

View file

@ -0,0 +1,42 @@
- hosts: all
tasks:
- name: Sanity check build list
assert:
that: wheel_builds is defined
- name: Run ensure-docker
include_role:
name: ensure-docker
- name: Workaround Linaro aarch64 cloud MTU issues
# NOTE(ianw) : Docker default networking, the Linaro NAT setup and
# *insert random things here* cause PMTU issues, resulting in hung
# connections, particularly to fastly CDN (particularly annoying
# because pypi and pythonhosted live behind that). Can remove after
# upstream changes merge, or we otherwise find a solution in the
# upstream cloud.
# https://review.opendev.org/747062
# https://review.opendev.org/746833
# https://review.opendev.org/747064
when: ansible_architecture == 'aarch64'
block:
- name: Install jq
package:
name: jq
state: present
become: yes
- name: Reset docker MTU
shell: |
jq --arg mtu 1400 '. + {mtu: $mtu|tonumber}' /etc/docker/daemon.json > /etc/docker/daemon.json.new
cat /etc/docker/daemon.json.new
mv /etc/docker/daemon.json.new /etc/docker/daemon.json
service docker restart
become: yes
- name: Pre-pull containers
command: >-
docker pull {{ item.image }}
become: yes
loop: '{{ wheel_builds }}'

View file

@ -11,36 +11,6 @@
include_role:
name: ensure-pip
- name: Run ensure-docker
include_role:
name: ensure-docker
- name: Workaround Linaro aarch64 cloud MTU issues
# NOTE(ianw) : Docker default networking, the Linaro NAT setup and
# *insert random things here* cause PMTU issues, resulting in hung
# connections, particularly to fastly CDN (particularly annoying
# because pypi and pythonhosted live behind that). Can remove after
# upstream changes merge, or we otherwise find a solution in the
# upstream cloud.
# https://review.opendev.org/747062
# https://review.opendev.org/746833
# https://review.opendev.org/747064
when: ansible_architecture == 'aarch64'
block:
- name: Install jq
package:
name: jq
state: present
become: yes
- name: Reset docker MTU
shell: |
jq --arg mtu 1400 '. + {mtu: $mtu|tonumber}' /etc/docker/daemon.json > /etc/docker/daemon.json.new
cat /etc/docker/daemon.json.new
mv /etc/docker/daemon.json.new /etc/docker/daemon.json
service docker restart
become: yes
# We build an sdist of the checkout, and then build wheels from the
# sdist. This ensures that nothing is left out of the sdist.
- name: Install sdist required packages
@ -95,12 +65,6 @@
dest: '{{ _build_dir }}'
mode: 0755
- name: Pre-pull containers
command: >-
docker pull {{ item.image }}
become: yes
loop: '{{ wheel_builds }}'
- name: Run builds
command: |
docker run --rm \