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

Add windows containers to the docker multiarch manifest #1864

Merged
merged 2 commits into from
Jul 31, 2020

Conversation

wcs1only
Copy link
Contributor

@wcs1only wcs1only commented Jul 31, 2020

Description

It turns out, you can build a docker multiplatfrom image across both windows and linux. This means we can deliver a cross platform sidecar injector simply by creating a daprd windows container and letting docker automatically pull the right one based on the os/architecture of the kubernetes node the user app happens to be deployed to.

Prior to this change, we would build each set of binaries separately, then copy them all to one job to do a docker buildx to create the multiplatform images. Since buildx does not support windows, we'll now build docker containers on their respective host types (linux/amd64 linux/arm windows/amd64), tag them with the suffix version-os-arch and push them. Then, another job will come along and do a dapr manifest build version version-linux-amd64 version-windows-amd64 ...

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1746

Manual testing

You'll find some sample images here: https://hub.docker.com/layers/wcs1only/daprd/edge/images/sha256-c253bb3bfaf91416e5556ed418569481ab36cfbc676198ff9a6168c8d14158c4?context=explore

dapr % kubectl set env deployment/dapr-sidecar-injector SIDECAR_IMAGE=docker.io/wcs1only/daprd:edge --namespace=test

dapr % kubectl describe pod `kubectl get pods --namespace=test | awk '/add/ {print $1}'` --namespace=test | grep -A20 Events
Events:
  Type    Reason     Age   From                    Message
  ----    ------     ----  ----                    -------
  Normal  Scheduled  20s   default-scheduler       Successfully assigned test/addapp-57c54d5f47-n675g to akswin2000000
  Normal  Pulling    17s   kubelet, akswin2000000  Pulling image "wcs1only/distributed-calculator-go:edge"
  Normal  Pulled     16s   kubelet, akswin2000000  Successfully pulled image "wcs1only/distributed-calculator-go:edge"
  Normal  Created    16s   kubelet, akswin2000000  Created container add
  Normal  Started    14s   kubelet, akswin2000000  Started container add
  Normal  Pulling    14s   kubelet, akswin2000000  Pulling image "docker.io/wcs1only/daprd:edge"
  Normal  Pulled     13s   kubelet, akswin2000000  Successfully pulled image "docker.io/wcs1only/daprd:edge"
  Normal  Created    13s   kubelet, akswin2000000  Created container daprd
  Normal  Started    11s   kubelet, akswin2000000  Started container daprd
dapr % kubectl logs `kubectl get pods --namespace=test | awk '/addapp/ {print $1}'` add --namespace=test
Adding 5.000000 to 6.000000 on Windows!

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

@wcs1only wcs1only marked this pull request as ready for review July 31, 2020 00:54
@yaron2
Copy link
Member

yaron2 commented Jul 31, 2020

Great stuff.

Makefile Outdated Show resolved Hide resolved
docker/docker.mk Outdated Show resolved Hide resolved
Copy link
Contributor

@youngbupark youngbupark left a comment

Choose a reason for hiding this comment

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

@wcs1only Thanks a lot for this change. this change is pretty big. for validation, you can fork this repo and validate it on your fork.

https://github.com/dapr/dapr/blob/master/docs/development/setup-ci.md

docker/docker.mk Show resolved Hide resolved
docker/docker.mk Show resolved Hide resolved
@wcs1only
Copy link
Contributor Author

wcs1only commented Jul 31, 2020

@wcs1only Thanks a lot for this change. this change is pretty big. for validation, you can fork this repo and validate it on your fork.

https://github.com/dapr/dapr/blob/master/docs/development/setup-ci.md

Yes, I did this and included a link in the description to the produced artifacts.

https://github.com/wcs1only/dapr/runs/930062942?check_suite_focus=true

@youngbupark
Copy link
Contributor

@wcs1only Thanks a lot for this change. this change is pretty big. for validation, you can fork this repo and validate it on your fork.
https://github.com/dapr/dapr/blob/master/docs/development/setup-ci.md

Yes, I did this and included a link in the description to the produced artifacts.

https://github.com/wcs1only/dapr/runs/930062942?check_suite_focus=true

Cool. Thanks for the validation! :)

@wcs1only wcs1only force-pushed the master branch 4 times, most recently from 5e16e53 to 18aeff0 Compare July 31, 2020 18:34
@wcs1only
Copy link
Contributor Author

/ok-to-test

@dapr-bot
Copy link
Collaborator

Found the available test cluster - dapr-aks-e2e-01. Please wait until test is done.

@dapr-bot
Copy link
Collaborator

Congrats! All end-to-end tests have passed. Thanks for your contribution!

@wcs1only
Copy link
Contributor Author

wcs1only commented Jul 31, 2020

I have also updated tests/docs/running-e2e-test.md and run the procedure manually start to finish. Everything is working on linux.

@wcs1only
Copy link
Contributor Author

/ok-to-test

@dapr-bot
Copy link
Collaborator

Found the available test cluster - dapr-aks-e2e-01. Please wait until test is done.

Copy link
Contributor

@youngbupark youngbupark left a comment

Choose a reason for hiding this comment

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

Thanks!

@dapr-bot
Copy link
Collaborator

Congrats! All end-to-end tests have passed. Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create windows docker images for sidecar injector.
5 participants