Add other architectures and pypy to pinned image config.
Also, restructure the file to have platform first, then manylinux version
This commit is contained in:
@@ -1,59 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import os, subprocess, requests, configparser
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
os.chdir(os.path.dirname(__file__))
|
|
||||||
os.chdir('..')
|
|
||||||
|
|
||||||
os.environ['CUSTOM_COMPILE_COMMAND'] = "bin/update_constraints"
|
|
||||||
subprocess.check_call([
|
|
||||||
'pip-compile',
|
|
||||||
'--allow-unsafe',
|
|
||||||
'--generate-hashes',
|
|
||||||
'--upgrade',
|
|
||||||
'cibuildwheel/resources/constraints.in',
|
|
||||||
])
|
|
||||||
subprocess.check_call([
|
|
||||||
'./env2/bin/pip-compile',
|
|
||||||
'--allow-unsafe',
|
|
||||||
'--generate-hashes',
|
|
||||||
'--upgrade',
|
|
||||||
'cibuildwheel/resources/constraints.in',
|
|
||||||
'--output-file', 'cibuildwheel/resources/constraints-python27.txt'
|
|
||||||
])
|
|
||||||
|
|
||||||
Image = namedtuple('Image', ['manylinux_version', 'arch'])
|
|
||||||
|
|
||||||
images = [
|
|
||||||
Image('manylinux1', 'x86_64'), Image('manylinux1', 'i686'),
|
|
||||||
Image('manylinux2010', 'x86_64'), Image('manylinux2010', 'i686'),
|
|
||||||
Image('manylinux2014', 'x86_64'), Image('manylinux2014', 'i686'),
|
|
||||||
]
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
|
|
||||||
for image in images:
|
|
||||||
repository_name = '{}_{}'.format(image.manylinux_version, image.arch)
|
|
||||||
quay_api_url = 'https://quay.io/api/v1/repository/pypa/{}?includeTags=true'.format(repository_name)
|
|
||||||
repo_info = requests.get(quay_api_url).json()
|
|
||||||
tags_dict = repo_info['tags']
|
|
||||||
|
|
||||||
latest_tag = tags_dict.pop('latest')
|
|
||||||
|
|
||||||
# find the tag whose manifest matches 'latest'
|
|
||||||
tag_name = next(
|
|
||||||
name
|
|
||||||
for (name, info) in tags_dict.items()
|
|
||||||
if info['manifest_digest'] == latest_tag['manifest_digest']
|
|
||||||
)
|
|
||||||
|
|
||||||
image_name = 'quay.io/pypa/{}_{}:{}'.format(image.manylinux_version, image.arch, tag_name)
|
|
||||||
|
|
||||||
if not config.has_section(image.manylinux_version):
|
|
||||||
config[image.manylinux_version] = {}
|
|
||||||
|
|
||||||
config[image.manylinux_version][image.arch] = image_name
|
|
||||||
|
|
||||||
with open('cibuildwheel/resources/pinned_docker_images.cfg', 'w') as f:
|
|
||||||
config.write(f)
|
|
||||||
Executable
+95
@@ -0,0 +1,95 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import configparser
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
os.chdir(os.path.dirname(__file__))
|
||||||
|
os.chdir('..')
|
||||||
|
|
||||||
|
os.environ['CUSTOM_COMPILE_COMMAND'] = "bin/update_constraints"
|
||||||
|
subprocess.check_call([
|
||||||
|
'pip-compile',
|
||||||
|
'--allow-unsafe',
|
||||||
|
'--generate-hashes',
|
||||||
|
'--upgrade',
|
||||||
|
'cibuildwheel/resources/constraints.in',
|
||||||
|
])
|
||||||
|
subprocess.check_call([
|
||||||
|
'./env2/bin/pip-compile',
|
||||||
|
'--allow-unsafe',
|
||||||
|
'--generate-hashes',
|
||||||
|
'--upgrade',
|
||||||
|
'cibuildwheel/resources/constraints.in',
|
||||||
|
'--output-file', 'cibuildwheel/resources/constraints-python27.txt'
|
||||||
|
])
|
||||||
|
|
||||||
|
Image = namedtuple('Image', [
|
||||||
|
'manylinux_version',
|
||||||
|
'platform',
|
||||||
|
'image_name',
|
||||||
|
])
|
||||||
|
|
||||||
|
images = [
|
||||||
|
Image('manylinux1', 'x86_64', 'quay.io/pypa/manylinux1_x86_64'),
|
||||||
|
Image('manylinux1', 'i686', 'quay.io/pypa/manylinux1_i686'),
|
||||||
|
|
||||||
|
Image('manylinux2010', 'x86_64', 'quay.io/pypa/manylinux2010_x86_64'),
|
||||||
|
Image('manylinux2010', 'i686', 'quay.io/pypa/manylinux2010_i686'),
|
||||||
|
Image('manylinux2010', 'pypy_x86_64', 'pypywheels/manylinux2010-pypy_x86_64'),
|
||||||
|
|
||||||
|
Image('manylinux2014', 'x86_64', 'quay.io/pypa/manylinux2014_x86_64'),
|
||||||
|
Image('manylinux2014', 'i686', 'quay.io/pypa/manylinux2014_i686'),
|
||||||
|
Image('manylinux2014', 'aarch64', 'quay.io/pypa/manylinux2014_aarch64'),
|
||||||
|
Image('manylinux2014', 'ppc64le', 'quay.io/pypa/manylinux2014_ppc64le'),
|
||||||
|
Image('manylinux2014', 's390x', 'quay.io/pypa/manylinux2014_s390x'),
|
||||||
|
]
|
||||||
|
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
|
||||||
|
for image in images:
|
||||||
|
# get the tag name whose digest matches 'latest'
|
||||||
|
if image.image_name.startswith('quay.io/'):
|
||||||
|
_, _, repository_name = image.image_name.partition('/')
|
||||||
|
response = requests.get(
|
||||||
|
f'https://quay.io/api/v1/repository/{repository_name}?includeTags=true'
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
repo_info = response.json()
|
||||||
|
tags_dict = repo_info['tags']
|
||||||
|
|
||||||
|
latest_tag = tags_dict.pop('latest')
|
||||||
|
# find the tag whose manifest matches 'latest'
|
||||||
|
tag_name = next(
|
||||||
|
name
|
||||||
|
for (name, info) in tags_dict.items()
|
||||||
|
if info['manifest_digest'] == latest_tag['manifest_digest']
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
response = requests.get(
|
||||||
|
f'https://hub.docker.com/v2/repositories/{image.image_name}/tags'
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
tags = response.json()['results']
|
||||||
|
|
||||||
|
latest_tag = next(
|
||||||
|
tag for tag in tags if tag['name'] == 'latest'
|
||||||
|
)
|
||||||
|
# i don't know what it would mean to have multiple images per tag
|
||||||
|
assert len(latest_tag['images']) == 1
|
||||||
|
digest = latest_tag['images'][0]['digest']
|
||||||
|
|
||||||
|
pinned_tag = next(
|
||||||
|
tag for tag in tags if tag['images'][0]['digest'] == digest
|
||||||
|
)
|
||||||
|
|
||||||
|
if not config.has_section(image.platform):
|
||||||
|
config[image.platform] = {}
|
||||||
|
|
||||||
|
config[image.platform][image.manylinux_version] = f'{image.image_name}:{tag_name}'
|
||||||
|
|
||||||
|
with open('cibuildwheel/resources/pinned_docker_images.cfg', 'w') as f:
|
||||||
|
config.write(f)
|
||||||
@@ -1,12 +1,22 @@
|
|||||||
[manylinux1]
|
[x86_64]
|
||||||
x86_64 = quay.io/pypa/manylinux1_x86_64:2020-01-31-d8fa357
|
manylinux1 = quay.io/pypa/manylinux1_x86_64:2020-03-07-9c5ba95
|
||||||
i686 = quay.io/pypa/manylinux1_i686:2020-01-31-d8fa357
|
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2020-03-07-1825e8f
|
||||||
|
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2020-03-07-06139da
|
||||||
|
|
||||||
[manylinux2010]
|
[i686]
|
||||||
x86_64 = quay.io/pypa/manylinux2010_x86_64:2020-01-31-046f791
|
manylinux1 = quay.io/pypa/manylinux1_i686:2020-03-07-9c5ba95
|
||||||
i686 = quay.io/pypa/manylinux2010_i686:2020-01-31-046f791
|
manylinux2010 = quay.io/pypa/manylinux2010_i686:2020-03-07-1825e8f
|
||||||
|
manylinux2014 = quay.io/pypa/manylinux2014_i686:2020-03-07-06139da
|
||||||
|
|
||||||
[manylinux2014]
|
[pypy_x86_64]
|
||||||
x86_64 = quay.io/pypa/manylinux2014_x86_64:2020-01-31-3350900
|
manylinux2010 = pypywheels/manylinux2010-pypy_x86_64:2020-03-07-1825e8f
|
||||||
i686 = quay.io/pypa/manylinux2014_i686:2020-01-31-3350900
|
|
||||||
|
[aarch64]
|
||||||
|
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2020-03-07-06139da
|
||||||
|
|
||||||
|
[ppc64le]
|
||||||
|
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2020-03-07-06139da
|
||||||
|
|
||||||
|
[s390x]
|
||||||
|
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2020-03-07-06139da
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user