Skip to content

Commit

Permalink
Update drone files
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelroquetto committed Feb 28, 2025
1 parent b351674 commit a732ee6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 11 deletions.
16 changes: 15 additions & 1 deletion .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ steps:
- make lint
image: grafana/alloy-build-image:v0.1.8
name: Lint
volumes:
- name: docker
path: /var/run/docker.sock
trigger:
event:
- pull_request
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
---
kind: pipeline
name: Test
Expand All @@ -25,10 +32,17 @@ steps:
- make GO_TAGS="nodocker" test
image: grafana/alloy-build-image:v0.1.8
name: Run Go tests
volumes:
- name: docker
path: /var/run/docker.sock
trigger:
event:
- pull_request
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
---
kind: pipeline
name: Test (Full)
Expand Down Expand Up @@ -579,6 +593,6 @@ kind: secret
name: updater_private_key
---
kind: signature
hmac: 26b5613cbd5e5cd42656c10c372d44dc93af565ec2ae212d3b27c2fe366c6aeb
hmac: e6b3e9929f79eab8e5e454b543705e080893abe81ebbd7f47b67dcb6981b0fa8

...
20 changes: 20 additions & 0 deletions .drone/pipelines/test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ local pipelines = import '../util/pipelines.jsonnet';
steps: [{
name: 'Lint',
image: build_image.linux,
volumes: [{
name: 'docker',
path: '/var/run/docker.sock',
}],
commands: [
'apt-get update -y && apt-get install -y libsystemd-dev',
'make lint',
],
}],
volumes: [{
name: 'docker',
host: {
path: '/var/run/docker.sock',
},
}],
},

pipelines.linux('Test') {
Expand All @@ -23,11 +33,21 @@ local pipelines = import '../util/pipelines.jsonnet';
steps: [{
name: 'Run Go tests',
image: build_image.linux,
volumes: [{
name: 'docker',
path: '/var/run/docker.sock',
}],

commands: [
'make GO_TAGS="nodocker" test',
],
}],
volumes: [{
name: 'docker',
host: {
path: '/var/run/docker.sock',
},
}],
},

pipelines.linux('Test (Full)') {
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} \
GO_TAGS="netgo builtinassets promtail_journal_enabled" \
GOEXPERIMENT=${GOEXPERIMENT} \
make alloy
make alloy-for-image

FROM public.ecr.aws/ubuntu/ubuntu:noble

Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ else
$(GO_ENV) go build $(GO_FLAGS) -o $(ALLOY_BINARY) .
endif

alloy-for-image:
$(GO_ENV) go build $(GO_FLAGS) -o $(ALLOY_BINARY) .

# alloy-service is not included in binaries since it's Windows-only.
alloy-service:
ifeq ($(USE_CONTAINER),1)
Expand Down Expand Up @@ -278,13 +281,14 @@ drone: generate-drone

# Required by vendored Beyla to build eBPF artifacts prior to building the
# Alloy binary
# go mod vendor is require for GH workflows, as we cannot mount directories
# go mod vendor is required for GH workflows, as we cannot mount directories
# outside of the source dir inside the beyla ebpf builder image
# GOHOSTOS and GOHOSTARCH are required to ensure that the tool runs on the
# host context, rather than building target binaries when cross-compiling
.PHONY: generate-beyla
generate-beyla:
if [ -n "$$GITHUB_WORKSPACE" ]; then go mod vendor; fi; \
MODULE_ROOT=$$(go list -tags beyla_bpf -f '{{.Dir}}' github.com/grafana/beyla/v2/bpf); \
GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go generate $$MODULE_ROOT/build_ebpf.go
if [ -n "$$GITHUB_WORKSPACE" ] || [ -n "$$DRONE_SYSTEM_HOST" ]; then go mod vendor; fi; \
GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go run github.com/grafana/beyla/v2/cmd/beyla-genfiles@generate_tool

