Skip to content

Build tiller image for various architectures - #4200

Closed
alicefr wants to merge 2 commits into
helm:masterfrom
alicefr:pr_multi-arch
Closed

alicefr wants to merge 2 commits into
helm:masterfrom
alicefr:pr_multi-arch

Conversation

@alicefr

@alicefr alicefr commented Jun 8, 2018 •

Copy link
Copy Markdown

Helm already supports cross-compiling and the parent image alpine:3.7 is multi-arch. Therefore, building the tiller image for other architectures rather than x86_64 is straightforward. The docker images can be builti by using make docker-build-images

I also generalized the building process of a single docker image. The default target architecture remains amd64. However, another architecture could be set as the target. For example

$ make GO_ARCH=s390x docker-build

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 8, 2018

@stefsuse stefsuse left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I saw this in helm-dev and just wanted to chime in though I am not a maintainer. Overall LGTM, thanks for doing this.

Comment thread Makefile Outdated
@@ -3,6 +3,7 @@ IMAGE_PREFIX ?= kubernetes-helm
SHORT_NAME ?= tiller
SHORT_NAME_RUDDER ?= rudder
TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm thinking it probably makes sense to merge your other PR with this change #4190

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I guess this modification is a little bit more complex. In #4190 I simply added an architecture

@bacongobbler bacongobbler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will allow users to build cross-arch tiller images from source (which is great!), but would it be possible to hook this up to CI so we can publish these images to gcr.io?

Perhaps we should hold off on this until we've completed the transfer over to the CNCF as they may want us to migrate our assets somewhere else. Any other maintainers have opinions on this?

@bacongobbler

Copy link
Copy Markdown
Member

@stefsuse

stefsuse commented Jun 8, 2018

Copy link
Copy Markdown

Sure. Update deploy.sh to accept an arg for arch. Then update .circleci.yaml to pass the $arch string at the deploy step (not sure how you do that with circle specifically though). On its own this change won't change the current process but it at least allows for the option. If CNCF decides to host the builds elsewhere they just update deploy.sh? Just my two cents.

@alicefr

alicefr commented Jun 11, 2018 •

Copy link
Copy Markdown
Author

@bacongobbler I didn't think to add into circleci. But that also depends how now you want to call your images. With kubernetes style you could append the architecture at the end of the image name or another possibility could be to create a multi-arch image. The advantage of the second approach would be that you do not have to change the name of the tiller image. Would you pack everything in a PR or better a second one?

I'm traveling this week and then I will take some vacation. Therefore, the discussion will be a bit slowed down.

@bacongobbler

bacongobbler commented Jun 11, 2018 •

Copy link
Copy Markdown
Member

After doing a little research, there appears to be some new (experimental) work available where we can distribute arch-specific images (talks at DockerCon 2017) and then create a manifest list that points to these individual images. That way, docker run gcr.io/kubernetes-helm/tiller will pull the right architecture required for the OS running the image. That looks like a good approach in the long run to me! :)

The first part would be the easiest to tackle: we start by releasing arch-specific images of tiller like gcr.io/kubernetes-helm/tiller-arm. The second part would be tricky, as we would basically need to replace gcr.io/kubernetes-helm/tiller with a manifest list, and that might break stuff if it's still an experimental Docker feature.

I think taking the approach where we distribute images with the architecture being appended to the end of the image name would be a good first step, and then once the latter features become more stable we can start adding support for that. How do you feel about that approach?

@alicefr

alicefr commented Jun 12, 2018

Copy link
Copy Markdown
Author

yes it sounds reasonable. I haven't tried the docker manifest command yet. I know that the Docker developers used the manifest-tool to create the multi-arch image. But I understand that you want to wait for the manifest command.

Do you want that I include the modifications at helm/.circleci/deploy.sh in this PR?

@alicefr

alicefr commented Jun 15, 2018 •

Copy link
Copy Markdown
Author

hi, I just realized that the PR is actually wrong, sorry. It actually cross-compiles the binaries for the different images, but the parent image remains x86. The first commit will allow to build the image on other architectures but the second doesn't work. I guess we can close it.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants