Skip to content

ci: Add support for linux-riscv64 - #7414

Merged
twz123 merged 1 commit into
k0sproject:mainfrom
luhenry:main
Jun 19, 2026
Merged

ci: Add support for linux-riscv64#7414
twz123 merged 1 commit into
k0sproject:mainfrom
luhenry:main

Conversation

@luhenry

@luhenry luhenry commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Description

This is currently an experiment. Happy to get reviews as always.

Add GitHub Actions CI on linux-riscv64 using RISE RISC-V Runners.

Relates to #1919
Depends on k0sproject/image-builder#253 #7459

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@luhenry

luhenry commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

Currently blocked on missing https://github.com/anchore/syft support for linux-riscv64. I'll submit a PR upstream and update here accordingly. EDIT: work in progress at anchore/syft#4757, I disabled it here for now for riscv64 specifically.

@twz123

twz123 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Nice! IIUC we need to add the RISE app to our GitHub org, right? There's also https://www.riscvrunners.com/. Do you know the differences?

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Nice! IIUC we need to add the RISE app to our GitHub org, right? There's also https://www.riscvrunners.com/. Do you know the differences?

Yes, you’d need to add https://github.com/apps/rise-risc-v-runners (only require permissions on “self-hosted runners read+write”).

On https://www.riscvrunners.com/, the main difference is the RISE ones are free (and will stay free, RISE is not a business) and you have access to the whole machine. I’m not intimately familiar with the base image they are using (which packages, what OS, etc) but I’ll look more into it.

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Trying to add the proper image dependencies at k0sproject/image-builder@main...luhenry:k0s-image-builder:main

@twz123

twz123 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Trying to add the proper image dependencies at k0sproject/image-builder@main...luhenry:k0s-image-builder:main

I need to follow up on k0sproject/image-builder#256. I don't think we can generally enable RISC-V builds for everything.

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Trying to add the proper image dependencies at k0sproject/image-builder@main...luhenry:k0s-image-builder:main

I need to follow up on k0sproject/image-builder#256. I don't think we can generally enable RISC-V builds for everything.

Sounds good. Do you know if there will be other images that will be a required dependency?

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

I'm brute-forcing my way through figuring out which images/versions are working: https://github.com/luhenry/k0s-image-builder/actions/runs/24236376271

Good news is quite a few are already working, so adding them is a simple "adding a new version" away. Once that workflow finished, I'll look through all the failures and categorize them, that should give us a good todo list, and list of things to exclude/ignore as well

@twz123

twz123 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Sounds good. Do you know if there will be other images that will be a required dependency?

No. In fact, Calico is not a requirement. By default, k0s will use kube-router, which is already available for RISC-V. You won't be able to use NLLB (another optional feature), as this is would require envoy, and we didn't have the time to try to make it compile for RISC-V. But I'm currently looking into adding support for Traefik (#7405), mainly for Windows, but Traefik supports RISC-V and ARMv7 out of the box, so this might be a viable alternative to make NLLB usable on RISC-V, as well.

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Recent development: BIRD has just added (like 3 days ago) builds for riscv64: https://gitlab.nic.cz/labs/bird/-/commit/0aca5b325fb6606d620ef349d70892105e1242c3. I ran into that issue in the build for calico-node at least.

In fact, Calico is not a requirement

Good, then at least it's not a blocker. It should get resolved soon though. I never like diverging from how it's done on linux-amd64 and linux-arm64 because I like things to "just work". But gotta be pragmatic here 😅

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Also, another finding: etcd is broken on all platforms, since bitnami/etcd seems to have no more tags (?). That seems broken not just for linux-riscv64 but for all other platforms as well.

@twz123

twz123 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Also, another finding: etcd is broken on all platforms, since bitnami/etcd seems to have no more tags (?). That seems broken not just for linux-riscv64 but for all other platforms as well.

Not all the images in the image-builder repo are used by k0s itself. There's also some utility things, like the GH Actions runners which we use to build k0s for ARMv7. Not sure if the etcd stuff is used anywhere, still.

Pretty sure that envoy is the last image that's directly used by k0s which is not available for RISC-V.

@twz123

twz123 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Recent development: BIRD has just added (like 3 days ago) builds for riscv64: https://gitlab.nic.cz/labs/bird/-/commit/0aca5b325fb6606d620ef349d70892105e1242c3. I ran into that issue in the build for calico-node at least.

