Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build powerpc (ppc64le) distroless base and static images #622

Merged
merged 2 commits into from
Oct 20, 2020

Conversation

dims
Copy link
Contributor

@dims dims commented Oct 19, 2020

To support k8s use case

Signed-off-by: Davanum Srinivas [email protected]

@google-cla google-cla bot added the cla: yes CLAs look good label Oct 19, 2020
@dims dims changed the title Build powerpc (ppc64le) distroless base and static images [WIP] Build powerpc (ppc64le) distroless base and static images Oct 19, 2020
@dims dims force-pushed the add-support-for-ppc64le branch 3 times, most recently from 5c932be to e4a8037 Compare October 20, 2020 13:40
WORKSPACE Outdated Show resolved Hide resolved
@dims dims force-pushed the add-support-for-ppc64le branch 3 times, most recently from bf75c7f to b90eca3 Compare October 20, 2020 15:36
@dims dims changed the title [WIP] Build powerpc (ppc64le) distroless base and static images Build powerpc (ppc64le) distroless base and static images Oct 20, 2020
@dims
Copy link
Contributor Author

dims commented Oct 20, 2020

@chanseokoh Can you please take a look?

@dims dims force-pushed the add-support-for-ppc64le branch from b90eca3 to 11739c8 Compare October 20, 2020 17:41
@mattmoor
Copy link
Contributor

This still LGTM. Can you please confirm things work with a GCB dry run?

@@ -3,54 +3,66 @@
# TO GENERATE THIS RUN: ./updateWorkspaceSnapshots.sh

BASE_ARCHITECTURES = ["amd64", "arm64"]
ARCHITECTURES = BASE_ARCHITECTURES + ["s390x"]
ARCHITECTURES = BASE_ARCHITECTURES + ["s390x", "ppc64le"]
Copy link
Member

Choose a reason for hiding this comment

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

Why can't this be in BASE_ARCHITECTURES?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chanseokoh i was just following the pattern set by the s390x :) we can revisit this in a subsequent PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that like s390x this is a starting point to get base & static in place?

Copy link
Member

Choose a reason for hiding this comment

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

I believe the only reason that we distinguish BASE_ARCHITECTURES and ARCHITECTURES is to include or exclude libunwind8 because Debian doesn't have the library package on s390x.

So, the consequence of this would be that, Distroless won't be able to build ppc64le dotnet images (dotnet requires libunwind8, as it seems).

Copy link
Member

Choose a reason for hiding this comment

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

Not that this is a major issue. We just need to be clear on why we have both BASE_ARCHITECTURES and ARCHITECTURES for what reason.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but s390x doesn't publish python, node, or other images yet, so practically I think the "base" signifies what we publish //base for, but this may be back-filling the naming a bit 😅

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but I do think ppc64le (basically any arch that doesn't need special handling such as x390x) should be in BASE_ARCHITECTURES. I can tolerate a brief transition state if this is to be fixed in a subsequent PR.

@dims
Copy link
Contributor Author

dims commented Oct 20, 2020

@mattmoor thanks for the tip on running GCB by hand to verify stuff trying it now - gcloud builds submit --substitutions=COMMIT_SHA=fake

@dims
Copy link
Contributor Author

dims commented Oct 20, 2020

[dims@dims-a02 14:21] ~/junk ⟩ crane manifest gcr.io/kubernetes-development-244305/static:nonroot
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 526,
         "digest": "sha256:f602a35415ff9e447e3f2a4634e6cece03c93c3939779453f01b811e8683a0b9",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 526,
         "digest": "sha256:9977744d96d4ab58b6bc888d97d185f96007eca43b4d9dca36ac4db15917787a",
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 526,
         "digest": "sha256:5957cad095455053c34c9e5531f41e0032d5a4d25168a7f3880a2671aeeb2c18",
         "platform": {
            "architecture": "ppc64le",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 526,
         "digest": "sha256:71f90c8d46025d2b6d3d2f67e57dcd0061dd770b9110d9f55dc0d3d38f3007d8",
         "platform": {
            "architecture": "s390x",
            "os": "linux"
         }
      }
   ]

@dims
Copy link
Contributor Author

dims commented Oct 20, 2020

@mattmoor got a clean run on GCB. This is now ready to merge.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

ID                                    CREATE_TIME                DURATION  SOURCE                                                                                                       IMAGES  STATUS
ea8996d8-5a71-44d2-aded-8dbba248d830  2020-10-20T17:40:59+00:00  35M38S    gs://kubernetes-development-244305_cloudbuild/source/1603215658.303978-e8732b4d6ade479b8df52633df4dcc0f.tgz  -       SUCCESS

@chanseokoh
Copy link
Member

Thanks for checking. Merging it now.

@bahetiamit
Copy link

I was trying the base image on power ppc64le arch machine and it fails with exec error as show below

[ ~]# uname -m
ppc64le
[ ~]# docker run --rm gcr.io/distroless/base@sha256:92720b2305d7315b5426aec19f8651e9e04222991f877cae71f40b3141d2f07e
standard_init_linux.go:190: exec user process caused "exec format error"

The busybox binary that is getting used is from https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-powerpc64 which is for big endian power arch and not little endian - https://bugs.busybox.net/show_bug.cgi?id=13491

Further, it seems that debian repo has the required power little endian arch binary & that seems to be working fine - https://travis-ci.com/github/Siddhesh-Ghadi/busybox-binary/builds/219571877#L175.

So for this image to work properly on ppc64le the binary should be installed from debian repos.

@chanseokoh
Copy link
Member

@bahetiamit I have no experience with powerpc, so bear with me. Why should distroless target big-endian arch and not little-endian? Is little-endian defunct, and no one is using the CPU?

@bahetiamit
Copy link

@chanseokoh It is actually other way around. This PR is for ppc64le (le stands for little endian) as per the PR title. But this PR added big endian busybox binary which obviously fails to run on ppc64le arch machines.

I understand that binary is getting downloaded from busybox.net & unfortunately they just release big endian binary. That is why I think the image should take the binary from debian repos (as they have LE arch binary for busybox)

@bahetiamit
Copy link

@chanseokoh Will it make more sense to file an issue for better tracking of this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLAs look good
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants