client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Locally reproducible CI/CD

Open kakkoyun opened this issue 2 years ago • 8 comments

We want vendor-independent and locally reproducible CI/CD pipelines so that our contributors can ensure quality before opening the pull requests.

kakkoyun avatar Jan 23 '24 12:01 kakkoyun

Hi @kakkoyun, navigated here form the LFX portal. Since this is particularly about unit testing in specific environments, We can allow contributors to specify the Go version they want to use through environment variables and modify the CI/CD scripts to interpret these variables and set up the corresponding Go version for testing. We certainly will have to find a way to manage dependencies. Or how about using 3 different docker images for 3 test environments? What are your thoughts?

dvjsharma avatar Feb 03 '24 22:02 dvjsharma

hey there! I'm coming from this X thread: https://twitter.com/ArthurSilvaSens/status/1791069622508179854. Seems like https://dagger.io could help here. @juliusv mentioned that the prom team tried to use Dagger in the past without success but a lot have changed since then and this particular problematic is exactly the problem Dagger tries to solve. Happy to take a look and collaborate on a PoC if you're interested :open_hands:

marcosnils avatar May 16 '24 12:05 marcosnils

What exactly is not reproducible at the moment? Let's talk about specifics. I heard testing for certain Go version as a one thing.

bwplotka avatar May 16 '24 13:05 bwplotka

What exactly is not reproducible at the moment? Let's talk about specifics. I heard testing for certain Go version as a one thing.

I never claimed it's not reproducible. The idea is to be able to run anything we use in the CI locally https://github.com/prometheus/client_golang/tree/main/.github/workflows with the least amount of effort. Technically, we can have make actions for everything and it could be the single source of truth or we can go with something fancy like https://dagger.io

kakkoyun avatar Jun 06 '24 11:06 kakkoyun

@bwplotka @kakkoyun happy to help putting together a PoC with Dagger so you can decide if it's worth or not. Taking a glimpse at one of your most executed GHA workflows here: https://github.com/prometheus/client_golang/blob/main/.github/workflows/go.yml#L60, looks like several targets from this Makefile here (https://github.com/prometheus/client_golang/blob/main/Makefile.common) could be daggerized to avoid users running into env specific issues.

LMK if there's interest and I can kick off a draft PR and we can discuss there maybe with more tangible examples on how this could work.

marcosnils avatar Jun 06 '24 13:06 marcosnils

@marcosnils Thanks 🤩 Why not? I would be happy to review.

kakkoyun avatar Jun 07 '24 14:06 kakkoyun

@kakkoyun funny thing is that first thimg I did after cloning the repo is calling make build and I'm getting the following error:

130|marcos:Projects/client_golang (main) (⎈ |dagger-ci)$ make build
>> building binaries
/home/marcos/Projects/gopath/bin/promu build --prefix /home/marcos/Projects/client_golang 
Unable to read config file: .promu.yml
!! open .promu.yml: no such file or directory
make: *** [Makefile.common:204: common-build] Error 1

couldn't find an easy way to unblock myself. Any ideas where I should be getting that .promu.yml file from?

marcosnils avatar Jun 07 '24 16:06 marcosnils

Hello 👋 Looks like there was no activity on this issue for the last 3 months. Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗 If there will be no activity in the next 4 weeks, this issue will be closed (we can always reopen an issue if we need!).

stale[bot] avatar Jul 19 '25 06:07 stale[bot]