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

It would be nice if github releases had binaries for download #59

Open
jrwren opened this issue May 27, 2021 · 15 comments · Fixed by #77 · May be fixed by #91 or #116
Open

It would be nice if github releases had binaries for download #59

jrwren opened this issue May 27, 2021 · 15 comments · Fixed by #77 · May be fixed by #91 or #116

Comments

@jrwren
Copy link

jrwren commented May 27, 2021

I don't know how to set this up or if it can be automated with actions, but if someone can point me to docs and it is acceptable I'd love to send a PR to implement this.

I don't know rust and cargo and so I extracted a binary from the docker image. It works well, but it is less than ideal.

@tobikris
Copy link

tobikris commented Jun 8, 2021

I don't really know how to add this as a GitHub Action, but here is my workaround for now:

You can use the following snippet to compile the exporter with musl for x86_64.

The binary will be in $(pwd)/target/x86_64-unknown-linux-musl/release/prometheus_wireguard_exporter.

git clone https://github.com/MindFlavor/prometheus_wireguard_exporter.git
cd prometheus_wireguard_exporter
docker run --rm -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder cargo build --release

qdm12 added a commit that referenced this issue Jul 8, 2021
- Split setup section in three subsections:
     1. Pre built binaries, empty for now, with a subscribe link to #59 
     2. Docker with simplified step-by-step instructions
         - Add Docker tagged images information
     3. Rust with simplified step-by-step instructions
- Fix `<switch>` not showing in tables
- Add syntax highlighting to code blocks
- Highlight Docker image cross cpu compatibility, as many users crave for this for their ARM devices
- Precise docker build only work on amd64/686 CPUs
- Clear up rustc version required to build
@qdm12
Copy link
Collaborator

qdm12 commented Jul 8, 2021

The Docker build now cross build for all available architectures, maybe we can use it and send the built binaries (statically linked with musl bundled) to the Github API.

Now the problem comes with OSX since all musl cross building tooling is for linux and not darwin, I'm not sure it would work.

Anyway, I think it's best to just use a Github Action for it (duplicating the CI work, but oh well), https://github.com/marketplace/actions/rust-release-binary looks promising. (only supports x86_64 ugh)

@qdm12
Copy link
Collaborator

qdm12 commented Jul 8, 2021

Also note you could (trigger warning: sort of ugly) for Linux, as long as you have Docker, do:

docker pull mindflavor/prometheus_wireguard_exporter && \
  containerid="$(docker create mindflavor/prometheus_wireguard_exporter)" && \
  docker cp "$containerid:/usr/local/bin/prometheus_wireguard_exporter" /usr/local/bin/prometheus_wireguard_exporter && \
  docker rm "$containerid"

And have the static binary on your host 😉 I'll dig on how to upload them to Github releases using a similar approach, at least we will have Linux binaries. OSX will have to wait though.

EDIT: That should do together with those ugly docker commands running in the CI. I'll do it sometime soon.

@upstream-dmahlberg
Copy link

Is this ticket still alive? The PR could be merged without conflicts...

@MindFlavor
Copy link
Owner

Hi @upstream-dmahlberg, I'll leave to @qdm12 to decide what to do on that PR. He's much more competent than me on the subject!

@upstream-dmahlberg
Copy link

@MindFlavor @qdm12 Any updates on this?

@qdm12 qdm12 closed this as completed in #77 Mar 9, 2022
qdm12 pushed a commit that referenced this issue Mar 9, 2022
This adds a workflow (or actually several parallel ones) that gets triggered for a new tag. It builds binaries for several different platforms, creates a release and attaches them as downloads. I wasn't able to make this work for arm64 (because of ring) therefore I commented that part for now.

Fix #59
@qdm12
Copy link
Collaborator

qdm12 commented Mar 9, 2022

Merged, sorry guys for the long delay. I'll try to dig into it in the coming weeks, to improve the CI pipeline.

EDIT: It's merged thanks @micxer so we should have binaries on tags.

@ekeih
Copy link

ekeih commented Mar 10, 2022

This is awesome, thanks for the work on this!
Any chance to get a new tag/release to publish initial binaries? :)

@qdm12
Copy link
Collaborator

qdm12 commented Mar 12, 2022

@micxer it doesn't look like it's building binaries on the latest tag, any clue why? I'm afk for the coming days so I can't really investigate.

@qdm12 qdm12 reopened this Mar 12, 2022
@tobikris tobikris linked a pull request Mar 12, 2022 that will close this issue
@sebastianrakel
Copy link

is there any update. would be awesome if this is working, i want to add it to this https://github.com/voxpupuli/puppet-prometheus/ puppet module

@zloo
Copy link

zloo commented Dec 30, 2022

I would appreciate binary builds as well. Is there anything I can do to help?

@pavars
Copy link

pavars commented Jul 4, 2023

I'm not very experienced in Rust but I can help with setting up the pipelines for github actions. In theory it shouldn't be that hard to build the binaries, extract them and publish with github release. I don't know how compilation for rust on mac works but that might be trickier if it requires darwin build agents (if cross-compilation doesn't work).

@BBaoVanC
Copy link

BBaoVanC commented Jul 19, 2023

You can just use GitHub Actions macOS runners for Mac. I have a project that builds my own rust project for Windows, Mac, and Linux on all x86 and arm architectures, which basically just consists of installing the correct target with rustup and then running cargo build --release. It builds parallel too, because I use a matrix to select the os and target.

See the release job: https://github.com/BBaoVanC/bobashare/blob/master/.github/workflows/deploy.yml

@Kariton
Copy link

Kariton commented Oct 14, 2023

I managed to build those executables from the current source through github actions. Especially the FreeBSD version.
#116

dunno how log artifacts will be saved but you can download them here at the bottom:
https://github.com/Kariton/prometheus_wireguard_exporter/actions/runs/6517589948

I just realised that artifacts are not public. I uploaded them manually.
https://github.com/Kariton/prometheus_wireguard_exporter/releases/tag/v3.6.6

@Kariton Kariton linked a pull request Oct 22, 2023 that will close this issue
@n0valis
Copy link

n0valis commented Apr 16, 2024

Is there any hope that this will finally arrive?

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