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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ trigger:

steps:
- name: build
image: grafana/grafana-plugin-ci:1.8.1-alpine
image: grafana/grafana-plugin-ci:1.9.5
commands:
- mage -v build

- name: lint
image: grafana/grafana-plugin-ci:1.8.1-alpine
image: grafana/grafana-plugin-ci:1.9.5
commands:
- mage -v lint

- name: test
image: grafana/grafana-plugin-ci:1.8.1-alpine
image: grafana/grafana-plugin-ci:1.9.5
commands:
# -race requires cgo + a C compiler
- apt update
- apt install -y gcc
Comment on lines +32 to +33
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)

- mage -v testRace
environment:
CGO_ENABLED: "1"
---
kind: pipeline
type: docker
Expand All @@ -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

commands:
- mage -v build

- name: lint
image: grafana/grafana-plugin-ci:1.8.1-alpine
image: grafana/grafana-plugin-ci:1.9.5
commands:
- mage -v lint

- name: test
image: grafana/grafana-plugin-ci:1.8.1-alpine
image: grafana/grafana-plugin-ci:1.9.5
commands:
# -race requires cgo + a C compiler
- apt update
- apt install -y gcc
- mage -v testRace
environment:
CGO_ENABLED: "1"

---
kind: signature
hmac: 6f03e7026ce25ca829f7969c38628da6ee4ccdf0f5898b592f95c71f9090a093
hmac: cee688a6f8ed3ecb1ddd384e349a6556d28b23b298057d8fa02da37ab50b0ba7

...
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/grafana-plugin-sdk-go

go 1.20
go 1.21

require (
github.com/cheekybits/genny v1.0.0
Expand Down