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

ARM Support #779

Closed
4 tasks done
krvarma opened this issue Apr 24, 2020 · 51 comments
Closed
4 tasks done

ARM Support #779

krvarma opened this issue Apr 24, 2020 · 51 comments
Assignees
Labels
arm feature All issues for new features that have been committed to

Comments

@krvarma
Copy link

krvarma commented Apr 24, 2020

I am trying to install KEDA on K3S running on RPi 4, it seems the latest version does not support ARM. The kedacore/keda:arm seems to be dead and is not available from Docker Hub. I also tried to compile it manually but I ran into many issues compiling Operator-SDK.

ARM support is necessary nowadays since most of the Edge devices are ARM-based. It would be great if the ARM image can be made available on Docker Hub.

Open items

@krvarma krvarma added the support All issues related to questions and supporting customers label Apr 24, 2020
@tomkerkhove
Copy link
Member

@zroubalik Are you aware if Operator SDK supports ARM? Just checking to know if this is because of issues on our side or an unsupported scenario.

@tomkerkhove tomkerkhove added feature-request All issues for new features that have not been committed to and removed support All issues related to questions and supporting customers labels Apr 27, 2020
@tomkerkhove
Copy link
Member

@krvarma That's certainly a valid ask, I'm not sure why support has been removed or if it was on purpose.

Do you know @ahmelsayed @jeffhollan ?

@krvarma
Copy link
Author

krvarma commented Apr 27, 2020

@tomkerkhove Finally I managed to run on Raspberry Pi after several failed attempts. Here is what I have done to make it work on RPi. I am not sure this is the way we have to do but I got it working this way. I compiled the KEDA on macOS instead of directly on Raspberry Pi since compiling Operator-SDK on RPi generates lots of errors. After compiling I copied the build folder to RPi.

Here are the steps

  1. Set env ARCH=arm
  2. make build
  3. Copy the build folder to the Raspberry Pi
  4. The Dockerfile in the build folder uses registry.access.redhat.com/ubi8/ubi-minimal as the base image. But this image is not available for ARM. So I modified the Dokerfile and changed to alpine:latest as the base image.
  5. I build this image on Raspberry Pi and published to docker.io/krvarma/keda:latestarm (krvarma is my username on Docker Hub)
  6. Set env VERSION=latestarm
  7. Then I installed on my Raspberry Pi Cluster (created using K3S) using helm. (helm install . --set image.keda=krvarma/keda:$VERSION,image.metricsAdapter=krvarma/keda-metrics-adapter:$VERSION,image.pullPolicy=IfNotPresent)

My aim is to install KEDA on a hybrid cluster (AMD64 and ARM), I am trying to create docker manifest and publish to docker so that it will be downloaded based on platforms.

Let me know your thoughts

@zroubalik
Copy link
Member

@krvarma that's great. Yeah cross-compilation is definitely recommended way. Have you tried tools like docker buildx or similar to build the arm image on your machine locally? Once it is functional, we can include it to our CI system a produce arm images during a release.

@krvarma
Copy link
Author

krvarma commented May 6, 2020

@zroubalik Thanks!, I didn't try docker buildx, I will try and get back to you.

@mohsinonxrm
Copy link

@krvarma , can you give an update how is KEDA working on your Raspberry Pi cluster? I also have k3s and am planning to deploy your KEDA docker image on it.

@krvarma
Copy link
Author

krvarma commented Jun 11, 2020

@mohsinonxrm As I mentioned in the previous comment, I compiled the KEDA source on Mac and built the image for ARM and pushed it to my Docker Hub.

My RPi cluster has 1 Master (RPi 4 4GB) and 2 nodes (RPi3 B+). The KEDA is working nicely on my cluster for about 2 months continuously without any issue. It is scaling an Azure Function that gets triggered by a RabbitMQ trigger.

I didn't face any issue with the setup.

@krvarma
Copy link
Author

krvarma commented Jun 11, 2020

@tomkerkhove @zroubalik The image registry.access.redhat.com/ubi8/ubi-minimal:latest does not support ARM architecture. The KEDA seems to be working correctly on alpine. Is there any particular reason for using the registry.access.redhat.com/ubi8/ubi-minimal:latest?.

By using alpine you can support all the architectures.

@mohsinonxrm
Copy link

