Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kaoru/ENG-17188/b…
Browse files Browse the repository at this point in the history
…ump-collector
  • Loading branch information
KaoruDev committed Jan 11, 2024
2 parents d1d15c0 + 455a2fa commit de043a8
Show file tree
Hide file tree
Showing 26 changed files with 1,066 additions and 671 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ steps:
- aws-ssm#v1.0.0:
parameters:
GITHUB_RELEASE_ACCESS_TOKEN: /pipelines/buildkite/buildkite-agent-metrics/GITHUB_RELEASE_ACCESS_TOKEN
- docker-compose#v4.11.0:
- docker-compose#v4.14.0:
config: .buildkite/docker-compose.yaml
run: agent
59 changes: 26 additions & 33 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
steps:
- name: ":test_tube: Test"
key: test
command: go test -v -race ./...
plugins:
- docker#v2.0.0:
image: "golang:1.20"
command: ["go", "test", "-v", "-race", "."]
environment:
- GO111MODULE=on
- docker#v5.9.0:
image: golang:1.21

- name: ":golang: Compile"
key: build
plugins:
- golang-cross-compile#v1.3.0:
build: main.go
import: github.com/buildkite/buildkite-agent-metrics
targets:
- version: "1.20.2"
goos: linux
goarch: amd64
gomodule: "on"
- version: "1.20.2"
goos: linux
goarch: arm64
gomodule: "on"
- version: "1.20.2"
goos: windows
goarch: amd64
gomodule: "on"
- version: "1.20.2"
goos: darwin
goarch: amd64
gomodule: "on"
- version: "1.20.2"
goos: darwin
goarch: arm64
gomodule: "on"
- group: ":hammer_and_wrench: Binary builds"
steps:
- name: ":{{matrix.os}}: Build {{matrix.os}} {{matrix.arch}} binary"
command: .buildkite/steps/build-binary.sh {{matrix.os}} {{matrix.arch}}
key: build-binary
depends_on:
- test
plugins:
- docker#v5.9.0:
image: golang:1.21
mount-buildkite-agent: true
matrix:
setup:
os:
- darwin
- linux
- windows
arch:
- amd64
- arm64

- name: ":lambda: Build Lambda"
key: build-lambda
depends_on:
- test
command: .buildkite/steps/build-lambda.sh

- name: ":s3: Upload to S3"
Expand All @@ -58,6 +51,6 @@ steps:
- name: ":pipeline:"
key: upload-release-steps
depends_on:
- build
- build-binary
- upload-to-s3
command: .buildkite/steps/upload-release-steps.sh
13 changes: 13 additions & 0 deletions .buildkite/steps/build-binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh

set -eu

GOOS=${1:-linux}
GOARCH=${2:-amd64}

export GOOS
export GOARCH
export CGO_ENABLED=0

go build -o "buildkite-agent-metrics-${GOOS}-${GOARCH}" .
buildkite-agent artifact upload "buildkite-agent-metrics-${GOOS}-${GOARCH}"
14 changes: 8 additions & 6 deletions .buildkite/steps/build-lambda.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/bin/bash
#!/usr/bin/env sh

set -eu

docker run --rm --volume "$PWD:/code" \
--workdir "/code" \
--workdir /code \
--rm \
golang:1.20 \
sh -c "go get ./lambda && go build -o ./lambda/handler ./lambda"
--env CGO_ENABLED=0 \
golang:1.21 \
go build -tags lambda.norpc -o lambda/bootstrap ./lambda

chmod +x ./lambda/handler
chmod +x lambda/bootstrap

mkdir -p dist/
zip -j handler.zip lambda/handler
zip -j handler.zip lambda/bootstrap

