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

ci: build riscv64 binaries #2645

Closed
ernado opened this issue Apr 1, 2023 · 6 comments
Closed

ci: build riscv64 binaries #2645

ernado opened this issue Apr 1, 2023 · 6 comments

Comments

@ernado
Copy link

ernado commented Apr 1, 2023

Add linux/riscv64 target, alongside with linux/s390x, linux/ppc64, ..., etc.

I've failed to found where to add linux/riscv64 in this repo, so can't issue a PR.

I've checked it manually:

ernado@nexus:/src/node_exporter$ GOARCH=riscv64 make build
>> building binaries
/go/bin/promu --config .promu.yml build --prefix /src/node_exporter 
 >   node_exporter
ernado@nexus:/src/node_exporter$ scp node_exporter riscv:~
node_exporter 
root@starfive:~# uname -a
Linux starfive 5.15.0-starfive #1 SMP Mon Feb 27 14:03:14 EST 2023 riscv64 GNU/Linux
root@starfive:~# ./node_exporter 
ts=2023-04-01T08:58:29.488Z caller=node_exporter.go:180 level=info msg="Starting node_exporter" version="(version=1.5.0, branch=master, revision=6a42c0b0a82caa3bf9526bc80d86f8f5550bf84e)"
ts=2023-04-01T08:58:29.488Z caller=node_exporter.go:181 level=info msg="Build context" build_context="(go=go1.20.2, platform=linux/riscv64, user=ernado@nexus, date=20230401-08:55:10)"
...
root@starfive:~# curl -sNL 0.0.0.0:9100/metrics | head 
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 9.9751e-05
go_gc_duration_seconds{quantile="0.25"} 9.9751e-05
go_gc_duration_seconds{quantile="0.5"} 9.9751e-05
go_gc_duration_seconds{quantile="0.75"} 9.9751e-05
go_gc_duration_seconds{quantile="1"} 9.9751e-05
go_gc_duration_seconds_sum 9.9751e-05
go_gc_duration_seconds_count 1
# HELP go_goroutines Number of goroutines that currently exist.

Works fine on StarFive VisionFive 2.

@discordianfish
Copy link
Member

Targets are configured here (if CGO is needed): https:/prometheus/node_exporter/blob/master/.promu-cgo.yml#L23
..or if it isn't: https:/prometheus/node_exporter/blob/master/.promu.yml#L22

@dswarbrick
Copy link
Contributor

@ernado In case you are running Debian bookworm / sid, node_exporter is provided for riscv64 in the sid repos: https://packages.debian.org/sid/riscv64/prometheus-node-exporter/download

riscv64 is an unofficial arch on Debian, which means it is not yet shipped with any official releases. However, any packages that land in sid will automatically attempt to build on riscv64, most of the time successfully.

@ernado
Copy link
Author

ernado commented Apr 5, 2023

Should I close this issue until riscv64 will be supported by Debian or just leave it until then?

@discordianfish
Copy link
Member

Let's keep it open, if we can easily cross compile for these archs we should provide them

@dongjiang1989
Copy link
Contributor

Makefile.common need update promu version to 0.15.0 , auto support

@SuperQ
Copy link
Member

SuperQ commented Jul 18, 2023

Done: #2752

@SuperQ SuperQ closed this as completed Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants