Skip to content

Conversation

@Pennyzct
Copy link

@Pennyzct Pennyzct commented Jan 26, 2018

When pulling multi-arch image from official repo, mismatch variant may be pulled,
due to for now only arch and os will be verified. Relevant issue has
already been raised in github (#34875).
Not long ago, I worked with wei @Weichen81 on multi-arch image support in containerd, and the relevant code has already be merged🙂(containerd/containerd#1575). I reused logic and code from that and modified some based on docker infrastructure.
@arm64b

@yongtang
Copy link
Member

@Pennyzct Can you address the format issues:

16:42:12 distribution/cpuinfo.go:13:1:warning: comment on exported var GOARM should be of the form "GOARM ..." (golint)
16:42:12 distribution/cpuinfo.go:1::warning: file is not gofmted with -s (gofmt)
16:42:12 distribution/cpuinfo.go:1::warning: file is not goimported (goimports)
16:42:12 Build step 'Execute shell' marked build as failure

@arm64b
Copy link
Contributor

arm64b commented Jan 29, 2018

I think we can adapt this to the #35929 (the script) to address @tianon 's concern about armhf images...

@Pennyzct
Copy link
Author

07:41:31 FAIL: docker_cli_logs_test.go:145: DockerSuite.TestLogsSince
07:41:31
07:41:31 docker_cli_logs_test.go:152:
07:41:31 c.Assert(err, checker.IsNil)
07:41:31 ... value *time.ParseError = &time.ParseError{Layout:"2006-01-02T15:04:05.999999999Z07:00", Value:"", LayoutElem:"2006", ValueElem:"", Message:""} ("parsing time "" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "" as "2006"")
Is this a flaky error? It looks to me that my code won't corrupt this field.😊
@yongtang @thaJeztah

@coolljt0725
Copy link
Contributor

ping @estesp @stevvooe

@estesp
Copy link
Contributor

estesp commented Feb 12, 2018

This is definitely an improvement for the ARM variants matching, but it still leaves the case where the hardware could run an image, but an exact variant match doesn't exist (e.g. hardware = v8, image = v7 (and there is no v8 variant in the registry for the image). I guess we could potentially see this as a stepwise improvement, and add the "order of compatibility" list as a follow-on?

@tianon
Copy link
Member

tianon commented Feb 13, 2018

IMO that depends on the failure mode -- today, a user of 32bit ARM on a v8 machine will be (successfully) running the first image listed, which will likely be v5 or v6 (or even v7). If this PR turns their current successful usage into a failure mode, then I think we need to revisit the "order of compatibility" more urgently.

@thaJeztah
Copy link
Member

ping @stevvooe @dmcgowan - wondering what the best way forward is on this one; could you have a look?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses an exact match on variant with no fallback, so the failure mode here will be that images which run successfully today (although likely in a less-than-ideal way) will start failing to run with "manifest not found" errors.

@Pennyzct
Copy link
Author

Pennyzct commented Feb 26, 2018

Sorry for the delay, we were in CNY holidays🙂. We think that it is reasonable and feasible to add failure mode to complement variant matching. So, does all we reach a consensus that failure mode should be included? if so, we will do the coding asap😀. @tianon @thaJeztah @estesp @stevvooe @dmcgowan @Weichen81 @arm64b

@Pennyzct Pennyzct force-pushed the multi-arch branch 3 times, most recently from dfebb72 to 190bccb Compare March 26, 2018 01:38
@codecov
Copy link

codecov bot commented Mar 26, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@e890301). Click here to learn what that means.
The diff coverage is 2%.

@@            Coverage Diff            @@
##             master   #36121   +/-   ##
=========================================
  Coverage          ?   35.26%           
=========================================
  Files             ?      615           
  Lines             ?    45832           
  Branches          ?        0           
=========================================
  Hits              ?    16164           
  Misses            ?    27524           
  Partials          ?     2144

@Pennyzct
Copy link
Author

Hi~ all😁. After internal discussion, the failure mode of variant matching should include two vectors(aka. order of compatibility). one for arm32, and the other for arm64. fallback scheme would simply be backward compatibility, which would be v7 -> v6 ->v5 in arm32 and only v8 in arm64 for now. @arm64b @Weichen81 @estesp @tianon @thaJeztah

@tianon
Copy link
Member

tianon commented Apr 26, 2018

@Pennyzct fallback on a v7 node to v6 and then v5 (and on a v6 node to just v5, and on v5 just erroring out if not available) sounds like exactly what we need IMO

Copy link
Contributor

@arm64b arm64b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pennyzct
Copy link
Author

Pennyzct commented May 2, 2018

Hi~ all. Any comments about the original code structure? Then I will rebase the code asap.😁 @tianon @thaJeztah @estesp @stevvooe

@arm64b
Copy link
Contributor

arm64b commented May 2, 2018

@Pennyzct , @tianon and I are both OK for your code, so please rebase and push it again.

@Pennyzct Pennyzct force-pushed the multi-arch branch 3 times, most recently from d9c56cc to d8cb58f Compare May 4, 2018 02:42
When pulling multi-arch image from official repo, mismatched arch variant may
be pulled,because only arch and os will be verified currently. Failure mode
strategy requires that compatibile image can be pulled by following the order
of compatibility. Relevant issue has already been raised by issue moby#34875.

Signed-off-by: Penny Zheng <[email protected]>
@AmedeeBulle
Copy link

FWIW this fix does not address the Raspberry Pi case as the "Zero" has an ARMv6 chip but reports a CPU arch of 7!

$ arch
armv6l
$ cat /proc/cpuinfo | grep 'CPU architecture'
CPU architecture: 7

@Weichen81
Copy link

Hi @AmedeeBulle ,
Raspberry Pi Zero is using a BCM2835 SoC and its CPU is ARM1176JZF-S. The ARM1176JZF-S is armv6 but has some extensions to armv6. In its Memory Model Feature Register 0, it indicates support for VMSA v7 remapping and access flag. For this reason, in Linux, the arm32 code treat this CPU is CPU_ARCH_ARMv7
unsigned int mmfr0 = read_cpuid_ext(CPUID_EXT_MMFR0);
if ((mmfr0 & 0x0000000f) >= 0x00000003 ||
(mmfr0 & 0x000000f0) >= 0x00000030)
cpu_arch = CPU_ARCH_ARMv7;

But this doesn't mean this CPU is compatible with armv7 instruction set. In this case, most armv7 distributions will stuck on Raspberry Pi Zero.

@AmedeeBulle
Copy link

@Weichen81, that's exactly my point: I want to be able to differentiate V6 (Raspberry Pi Zero) vs. V7 (Raspberry Pi 3B), and if we use /proc/cpuinfo as this patch suggests it would take V7 for a Raspberry Pi Zero which won't work as you point out...

@Weichen81
Copy link

@AmedeeBulle
Hmm, yes, that's a problem. I think maybe a further check for "CPU architecture: 7" is needed. If we got a "CPU architecture: 7" we should check the "arch" to detect this CPU is an armv7 compatible processor or just an armv7 with VMSAv7 extension. How do you think about it?

@AmedeeBulle
Copy link

Yes indeed.
Unfortunately I don't think there is a simple test when it comes to "arch", different kernels have different names...

@cpuguy83
Copy link
Member

What's the status here?

@olljanat
Copy link
Contributor

@Pennyzct this one needs to be rebased

@derek derek bot added the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 22, 2018
@Pennyzct
Copy link
Author

Hi~For now, the distribution/pull_v2_unix.go has already imported varient-matching from containerd/containerd, but deprecated it for arm platform due to backwards compatibility with older versions.
I see that containerd/containerd community has also already done the work about failure mode of variant matching in arm platform. maybe we should also import it here? Wdyt? @cpuguy83 @olljanat

@olljanat
Copy link
Contributor

@Pennyzct #38509 updated containerd v1.2.2 to here so those changes what they have done are now included.

@tonistiigi
Copy link
Member

@Pennyzct The code in question has changed and now uses the containerd matchers. Can you check if there are still issues for you and update the PR if necessary.

@thaJeztah
Copy link
Member

ping @Pennyzct do you have time to work on #36121 (comment) ?

also /cc @pricec @michael2012z @adamparco

@nunofgs
Copy link

nunofgs commented Jul 25, 2019

Hitting on this issue as well. I have an image with both linux/arm/v6 and linux/arm/v7 in its manifest, but my raspberry pi zero w keeps choosing the v7 image incorrectly 😭

@dt-rush
Copy link

dt-rush commented Sep 3, 2019

@AmedeeBulle
Hmm, yes, that's a problem. I think maybe a further check for "CPU architecture: 7" is needed. If we got a "CPU architecture: 7" we should check the "arch" to detect this CPU is an armv7 compatible processor or just an armv7 with VMSAv7 extension. How do you think about it?

You clearly mean to say, here: "or just an armv6 with VMSAv7".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/failing-ci Indicates that the PR in its current state fails the test suite status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.