Skip to content

Commit

Permalink
Merge branch 'grafana:main' into add-blackbox-example
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlemieux authored Jan 28, 2025
2 parents 62c564a + e621c94 commit 7876533
Show file tree
Hide file tree
Showing 287 changed files with 36,514 additions and 38,077 deletions.
173 changes: 40 additions & 133 deletions .drone/drone.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .drone/pipelines/build_images.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local locals = {
'docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD',
'docker run --rm --privileged multiarch/qemu-user-static --reset -p yes',
'docker buildx create --name multiarch --driver docker-container --use',
'docker buildx build --build-arg="GO_RUNTIME=golang:1.23.3-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image',
'docker buildx build --build-arg="GO_RUNTIME=golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image',
],
}],
volumes: [{
Expand All @@ -55,7 +55,7 @@ local locals = {
'docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD',
'docker run --rm --privileged multiarch/qemu-user-static --reset -p yes',
'docker buildx create --name multiarch --driver docker-container --use',
'docker buildx build --build-arg="GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.3-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image',
'docker buildx build --build-arg="GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image',
],
}],
volumes: [{
Expand Down
2 changes: 1 addition & 1 deletion .drone/pipelines/publish.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ linux_containers_jobs + windows_containers_jobs + [
"repo_name": "deployment_tools",
"update_jsonnet_attribute_configs": [
{
"file_path": "ksonnet/environments/grafana-agent/waves/alloy.libsonnet",
"file_path": "ksonnet/lib/alloy/waves/alloy.libsonnet",
"jsonnet_key": "dev_canary",
"jsonnet_value_file": ".image-tag"
}
Expand Down
128 changes: 128 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Build
on:
pull_request:
concurrency:
# Cancel any running workflow for the same branch when new commits are pushed.
# We group both by ref_name (available when CI is triggered by a push to a branch/tag)
# and head_ref (available when CI is triggered by a PR).
group: "${{ github.ref_name }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
build_linux:
name: Build on Linux
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
strategy:
matrix:
os: [linux]
arch: [amd64, arm64, ppc64le, s390x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= make alloy

build_linux_boringcrypto:
name: Build on Linux (boringcrypto)
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8-boringcrypto
strategy:
matrix:
os: [linux]
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= GOEXPERIMENT=boringcrypto make alloy

build_mac_intel:
name: Build on MacOS (Intel)
runs-on: macos-14-large
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=amd64 GOARM= make alloy

build_mac_arm:
name: Build on MacOS (ARM)
runs-on: macos-14-xlarge
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=arm64 GOARM= make alloy

build_windows:
name: Build on Windows (AMD64)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: echo "GO_TAGS=builtinassets" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GOOS=windows" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GOARCH=amd64" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: make alloy

build_freebsd:
name: Build on FreeBSD (AMD64)
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=freebsd GOARCH=amd64 GOARM= make alloy
4 changes: 2 additions & 2 deletions .github/workflows/check-linux-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
push: false
tags: grafana/alloy-build-image:latest
build-args: |
GO_RUNTIME=golang:1.23.3-bullseye
GO_RUNTIME=golang:1.23.5-bullseye
- name: Create test Linux build image for boring crypto
uses: docker/build-push-action@v6
Expand All @@ -42,4 +42,4 @@ jobs:
push: false
tags: grafana/alloy-build-image:latest
build-args: |
GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.3-bullseye
GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.5-bullseye
66 changes: 66 additions & 0 deletions .github/workflows/create_build_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Create build images
on:
push:
tags:
- build-image/v*

permissions:
contents: read
id-token: write

jobs:
linux_build_image:
name: Create a Linux build image
runs-on:
labels: github-hosted-ubuntu-x64-small
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Get version from Git tag
env:
FULL_TAG: ${{ github.ref_name }}
id: get_image_version
run: echo "image_tag=${FULL_TAG##*/}" >> $GITHUB_OUTPUT

- name: Login to DockerHub (from vault)
uses: grafana/shared-workflows/actions/[email protected]

- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multiarch --driver docker-container --use
docker buildx build --build-arg="GO_RUNTIME=golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:${{ steps.get_image_version.outputs.image_tag }} ./tools/build-image
linux_build_image_boringcrypto:
name: Create a Linux build image for boringcrypto
runs-on:
labels: github-hosted-ubuntu-x64-small
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Get version from Git tag
env:
FULL_TAG: ${{ github.ref_name }}
id: get_image_version
run: echo "image_tag=${FULL_TAG##*/}-boringcrypto" >> $GITHUB_OUTPUT

- name: Login to DockerHub (from vault)
uses: grafana/shared-workflows/actions/[email protected]

- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multiarch --driver docker-container --use
docker buildx build --build-arg="GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:${{ steps.get_image_version.outputs.image_tag }} ./tools/build-image
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
deploy-pr-preview:
if: github.repository == 'grafana/alloy'
if: ${{ ! github.event.pull_request.head.repo.fork }}
uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@main
with:
sha: ${{ github.event.pull_request.head.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
path: source

- name: Install chart-testing
uses: helm/chart-testing-action@v2.6.1
uses: helm/chart-testing-action@v2.7.0

- name: List changed charts
id: list-changed
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/helm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
check-latest: true

- name: Install chart-testing
uses: helm/chart-testing-action@v2.6.1
uses: helm/chart-testing-action@v2.7.0

- name: Determine changed charts
id: list-changed
Expand All @@ -71,7 +71,7 @@ jobs:
run: ct lint --config ./operations/helm/ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.11.0
uses: helm/kind-action@v1.12.0
if: steps.list-changed.outputs.changed == 'true'

- name: Add dependency chart repos
Expand Down
Loading

0 comments on commit 7876533

Please sign in to comment.