.PHONY: clean
clean: clean-dist clean-build-container-cache
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ require (
github.com/grafana/go-offsets-tracker v0.1.7 // indirect
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 // indirect
github.com/grafana/jfr-parser v0.9.2 // indirect
github.com/grafana/jvmtools v0.0.3 // indirect
github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.0 // indirect
Expand Down Expand Up @@ -892,7 +893,7 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

require github.com/grafana/beyla/v2 v2.0.1-0.20250227003200-4100d20b606e
require github.com/grafana/beyla/v2 v2.0.1-0.20250228191524-b9d12092ec96

// NOTE: replace directives below must always be *temporary*.
//
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1246,10 +1246,10 @@ github.com/gosnmp/gosnmp v1.38.0/go.mod h1:FE+PEZvKrFz9afP9ii1W3cprXuVZ17ypCcyyf
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/grafana/alloy-remote-config v0.0.10 h1:1Ge7lz2mjXI1rd6SmiZpFHyXeLehBuCi43+XTkdqgV4=
github.com/grafana/alloy-remote-config v0.0.10/go.mod h1:kHE1usYo2WAVCikQkIXuoG1Clz8BSdiz3kF+DZSCQ4k=
github.com/grafana/beyla/v2 v2.0.1-0.20250226224816-4aa2d9529c02 h1:XEzD03HJkN2HE1iKeHx91EQj0+H6pexxWd73Crxn8Vw=
github.com/grafana/beyla/v2 v2.0.1-0.20250226224816-4aa2d9529c02/go.mod h1:MK9DL2NL9JoFKqs31CCoNToryajkUxSr7W0krbaIZhU=
github.com/grafana/beyla/v2 v2.0.1-0.20250227003200-4100d20b606e h1:/9+0yWRlYQxNBMa24wEWTFv9mawllixMUdqbplqK1kU=
github.com/grafana/beyla/v2 v2.0.1-0.20250227003200-4100d20b606e/go.mod h1:MK9DL2NL9JoFKqs31CCoNToryajkUxSr7W0krbaIZhU=
github.com/grafana/beyla/v2 v2.0.1-0.20250228181844-8db4ab92d492 h1:4J1yKVr7Att990TfkUiVbaBQavJVxZmTM7ODJYumPPs=
github.com/grafana/beyla/v2 v2.0.1-0.20250228181844-8db4ab92d492/go.mod h1:TBliYCPmQIPzUdW325AJDIXReB7kk13HtgUy9BidLIc=
github.com/grafana/beyla/v2 v2.0.1-0.20250228191524-b9d12092ec96 h1:Klloqg3yBljXzaNYShgSh3EDpkmMQjbNlNMHafsWDoE=
github.com/grafana/beyla/v2 v2.0.1-0.20250228191524-b9d12092ec96/go.mod h1:TBliYCPmQIPzUdW325AJDIXReB7kk13HtgUy9BidLIc=
github.com/grafana/cadvisor v0.0.0-20240729082359-1f04a91701e2 h1:ju6EcY2aEobeBg185ETtFCKj5WzaQ48qfkbsSRRQrF4=
github.com/grafana/cadvisor v0.0.0-20240729082359-1f04a91701e2/go.mod h1:8sLW/G7rcFe1CKMaA4pYT4mX3P1xQVGqM6luzEzx/2g=
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20250218151502-6e97feaee761 h1:dPJOIEwtQ8uR3Qa79pb/lsSFJQ6j4P9vpCUQ4fKimG4=
Expand All @@ -1273,6 +1273,8 @@ github.com/grafana/jfr-parser/pprof v0.0.3 h1:GbhF9vVbfSUTpn0TPSdOBnDW8cKFQ3lqgi
github.com/grafana/jfr-parser/pprof v0.0.3/go.mod h1:MccKegViSw2NsyXNww1yuIcaQlw6LxP/DT0CHlsfRgw=
github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 h1:NznuPwItog+rwdVg8hAuGKP29ndRSzJAwhxKldkP8oQ=
github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32/go.mod h1:796sq+UcONnSlzA3RtlBZ+b/hrerkZXiEmO8oMjyRwY=
github.com/grafana/jvmtools v0.0.3 h1:4uPquep5v+54Z04OQYOCldrv2SR42IRagHQXrNHsc4g=
github.com/grafana/jvmtools v0.0.3/go.mod h1:b0tiPI5zNyIuPUz2DwvxUCI+5bFoG7A4i47F9sc8w98=
github.com/grafana/kafka_exporter v0.0.0-20240409084445-5e3488ad9f9a h1:jqM4NNdx8LSquKo8bPx+XWn91S2b+sgNvEcFfSJQtHY=
github.com/grafana/kafka_exporter v0.0.0-20240409084445-5e3488ad9f9a/go.mod h1:ZXGGyeTUMenf/H1CDBK9lv3azjswfa0nVzLoQAYmnDc=
github.com/grafana/loki/pkg/push v0.0.0-20250218135905-f078e0e3f9b6 h1:s4B8mN2RvfKEd3TQRHRMQlfuUAyQ4if8UXnzysH4NSY=
Expand Down

0 comments on commit a732ee6

Please sign in to comment.