From 58db7480f66963880ab4ccd654a13fce835e8367 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:02:32 +0100 Subject: [PATCH] chore: add ROCK for grafana-agent v0.39.0 (#35) * chore(deps): bump grafana-agent version to v0.39.0 * add arm64 to all other rock versions --------- Co-authored-by: Github Actions Co-authored-by: Luca Bello --- 0.37.4/rockcraft.yaml | 1 + 0.38.0/rockcraft.yaml | 1 + 0.38.1/rockcraft.yaml | 1 + 0.39.0/agent.yaml | 17 +++++++++++++++ 0.39.0/rockcraft.yaml | 50 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 0.39.0/agent.yaml create mode 100644 0.39.0/rockcraft.yaml diff --git a/0.37.4/rockcraft.yaml b/0.37.4/rockcraft.yaml index c040ee1..99ed512 100644 --- a/0.37.4/rockcraft.yaml +++ b/0.37.4/rockcraft.yaml @@ -7,6 +7,7 @@ build-base: ubuntu@22.04 license: Apache-2.0 platforms: amd64: + arm64: services: agent: command: /usr/bin/grafana-agent --config.file=/etc/agent/agent.yaml --metrics.wal-directory=/etc/agent/data diff --git a/0.38.0/rockcraft.yaml b/0.38.0/rockcraft.yaml index d66ff51..ff62bf6 100644 --- a/0.38.0/rockcraft.yaml +++ b/0.38.0/rockcraft.yaml @@ -7,6 +7,7 @@ build-base: ubuntu@22.04 license: Apache-2.0 platforms: amd64: + arm64: services: agent: command: /usr/bin/grafana-agent --config.file=/etc/agent/agent.yaml --metrics.wal-directory=/etc/agent/data diff --git a/0.38.1/rockcraft.yaml b/0.38.1/rockcraft.yaml index a9f63a6..70f630b 100644 --- a/0.38.1/rockcraft.yaml +++ b/0.38.1/rockcraft.yaml @@ -7,6 +7,7 @@ build-base: ubuntu@22.04 license: Apache-2.0 platforms: amd64: + arm64: services: agent: command: /usr/bin/grafana-agent --config.file=/etc/agent/agent.yaml --metrics.wal-directory=/etc/agent/data diff --git a/0.39.0/agent.yaml b/0.39.0/agent.yaml new file mode 100644 index 0000000..dfd9cb1 --- /dev/null +++ b/0.39.0/agent.yaml @@ -0,0 +1,17 @@ +server: + log_level: info + +metrics: + global: + scrape_interval: 1m + configs: + - name: test + host_filter: false + scrape_configs: + - job_name: local_scrape + static_configs: + - targets: ['127.0.0.1:12345'] + labels: + cluster: 'localhost' + remote_write: + - url: http://localhost:9009/api/prom/push diff --git a/0.39.0/rockcraft.yaml b/0.39.0/rockcraft.yaml new file mode 100644 index 0000000..7e16343 --- /dev/null +++ b/0.39.0/rockcraft.yaml @@ -0,0 +1,50 @@ +name: grafana-agent +summary: Grafana Agent in a ROCK. +description: "Grafana Agent is a single binary collector for metrics and logging, useful for per-node metrics or proxying from edge endpoints." +version: "0.39.0" +base: ubuntu@22.04 +build-base: ubuntu@22.04 +license: Apache-2.0 +platforms: + amd64: + arm64: +services: + agent: + command: /usr/bin/grafana-agent --config.file=/etc/agent/agent.yaml --metrics.wal-directory=/etc/agent/data + override: replace + startup: enabled +parts: + grafana-agent: + plugin: go + source: https://github.com/grafana/agent + source-type: git + source-tag: "v0.39.0" + build-snaps: + - go/1.21/stable + build-environment: + - USE_CONTAINER: 0 + - RELEASE_BUILD: 1 + stage-packages: + - ca-certificates + override-build: | + make agent + install -D -m755 build/grafana-agent ${CRAFT_PART_INSTALL}/opt/agent/bin/grafana-agent + ln -sv /bin/grafana-agent ${CRAFT_PART_INSTALL}/opt/agent/bin/agent + organize: + opt/agent/bin/grafana-agent: usr/bin/grafana-agent + opt/agent/bin/agent: usr/bin/agent + default-config: + plugin: dump + source: . + organize: + agent.yaml: etc/agent/agent.yaml + stage: + - etc/agent/agent.yaml + deb-security-manifest: + plugin: nil + after: + - grafana-agent + override-prime: | + set -x + mkdir -p $CRAFT_PRIME/usr/share/rocks/ + (echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query --admindir=$CRAFT_PRIME/var/lib/dpkg/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > $CRAFT_PRIME/usr/share/rocks/dpkg.query