buildkite-agent artifact upload handler.zip
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,63 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v5.9.3](https://github.com/buildkite/buildkite-agent-metrics/tree/v5.9.3) (2023-12-19)
[Full Changelog](https://github.com/buildkite/buildkite-agent-metrics/compare/v5.9.2...v5.9.3)

### Changed
- Add v5 to module path [#248](https://github.com/buildkite/buildkite-agent-metrics/pull/248) (@DrJosh9000)

### Dependencies
- build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 [#246](https://github.com/buildkite/buildkite-agent-metrics/pull/246) (@dependabot[bot])
- build(deps): bump cloud.google.com/go/monitoring from 1.16.3 to 1.17.0 [#245](https://github.com/buildkite/buildkite-agent-metrics/pull/245) (@dependabot[bot])
- build(deps): bump github.com/aws/aws-lambda-go from 1.41.0 to 1.42.0 [#244](https://github.com/buildkite/buildkite-agent-metrics/pull/244) (@dependabot[bot])

## [v5.9.2](https://github.com/buildkite/buildkite-agent-metrics/tree/v5.9.2) (2023-12-12)
[Full Changelog](https://github.com/buildkite/buildkite-agent-metrics/compare/v5.9.1...v5.9.2)

### Fixed
- Fix non-Secrets Manager token providers [#243](https://github.com/buildkite/buildkite-agent-metrics/pull/243) (@DrJosh9000)

### Changed
- Allow env vars to control debug logging for the lambda [#238](https://github.com/buildkite/buildkite-agent-metrics/pull/238) (@triarius)

### Dependencies
- Bump github.com/aws/aws-sdk-go from 1.48.3 to 1.48.4 to 1.48.16 [#237](https://github.com/buildkite/buildkite-agent-metrics/pull/237), [#241](https://github.com/buildkite/buildkite-agent-metrics/pull/241) (@dependabot[bot])

## [v5.9.1](https://github.com/buildkite/buildkite-agent-metrics/tree/v5.9.1) (2023-11-27)
[Full Changelog](https://github.com/buildkite/buildkite-agent-metrics/compare/v5.9.0...v5.9.1)

### Changed
- Support for multiple secrets manager secrets command seperated [#233](https://github.com/buildkite/buildkite-agent-metrics/pull/233) (@lucylura)

### Fixed
- Ignore Cluster label/dimension/tag for empty unclustered queues. This may fix continuity errors when clusters are not used [#234](https://github.com/buildkite/buildkite-agent-metrics/pull/234) (@triarius)

### Internal
- Document SSM Parameters names may be comma separated [#235](https://github.com/buildkite/buildkite-agent-metrics/pull/235) (@triarius)

### Dependencies
- build(deps): bump github.com/aws/aws-sdk-go from 1.47.3 to 1.48.3 [#232](https://github.com/buildkite/buildkite-agent-metrics/pull/232) (@dependabot[bot])

## [v5.9.0](https://github.com/buildkite/buildkite-agent-metrics/tree/v5.9.0) (2023-11-22)
[Full Changelog](https://github.com/buildkite/buildkite-agent-metrics/compare/v5.8.0...v5.9.0)

> [!WARNING]
> This release adds a new Cluster label/tag/dimension, which is populated when using agent cluster tokens. This may break continuity with existing time series!
### Added
- Collect from multiple clusters [#227](https://github.com/buildkite/buildkite-agent-metrics/pull/227) (@DrJosh9000)
- feat(gcp): add env vars for buildkite queues and gcp project id [#212](https://github.com/buildkite/buildkite-agent-metrics/pull/212) (@NotArpit)

### Fixed
- Change build process to better support `provided.al2` [#225](https://github.com/buildkite/buildkite-agent-metrics/pull/225) (@triarius)
- fix(collector): exit on 401 when queues specified [#211](https://github.com/buildkite/buildkite-agent-metrics/pull/211) (@NotArpit)
- Fix another reference to go1.x [#230](https://github.com/buildkite/buildkite-agent-metrics/pull/230) (@jradtilbrook)

### Internal
- Split Collect [#226](https://github.com/buildkite/buildkite-agent-metrics/pull/226) (@DrJosh9000)
- Various dependency updates [#206](https://github.com/buildkite/buildkite-agent-metrics/pull/206), [#208](https://github.com/buildkite/buildkite-agent-metrics/pull/208), [#213](https://github.com/buildkite/buildkite-agent-metrics/pull/213), [#215](https://github.com/buildkite/buildkite-agent-metrics/pull/215), [#216](https://github.com/buildkite/buildkite-agent-metrics/pull/216), [#217](https://github.com/buildkite/buildkite-agent-metrics/pull/217), [#218](https://github.com/buildkite/buildkite-agent-metrics/pull/218), [#219](https://github.com/buildkite/buildkite-agent-metrics/pull/219), [#220](https://github.com/buildkite/buildkite-agent-metrics/pull/220), [#221](https://github.com/buildkite/buildkite-agent-metrics/pull/221), [#222](https://github.com/buildkite/buildkite-agent-metrics/pull/222), [#223](https://github.com/buildkite/buildkite-agent-metrics/pull/223) (@dependabot[bot])

## [v5.8.0](https://github.com/buildkite/buildkite-agent-metrics/tree/v5.8.0) (2023-09-15)
[Full Changelog](https://github.com/buildkite/buildkite-agent-metrics/compare/v5.7.0...v5.8.0)

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM golang:1.20 as builder
FROM golang:1.21 as builder
WORKDIR /go/src/github.com/buildkite/buildkite-agent-metrics/
COPY . .
RUN GO111MODULE=on GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o buildkite-agent-metrics .

FROM alpine:3.17
FROM alpine:3.18
RUN apk update && apk add curl ca-certificates
COPY --from=builder /go/src/github.com/buildkite/buildkite-agent-metrics/buildkite-agent-metrics .
EXPOSE 8080 8125
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.lambda
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN yum install -y unzip wget && \
wget "https://github.com/buildkite/buildkite-agent-metrics/releases/latest/download/handler.zip" && \
unzip handler.zip && rm -f handler.zip

ENTRYPOINT ["./handler"]
ENTRYPOINT ["./bootstrap"]
Loading

0 comments on commit de043a8

Please sign in to comment.