mohsinonxrm commented Jun 11, 2020

@krvarma , I'm assuming you've used helm v2 instead of v3? how did you get tiller to deploy to the cluster?

Nevermind, found ARM image for tiller.

For others who might run into the same problem, you don't necessarily need helm to deploy KEDA. You can just use the yaml files to deploy using kubectl.

However, on Raspberry Pi, you'll need krvarma/keda:localarm and krvarma/keda-metrics-adapter:localarm images

@krvarma
Copy link
Author

krvarma commented Jun 12, 2020

@mohsinonxrm I am using Helm 3, not Helm 2.

Great you got it working on your Cluster 👍

@mohsinonxrm
Copy link

@krvarma , yes it is working great. Thanks for compiling the ARM version.

Now I'm going to deploy the durable scalar and test it.

@natdan
Copy link

natdan commented Jan 17, 2021

+1 for Arm and even more for Arm64 support!
I've found harakka/keda docker images on docker hub that are supporting keda and keda-metrics-apiserver images which deploy without issues on Arm64, but then struggled with Python3 support (azure-functions/python:3.0-python3.7 image) for Arm64. There is one and when I try to build it myself it fails at some point...

So, again can we have Arm64 support, please? Even microk8s support keda as 'extensions' but not on Arm64 :(

@zroubalik
Copy link
Member

@natdan for azure-functions ARM support you should raise an issue in the particular azure fn repository, there's nothing we can do from KEDA here.

@natdan
Copy link

natdan commented Jan 18, 2021

@zroubalik I know exactly what you're saying for azure-functions but there are two other ways to think about it:

  • one can deploy non azure-function with KEDA anyway and benefit of scaling, etc...
  • one can use different (if not homebrew/manually compiled) image for azure-functions and benefit from KEDA

There's already image in docker hub under harakka/keda (https://hub.docker.com/r/kedacore/keda) - it would be really nice if KEDA becomes Arm64 ready ahead of big changes in well known cloud computing world :)

@zroubalik
Copy link
Member

zroubalik commented Jan 18, 2021

@natdan absolutely agree on ARM support for KEDA, I was referring to your problems with azure-functions/python:3.0-python3.7 image :)

Are you willing to contribute the ARM build? My only concern is the actual testing of ARM images, we will need ARM based runner for GH Actions.

@natdan
Copy link

natdan commented Jan 18, 2021

@zroubalik fair enough. I can't promise (that I can find another lazy Sunday like yesterday very soon) - but I'm happy to give it a go. As for Arm node - I've got couple of Raspberry Pi 4's with 64 OS on it to try it on. If someone else is to do it - we can try to make an arrangement of a sort, too.

@zroubalik
Copy link
Member

We will need a pernament env, that we can use to run the tests periodically. Maybe CNCF could help with this? @tomkerkhove

@tomkerkhove
Copy link
Member

Digging into this as part of kedacore/governance#12 to provide a self-hosted runner.

@basilfx
Copy link

basilfx commented Feb 2, 2021

In the mean time: I've been using Docker Buildx to cross-compile ARM64 images on a x64 machine using Qemu and binfmt_misc (instructions). For the ones interested, I've applied the following changes to the source, then just ran IMAGE_REPO=https://some-arm64-k3s-cluster make publish and ended up with ARM64 images in my registry. Much faster and easier than compiling on a Raspberry Pi itself.

@tomkerkhove
Copy link
Member

Just as an update - We are getting an ARM machine to run everything on. Stay tuned.

@mohsinonxrm
Copy link

built the arm64 images here:
https://hub.docker.com/repository/docker/mohsinonxrm/keda
https://hub.docker.com/repository/docker/mohsinonxrm/keda-metrics-apiserver

but looking forward to the above-mentioned solution.

@nlamirault
Copy link

Any news on this feature ?

@zroubalik
Copy link
Member

@jeffhollan ^

@mohsinonxrm
Copy link

mohsinonxrm commented Oct 6, 2021

Latest linux/arm64 2.4.0 images here:
https://hub.docker.com/repository/docker/mohsinonxrm/keda
https://hub.docker.com/repository/docker/mohsinonxrm/keda-metrics-apiserver

@tomkerkhove , when is that ARM machine coming online? :)

@tomkerkhove
Copy link
Member

When we have some more info from @jeffhollan on how to set it up.