We started to build BIRD from source in the Calico Dockerfiles recently, so this should be fine.

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Triggering with v3.31.4-2 from k0sproject/image-builder#256, running at https://github.com/luhenry/k0s/actions/runs/24244825789

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

And for the missing quay.io/k0sproject/pushgateway-ttl:1.4.0-k0s.0 image: k0sproject/pushgateway-ttl-builder#5

Comment thread pkg/constant/constant.go Outdated
@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Following k0sproject/pushgateway-ttl-builder#5 (comment), I've cherry-picked your commit to mark Envoy as not-supported.

luhenry added a commit to luhenry/troubleshoot that referenced this pull request Apr 10, 2026
This project is a dependency of `k0s` which is working on being built, tested and released on `linux-riscv64` [1].

RISC-V is gaining momentum especially in the embedded and edge world. 

[1] k0sproject/k0s#7414
@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

https://github.com/replicatedhq/troubleshoot is missing on riscv64 now for:

The simplest solution is to simply not run the smoketests-linux-riscv64 for now. I'll submit a PR upstream to try to get them to enable and release linux-riscv64 as well.

I've also verified that k0sproject/image-builder#253 is working: I rebased it and used the resulting image at https://github.com/luhenry/k0s/actions/runs/24254357499/job/70824468191. The Build :: Airgap image bundle (riscv64) / linux-riscv64 is passing.

@luhenry

luhenry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Opened a PR on replicatedhq/troubleshoot#2010 for linux-riscv64

@luhenry luhenry changed the title [Experiment] Add CI on RISC-V ci: Add support for linux-riscv64 Apr 10, 2026
@luhenry
luhenry marked this pull request as ready for review April 10, 2026 21:14
@luhenry
luhenry requested review from a team as code owners April 10, 2026 21:14
@luhenry

luhenry commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

I got some progress in enabling the test suite but hitting the next blocker.

On the overlay-on-overlay, I fixed it by using an empty volume for the pod at /var/lib/k0s (see [1]). Because a k8s pod's volumne is a direct mount from the host's filesystem into the container, and not an overlayfs, the /var/lib/k0s folder inside the pod is a ext4 mount [2].

The next issue I ran into was the DNS from kube-proxy inside the k0s cluster was getting confused because the CIDR was the same between the k8s's pod and the k0s running inside the pod. The solution was simply to use the hostNetwork for the pods [3]. This actually makes more sense since the pod should not have access to anything internal to the k8s cluster.

Finally, the issue I'm not running into has to do with kube-router trying to setup a firewall which depends on the ip_set_hash_net kernel module. However, that module is not available on the Scaleway EM-RV1 out-of-the-box (even as a module). So the solution would be to build the kernel module so that it can be loaded. I'm currently working on that.

As a side note, we are also working with a Kernel contributor to upstream any patches necessary to mainline Linux to support the TH1520 (the SoC used by the EM-RV1) so we can go to mainline kernel instead of an older kernel version.

Overall, it's making good progress and I'm hoping to get things working in next weeks. Good news is nearly nothing has to change on k0s itself, and all in the infrastructure.

[2]:

$> kubectl exec -it rise-riscv-runner-9572x75pv -- findmnt -R
TARGET SOURCE FSTYPE  OPTIONS
/      overlay
              overlay rw,relatime,lowerdir=/var/lib/containerd/io.containerd.sna
|-/var/lib/k0s
|      /dev/mmcblk0p3[/var/lib/kubelet/pods/a8bffb66-a287-4d9f-a4bf-7cb8c30db806/volumes/kubernetes.io~empty-dir/k0s]
|             ext4    rw,relatime,errors=remount-ro

@twz123

twz123 commented May 5, 2026

Copy link
Copy Markdown
Member

Good news! CNCF approved to add the RISE RISC-V runners to the k0sproject org 🚀

@luhenry could you rework this PR in a way that it doesn't trigger for every PR? Instead, I think it's best to start with a nightly job that also has a workflow_dispatch, similar to what we have for the ostests.

If the integration tests aren't working yet, we could add this as an optional parameter for workflow_dispatch (again, in a way similar to what we're doing for the ostests, this time in ostests-matrix.yaml). This way, we can execute and iterate on the integration tests without needing to change the workflows.

