Commit Graph

12 Commits

Author SHA1 Message Date
Tony Fang
8d5c045435 Use uname machine field to get CPU variant if fails at /proc/cpuinfo
When images/containers in ARM arch were built/executed on x86 host,
getCPUVariant will fail as it tries to look for /proc/cpuinfo, whose
content is from the host. Adding a new method as fallback to check uname
machine when it happens.

Signed-off-by: Tony Fang <nenghui.fang@gmail.com>
2022-12-20 21:59:32 +00:00
Phil Estes
a43703fcba
Merge pull request #6455 from tonistiigi/amd64-variants
platforms: add support for matching amd64 variants
2022-01-27 10:07:49 -05:00
Tonis Tiigi
af83e9af10 platforms: add support for matching amd64 variants
Correctly matches optional variants for amd64
arch. These should be used for standardized values
v1-v4 from https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels.

V1 remains the default and is cleared by default.
Pulling a higher variant will match the highest
available platform lower or equal to the provided one
when platformVector is used.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-18 20:13:37 -08:00
Sebastiaan van Stijn
2405671d40
platforms: add "ios" as known OS, "loong64" as known ARCH
- GOOS iOS was added in https://go-review.googlesource.com/c/go/+/254740, and part of go1.16beta1
- GOARCH loong64 was added in https://go-review.googlesource.com/c/go/+/333909, and currently only in master

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-23 10:56:08 +02:00
Derek McGowan
672b86acf8
Merge pull request #3624 from tklauser/platforms-update
platforms: update known OS and arch values
2019-09-05 16:53:37 -07:00
Tobias Klauser
c8cb864ce0 platforms: update known OS and arch values
Update the lists in isKnownOS and isKnownOS according to goosList and
goarchList taken from Go 1.13, see
https://github.com/golang/go/blob/release-branch.go1.13/src/go/build/syslist.go

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-09-05 14:15:43 +02:00
chentanjun
8788af7f8d modify-document-duplicate-word
Signed-off-by: chentanjun <2799194073@qq.com>
2019-09-05 09:10:19 +08:00
Derek McGowan
db3c5afc6d
Normalize arm64 to an empty variant
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-23 16:35:46 -07:00
Derek McGowan
37ab93e2c8
Fix arm platform matching
The normalization was being inconsistently applied causing a
failure to match some platforms in manifest lists.
Fix the matcher and normalization to be more consistent and
add changes to parser to prevent the defaulted variants from being
set in the platform structure.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-21 17:07:58 -07:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Wei Chen
4355ba2f83 ctr: Add helpers to database to check Linux and ARM arch
On ARM platforms, we have to prepare the variant for spec.platform.
Currently, this action would only work on Linux/ARM system. We
introduce these two helpers to check running system's OS and Arch.

Change-Id: Iff14087699219413779dd6caf1bf9524db1cc19e
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
2017-12-20 14:49:45 +08:00
Stephen J Day
fb0688362c
platforms: define selectors for platforms
For supporting selection of images and runtimes in the containerized
world, there is thin support for selecting objects by platform. This
package defines a syntax to display to users that can express specific
platforms in addition to wild cards for matching platforms.

The plan is to extend this to provide support for parsing flag
arguments and displaying platform types for images. This package will
also provide a configurable matcher to allow match of platforms against
arbitrary targets, invariant to the Go compilation.

The internals are based the OCI Image Spec model.

This changeset is being submitted for feedback on the approach before
this gets larger. Specifically, review the unit tests and raise any
concerns.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-08 15:05:21 -07:00