@zroubalik zroubalik added this to the v2.6.0 milestone Nov 23, 2021
@tomkerkhove tomkerkhove self-assigned this Nov 26, 2021
@mohsinonxrm
Copy link

while we wait for 2.6.0 release, here are 2.5.0 arm64 versions:
https://hub.docker.com/repository/docker/mohsinonxrm/keda
https://hub.docker.com/repository/docker/mohsinonxrm/keda-metrics-apiserver

@tomkerkhove
Copy link
Member

Like @zroubalik said, we are open for contributions to help close this upstream in KEDA itself :)

@tomkerkhove tomkerkhove removed their assignment Dec 7, 2021
@mohsinonxrm
Copy link

@tomkerkhove , I had a look at GitHub Actions and I'll be honest, I don't think I'm familiar enough with it to modify to use build for arm64.

BTW, the only change I made for building these images is to update the Docker and Docker.adapter files with arm64 golang images and then in the makefile change the arm to ARCH ?= arm64.

I've also installed all the build tools locally on the PI 4 or Ampere VMs (Oracle), so I'm sure the build-tools.Dockerfile can also be updated. OperatorSDK is available for arm64 as well, build Azure CLI locally... everything works. Just don't know how to put it together in a parameterized way for GitHub Actions.

Wish I could help more and take it to the finish line.

@mohsinonxrm
Copy link

@tomkerkhove , actually... let me take another look at it. I was approaching this the wrong way.

@zroubalik
Copy link
Member

It is not about the build tools I'd say. But more about building KEDA for arm64, start a small Kind (or similar k8s distro) on ARM machine and run some smoke check (a couple of e2e tests, eg. cron or additional simple ones).

@mohsinonxrm
Copy link

I have a k3s cluster, so I'll play on that first, will report my findings here.

@tomkerkhove
Copy link
Member

Thank you @mohsinonxrm - I will just assign this to me to keep track of this but feel free to keep on tinkering around!

@tomkerkhove tomkerkhove self-assigned this Dec 8, 2021
@tomkerkhove tomkerkhove removed this from the v2.6.0 milestone Jan 4, 2022
@morganchristiansson
Copy link

morganchristiansson commented Jan 9, 2022

One way to simply solve this is to cross-compile the binaries first, then use docker buildx build --platform linux/arm64,linux/amd64 and COPY the $TARGETARCH-specific binaries (instead of compiling it in Dockerfile).

I saw another go project using https://github.com/mitchellh/gox to cross-compile binaries.. It will then be simple and fast to create the multi-arch image with the buildx build command (using qemu).

Another way is to build amd64 and arm64 docker image in separate jobs and then use docker manifest to create the multi-arch manifest.

@tomkerkhove tomkerkhove moved this to Backlog in Roadmap - KEDA Core Feb 10, 2022
@tomkerkhove tomkerkhove moved this from To Do to In Progress in Roadmap - KEDA Core Feb 11, 2022
@tomkerkhove tomkerkhove assigned JorTurFer and unassigned tomkerkhove Mar 2, 2022
@JorTurFer JorTurFer moved this from In Progress to Ready To Ship in Roadmap - KEDA Core Mar 9, 2022
@morganchristiansson
Copy link

Very nice! Is new release being made?

@tomkerkhove
Copy link
Member

It will be in 2.7

@JorTurFer
Copy link
Member

taking into account our release plan, in 2 months approx will be the next release

@JorTurFer
Copy link
Member

You can try it using main tag but we not recommend that on prod environments because main is not stable version

@DevOpsBoondoggles
Copy link

DevOpsBoondoggles commented Apr 6, 2022

@JorTurFer Is it possible to leave this open until it's actually released maybe ?
It would be helpful for people searching the same problem. I nearly missed it because it's closed but it's not actually solved in terms of me being able to use it.
Thanks

@tomkerkhove
Copy link
Member

We have closed it because the work is done but you can see that it's in "ready to ship" status of our backlog.

Otherwise it is hard to track what is open and what not.

@DevOpsBoondoggles
Copy link

We have closed it because the work is done but you can see that it's in "ready to ship" status of our backlog.

Otherwise it is hard to track what is open and what not.

No worries !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm feature All issues for new features that have been committed to
Projects
Archived in project
Development

No branches or pull requests