@luhenry
luhenry force-pushed the main branch 2 times, most recently from fa4d755 to cc9320d Compare May 6, 2026 14:04
@luhenry

luhenry commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

I split the unittests in a separate workflow_call file, similar to build-k0s and smoketests. I added a go-nightly.yml which only runs the build-k0s, unittests, build-airgap-image-bundle and smoketests-linux-riscv64 (disabled for now [1][2]) for linux-riscv64.

I'm testing it at:

@luhenry
luhenry force-pushed the main branch 2 times, most recently from d476e15 to 822738f Compare May 6, 2026 16:43
@luhenry

luhenry commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

For the latest on the issue with kube-router, I met with my contact at Scaleway today, and they are going to share the sources for the Linux Kernel they have on the Scaleway EM-RV1. I'll build the necessary modules from it and add them to all the machines of the pool. I'll keep you posted as soon as I have more things to show.

@luhenry could you rework this PR in a way that it doesn't trigger for every PR? Instead, I think it's best to start with a nightly job that also has a workflow_dispatch, similar to what we have for the ostests.

If the integration tests aren't working yet, we could add this as an optional parameter for workflow_dispatch (again, in a way similar to what we're doing for the ostests, this time in ostests-matrix.yaml). This way, we can execute and iterate on the integration tests without needing to change the workflows.

@twz123 that should be all done.

Comment thread .github/workflows/build-k0s.yml
Comment thread .github/workflows/go-nightly.yml Outdated
Comment thread .github/workflows/go-nightly.yml Outdated
Comment thread .github/workflows/unittests-k0s.yml Outdated
Comment thread .github/workflows/unittests-k0s.yml Outdated
Comment thread .github/workflows/go-nightly.yml Outdated
Comment thread .github/workflows/go-nightly.yml Outdated
Comment thread .github/workflows/go-nightly.yml Outdated
@twz123

twz123 commented May 7, 2026

Copy link
Copy Markdown
Member

If you want, you can split out 6fd5939 into a separate PR, so we can merge that already.

@luhenry

luhenry commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

If you want, you can split out 6fd5939 into a separate PR, so we can merge that already.

#7591

I'll work on the rest of the feedback tomorrow

@twz123

twz123 commented May 7, 2026

Copy link
Copy Markdown
Member

If you want, you can split out 6fd5939 into a separate PR, so we can merge that already.

#7591

I'll work on the rest of the feedback tomorrow

I meant the split-off of the unit tests into their own callable workflow 😅

@luhenry

luhenry commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

If you want, you can split out 6fd5939 into a separate PR, so we can merge that already.

#7591
I'll work on the rest of the feedback tomorrow

I meant the split-off of the unit tests into their own callable workflow 😅

Ah sorry, my bad, will do that first thing tomorrow!

@luhenry

luhenry commented May 10, 2026

Copy link
Copy Markdown
Contributor Author

@twz123 I split it out as you requested.

Also, I got check-basic to work 🎉 I updated the underlying workers with the right kernel modules and it works. I'll check other test suites now.

UPDATE: check-basic 1 and check-airgap 2 are working. The check-network-conformance-calico 3 and check-network-conformance-kuberouter 4 are not, but only because https://hub.docker.com/r/sonobuoy/sonobuoy is not available on riscv64. I'll try submitting a PR this week

UPDATE 2: The PR for sonobuoy: vmware-tanzu/sonobuoy#2049

@luhenry

luhenry commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

@twz123 anything else I should do to get this merged? Thanks 🙏

@luhenry

luhenry commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

I verified a build works: https://github.com/luhenry/k0s/actions/runs/26634638919

@luhenry

luhenry commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

Enabling the basic smoketests as I've verified it works at https://github.com/luhenry/k0s/actions/runs/26634649027

Signed-off-by: Ludovic Henry <git@ludovic.dev>
@luhenry

luhenry commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Also enabling airgap as it works: https://github.com/luhenry/k0s/actions/runs/26709975774/job/78719293615

@twz123 twz123 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.

Thanks for pushing this forward!

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.

The changes here are a bit hacky, but I don't have a better proposal right now that wouldn't require lots of work. So just let's live with it for now...

@twz123
twz123 merged commit 1218cbd into k0sproject:main Jun 19, 2026
306 of 311 checks passed
@luhenry

luhenry commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

It's been succeeding for past few days:

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.

3 participants