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

Chore: CI: Bump grafana-plugin-ci image to 1.9.5 #780

Merged
merged 5 commits into from
Oct 23, 2023
Merged

Conversation

xnyo
Copy link
Member

@xnyo xnyo commented Oct 19, 2023

What this PR does / why we need it:

Bumps the image used to run CI steps. Brings the following changes:

  • Go 1.21 is used (instead of 1.20)
  • The latest version of golangci-lint is used

Previously, we used Alpine-based images. Since 1.9.0 of the image, we stopped building them:

https://hub.docker.com/r/grafana/grafana-plugin-ci/tags

So we are using Debian-based images now.

go test -race requires CGO and a C compiler, for this reason we have to install gcc and enable CGO in the test step.

Long term I say we should probably stop using those grafana-plugin-ci images and use the Go image + mage, and golangci-lint separately, similar to what we do for example in the plugin runner:

https://github.com/grafana/grafana-plugin-runner/blob/main/.drone.yml

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@xnyo xnyo added the chore label Oct 19, 2023
@xnyo xnyo self-assigned this Oct 19, 2023
Comment on lines +31 to +32
- apt update
- apt install -y gcc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go test -race requires CGO and a C compiler installed:

root@df30cca174ec:/src# mage -v testRace
Running target: TestRace
exec: go "test" "-race" "./..."
go: -race requires cgo; enable cgo by setting CGO_ENABLED=1
root@df30cca174ec:/src# CGO_ENABLED=1 mage -v testRace
Running target: TestRace
exec: go "test" "-race" "./..."
go: downloading github.com/mitchellh/reflectwalk v1.0.2
# runtime/cgo
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in $PATH

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long term I say we should probably stop using those images and use the Go image + mage, and golangci-images, similar to what we do for example in the plugin runner:

https://github.com/grafana/grafana-plugin-runner/blob/main/.drone.yml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that it requires CGO. Was this in CI or for you locally?

Long term I say we should probably stop using those images and use the Go image + mage, and golangci-images

Yeah sounds like a good idea 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that it requires CGO. Was this in CI or for you locally?

Both locally and CI. Unfortunately it's a requirement: https://go.dev/doc/articles/race_detector#Requirements

I wasn't aware of this either before today 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Hopefully things evolve eventually golang/go#9918 (comment)

@@ -44,22 +49,27 @@ trigger:

steps:
- name: build
image: grafana/grafana-plugin-ci:1.8.1-alpine
image: grafana/grafana-plugin-ci:1.9.5
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 1.9.0, we stopped building alpine-based images. Only debian-based ones are available:

https://hub.docker.com/r/grafana/grafana-plugin-ci/tags

@xnyo xnyo marked this pull request as ready for review October 19, 2023 14:24
@xnyo xnyo requested a review from a team as a code owner October 19, 2023 14:24
@xnyo xnyo requested review from wbrowne, marefr and andresmgot and removed request for a team October 19, 2023 14:24
Copy link
Contributor

@marefr marefr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xnyo xnyo merged commit 225dd2c into main Oct 23, 2023
@xnyo xnyo deleted the giuseppe/bump-ci-image branch October 23, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

2 participants