Build ppc64le docker images (#26442)
* Update archspec * Add ppc64le to docker images
This commit is contained in:
parent
e91815de7c
commit
69abc4d860
8
.github/workflows/build-containers.yml
vendored
8
.github/workflows/build-containers.yml
vendored
@ -26,10 +26,10 @@ jobs:
|
|||||||
# they support.
|
# they support.
|
||||||
matrix:
|
matrix:
|
||||||
dockerfile: [[amazon-linux, amazonlinux-2.dockerfile, 'linux/amd64,linux/arm64'],
|
dockerfile: [[amazon-linux, amazonlinux-2.dockerfile, 'linux/amd64,linux/arm64'],
|
||||||
[centos7, centos-7.dockerfile, 'linux/amd64,linux/arm64'],
|
[centos7, centos-7.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le'],
|
||||||
[leap15, leap-15.dockerfile, 'linux/amd64,linux/arm64'],
|
[leap15, leap-15.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le'],
|
||||||
[ubuntu-xenial, ubuntu-1604.dockerfile, 'linux/amd64,linux/arm64'],
|
[ubuntu-xenial, ubuntu-1604.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le'],
|
||||||
[ubuntu-bionic, ubuntu-1804.dockerfile, 'linux/amd64,linux/arm64']]
|
[ubuntu-bionic, ubuntu-1804.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le']]
|
||||||
name: Build ${{ matrix.dockerfile[0] }}
|
name: Build ${{ matrix.dockerfile[0] }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
2
lib/spack/external/__init__.py
vendored
2
lib/spack/external/__init__.py
vendored
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/archspec
|
* Homepage: https://pypi.python.org/pypi/archspec
|
||||||
* Usage: Labeling, comparison and detection of microarchitectures
|
* Usage: Labeling, comparison and detection of microarchitectures
|
||||||
* Version: 0.1.2 (commit 4dbf253daf37e4a008e4beb6489f347b4a35aed4)
|
* Version: 0.1.2 (commit 8940a8b099a54ded21f8cf4314c4b83b558bb6d1)
|
||||||
|
|
||||||
argparse
|
argparse
|
||||||
--------
|
--------
|
||||||
|
29
lib/spack/external/archspec/cpu/detect.py
vendored
29
lib/spack/external/archspec/cpu/detect.py
vendored
@ -206,11 +206,26 @@ def host():
|
|||||||
# Get a list of possible candidates for this micro-architecture
|
# Get a list of possible candidates for this micro-architecture
|
||||||
candidates = compatible_microarchitectures(info)
|
candidates = compatible_microarchitectures(info)
|
||||||
|
|
||||||
|
# Sorting criteria for candidates
|
||||||
|
def sorting_fn(item):
|
||||||
|
return len(item.ancestors), len(item.features)
|
||||||
|
|
||||||
|
# Get the best generic micro-architecture
|
||||||
|
generic_candidates = [c for c in candidates if c.vendor == "generic"]
|
||||||
|
best_generic = max(generic_candidates, key=sorting_fn)
|
||||||
|
|
||||||
|
# Filter the candidates to be descendant of the best generic candidate.
|
||||||
|
# This is to avoid that the lack of a niche feature that can be disabled
|
||||||
|
# from e.g. BIOS prevents detection of a reasonably performant architecture
|
||||||
|
candidates = [c for c in candidates if c > best_generic]
|
||||||
|
|
||||||
|
# If we don't have candidates, return the best generic micro-architecture
|
||||||
|
if not candidates:
|
||||||
|
return best_generic
|
||||||
|
|
||||||
# Reverse sort of the depth for the inheritance tree among only targets we
|
# Reverse sort of the depth for the inheritance tree among only targets we
|
||||||
# can use. This gets the newest target we satisfy.
|
# can use. This gets the newest target we satisfy.
|
||||||
return sorted(
|
return max(candidates, key=sorting_fn)
|
||||||
candidates, key=lambda t: (len(t.ancestors), len(t.features)), reverse=True
|
|
||||||
)[0]
|
|
||||||
|
|
||||||
|
|
||||||
def compatibility_check(architecture_family):
|
def compatibility_check(architecture_family):
|
||||||
@ -245,7 +260,13 @@ def compatibility_check_for_power(info, target):
|
|||||||
"""Compatibility check for PPC64 and PPC64LE architectures."""
|
"""Compatibility check for PPC64 and PPC64LE architectures."""
|
||||||
basename = platform.machine()
|
basename = platform.machine()
|
||||||
generation_match = re.search(r"POWER(\d+)", info.get("cpu", ""))
|
generation_match = re.search(r"POWER(\d+)", info.get("cpu", ""))
|
||||||
generation = int(generation_match.group(1))
|
try:
|
||||||
|
generation = int(generation_match.group(1))
|
||||||
|
except AttributeError:
|
||||||
|
# There might be no match under emulated environments. For instance
|
||||||
|
# emulating a ppc64le with QEMU and Docker still reports the host
|
||||||
|
# /proc/cpuinfo and not a Power
|
||||||
|
generation = 0
|
||||||
|
|
||||||
# We can use a target if it descends from our machine type and our
|
# We can use a target if it descends from our machine type and our
|
||||||
# generation (9 for POWER9, etc) is at least its generation.
|
# generation (9 for POWER9, etc) is at least its generation.
|
||||||
|
@ -173,6 +173,12 @@ def family(self):
|
|||||||
|
|
||||||
return roots.pop()
|
return roots.pop()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def generic(self):
|
||||||
|
"""Returns the best generic architecture that is compatible with self"""
|
||||||
|
generics = [x for x in [self] + self.ancestors if x.vendor == "generic"]
|
||||||
|
return max(generics, key=lambda x: len(x.ancestors))
|
||||||
|
|
||||||
def to_dict(self, return_list_of_items=False):
|
def to_dict(self, return_list_of_items=False):
|
||||||
"""Returns a dictionary representation of this object.
|
"""Returns a dictionary representation of this object.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user