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

TEP-0019: Add other architecture support #211

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

barthy1
Copy link
Member

@barthy1 barthy1 commented Sep 18, 2020

This TEP proposes the way to add other hardware architectures support in Tekton.
It doesn't cover any specific architecture and can be used as reference for arch specific TEPs.

This TEP proposes main concept how Tekton tests and builds can be done for non-amd64 architecture
and provides samples of the Tekton tasks to run the build and e2e tests for Tekton pipeline.
It suggests to use native hardware for arch specific tasks and amd64 Tekton cluster (similar to dogfooding or itself)
to play master role and manage all the steps.

@tekton-robot tekton-robot requested review from khrm and wlynch September 18, 2020 09:19
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 18, 2020
@vdemeester vdemeester self-requested a review September 18, 2020 09:36
@barthy1 barthy1 force-pushed the other-arch-support branch 2 times, most recently from f1e0181 to 8474bb2 Compare September 21, 2020 10:46
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 24, 2020
@vdemeester vdemeester added the kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). label Sep 28, 2020
Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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


#### Example 1: Build architecture specific release for Tekton pipeline

Task is started from amd64 Tekton cluster and runs Tekton pipeline build on
Copy link
Member

Choose a reason for hiding this comment

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

With recently added support for building multi-arch images in ko, and multi-arch support for distroless (which we use as a base for most of our images), we can soon start to build multi-arch images using ko resolve --platform=all, from the normal dogfooding cluster we use today.

There will need to be some work to make the git-init steps, and some others, multi-arch-capable, but until then at least Pipelines that don't use the git resource should be supported just fine.

With those aside, once we get Tekton's release onto --platform=all, supporting new arch boils down to adding support for that arch to gcr.io/distroless/static, which is just a few static files in a container.

Copy link
Member

Choose a reason for hiding this comment

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

One thing on --platform=all, what if we don't want to support all platform ? (aka, I think it does get the list of platform from the base image used)

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you don't want support for all possible platforms?

If so, we _could) consider modifying ko based on our needs to allow us to specify more complex --platform flag values. Today, it supports --platform=amd64 (or any single arch), or --platform=all (build for all platforms supported by the base image). If we wanted --platform=amd64,arm64,s390x or --platform=all,-amd64 we could certainly discuss that use case with the ko maintainers. But I'd like to make that request with a well-formed reason for why we don't want to build for all available platforms.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, all was added as a starting point. There are a few more "fun" models that @jonjohnsonjr and I were discussing, but decided this was a nice and simple starting point. Flags is obviously one of the easiest ways to go.

I really wanted to do something smart around intersecting the base images of the collection of import referenced being resolved, but @jonjohnsonjr pointed out that users might want more heterogeneity than this allows (e.g. if I'm targeting a mixed cluster and my node selectors express things my base images do not).

At the end of the day, you have control of the base images you use, so --platform=all is a pretty powerful (albeit complex) escape hatch for folks to use here.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you don't want support for all possible platforms?

Yes, man power 🙃, hardware availability, platform knowledge. We will need to support those, fix bugs, reproduce problems, … this is.. some work 🙃. Currently, gcr.io/distroless/… supports amd64 and arm64 right ? so we would support only those (which is fine). What if I want to support more ? Using another base (ubuntu) that supports more is fine, but then, maybe ubuntu also support arm or something I don't have the power to support as of today (hardware availability to test things, etc…).

As long as it supports single arch (--platform=amd64), I am fine, we can setup our release pipeline to loop over the arch we want to support. --platform=amd64,arm64,s390x would be nice to have, but is not something required.

At the end of the day, you have control of the base images you use, so --platform=all is a pretty powerful (albeit complex) escape hatch for folks to use here.

Yes and no 🙃 We can choose the base image, and in that sense, we are in control of the base image. If we choose to use distroless, then, we don't control the supported arch anymore (at least not with all 🙃). --platform=myarch is good enough for me anyway.

My only worry is, what happens if I use --platform=s390x and the base image doesn't support it ? 😝 We may need to maintain our own set of base image (maybe in plumbing) if at some point we want to support arch that are not available in the current base images used 😝

Copy link
Member

Choose a reason for hiding this comment

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

btw, I am just thinking outloud, I am really happy ko supports multi-platform, and the default behavior of --platform=all seems good to me too 😛 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

I was insanely happy when leant that multi-arch support PR was merged to ko. And I agree that it makes things much easier.
At the same time I agree with @vdemeester that --platform=all can be too powerful as tests still should be running on native hardware and "support for all possible platforms" for me means that native hardware should be available for these platforms, which is not true at this moment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Technical details :) I verified that ko resolve --platform=all, using alpine base image in .ko.yaml, builds installable/runnable versions of pipeline, triggers, operator, dashboard for amd64 and s390x (with multi-arch images)

Copy link
Member

Choose a reason for hiding this comment

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

I understand the concern about the support burden of having Tekton's images available in a plethora of architectures. If it helps, we can document that Tekton only officially supports amd64 and s390x, for example, even though other architectures might be available.

Having this distinction could be helpful, since it means users who might be interested in testing and eventually committing to support arm64 could play with those out of the box (or, for some othernew-arch, assuming distroless supports new-arch), without having to build their own images.

Copy link
Member

Choose a reason for hiding this comment

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

cc @duglin @afrittoli

IBM had raised a desire to have support for Power and Z in the context of Knative, and a willingness (I think) by IBM to contribute resources for CI. I thought Tekton might be in a similar boat.

For arm64, I'm going to try to use an EKS Graviton cluster for as much of my development as it will allow.


Totally ack the concerns, though. To Jason's point, perhaps it would be enough to distinguish between "supported" and "best effort"? You could even produce distinct bundles with ko resolve --platform={supported} and ko resolve --platform=all.

Feedback on how to control this is certainly welcome and desired 🙏

teps/0019-other-arch-support.md Outdated Show resolved Hide resolved
teps/0019-other-arch-support.md Show resolved Hide resolved
@barthy1 barthy1 force-pushed the other-arch-support branch 2 times, most recently from 5498801 to 04570b9 Compare September 30, 2020 14:41
This TEP proposes the way to add other hardware architectures support in Tekton.

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
@barthy1
Copy link
Member Author

barthy1 commented Sep 30, 2020

@vdemeester @imjasonh @mattmoor thank you for the feedback for the first version of this TEP. Following your input I updated it, specifically adding ko usage for the builds

@dlorenc
Copy link
Contributor

dlorenc commented Oct 5, 2020

This looks ready to merge in the proposed state.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2020
@tekton-robot tekton-robot merged commit a30c3c7 into tektoncd:master Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants