Skip to content

Commit feca2ae

Browse files
feat(shared/statsd-exporter): Bump to 0.30.0 (#1524)
* chore(shared/statsd-exporter): Initialize patchable ```sh cargo patchable init product shared/statsd-exporter --upstream https://github.com/prometheus/statsd_exporter.git --default-mirror https://github.com/stackabletech/statsd_exporter.git cargo patchable init version "shared/statsd-exporter" "0.28.0" --base="v0.28.0" --mirror ``` * chore(shared/statsd-exporter): Build from explicit golang version This is part of a series of changes so I can step through each and validate the small change. * chore(shared/statsd-exporter): Build in the stackable-devel image I used opa for inspiration. * feat(shared/statsd-exporter): Build from source using Patchable * chore: Remove unused script * feat(shared/statsd-exporter): Bump to 0.30.0 * chore: Add/update hadolint configs Docker wouldn't build these images until I made these changes. * Apply suggestions from code review Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech> --------- Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
1 parent 1150cac commit feca2ae

11 files changed

Lines changed: 81 additions & 78 deletions

File tree

.scripts/upload_new_statsd_exporter_version.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ All notable changes to this project will be documented in this file.
1919

2020
### Changed
2121

22-
- airflow: Bump statsd_exporter to `0.29.0` ([#1522]).
22+
- airflow: Bump statsd_exporter to `0.30.0` ([#1524]).
2323
- ci: Bump `docker/login-action` from `v3.6.0` to `v4.1.0` and `stackabletech/actions` to `v0.14.3` to escape Node.js 20 deprecation ([#1507]).
2424
- hbase: Update `hbase-opa-authorizer` from `0.1.0` to `0.2.0` and then `0.3.0` ([#1446], [#1454]).
2525
- stackable-base: Bump `containerdebug` to `0.4.0` and `config-utils` to `0.4.0` ([#1521]).
26-
- statsd_exporter: Bump version from `0.28.0` to `0.29.0` ([#1522]).
27-
- superset: Bump statsd_exporter to `0.29.0` ([#1522]).
26+
- statsd_exporter: Bump version from `0.28.0` to `0.30.0` ([#1524]).
27+
This uses a git mirror and patchable instead of sourcing from Nexus.
28+
- superset: Bump statsd_exporter to `0.30.0` ([#1524]).
2829

2930
### Fixed
3031

@@ -61,6 +62,7 @@ All notable changes to this project will be documented in this file.
6162
[#1518]: https://github.com/stackabletech/docker-images/pull/1518
6263
[#1520]: https://github.com/stackabletech/docker-images/pull/1520
6364
[#1521]: https://github.com/stackabletech/docker-images/pull/1521
65+
[#1524]: https://github.com/stackabletech/docker-images/pull/1524
6466

6567
## [26.3.0] - 2026-03-16
6668

airflow/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
2+
# check=error=true;skip=InvalidDefaultArgInFrom,SecretsUsedInArgOrEnv
23
# Disabled error checks:
34
# - SecretsUsedInArgOrEnv : OPA_AUTH_MANAGER is a false positive and breaks the build.
4-
# check=error=true;skip=InvalidDefaultArgInFrom,SecretsUsedInArgOrEnv
55

66
ARG GIT_SYNC_VERSION
77

airflow/boil-config.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Deprecated since SDP 25.11
55
[versions."2.9.3".local-images]
6-
"shared/statsd-exporter" = "0.29.0"
6+
"shared/statsd-exporter" = "0.30.0"
77
vector = "0.55.0"
88
stackable-devel = "1.0.0"
99

@@ -20,7 +20,7 @@ nodejs-version = "20"
2020

2121
# LTS
2222
[versions."3.0.6".local-images]
23-
"shared/statsd-exporter" = "0.29.0"
23+
"shared/statsd-exporter" = "0.30.0"
2424
vector = "0.55.0"
2525
stackable-devel = "1.0.0"
2626

@@ -56,7 +56,7 @@ nodejs-version = "20"
5656

5757
# Supported
5858
[versions."3.1.6".local-images]
59-
"shared/statsd-exporter" = "0.29.0"
59+
"shared/statsd-exporter" = "0.30.0"
6060
vector = "0.55.0"
6161
stackable-devel = "1.0.0"
6262

opa/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
2+
# check=error=true;skip=InvalidDefaultArgInFrom
13

24
ARG GOLANG_VERSION
3-
45
FROM oci.stackable.tech/sdp/library/golang:${GOLANG_VERSION} AS golang-image
56

67
FROM local-image/stackable-devel AS multilog-builder

shared/statsd-exporter/Dockerfile

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,65 @@
11
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
2-
# check=error=true
2+
# check=error=true;skip=InvalidDefaultArgInFrom
3+
4+
ARG GOLANG_VERSION
5+
FROM oci.stackable.tech/sdp/library/golang:${GOLANG_VERSION} AS golang-image
6+
7+
FROM local-image/stackable-devel AS statsd-exporter-builder
38

4-
FROM local-image/stackable-base
59
ARG PRODUCT_VERSION
10+
ARG CYCLONEDX_GOMOD_VERSION
611
ARG STACKABLE_USER_UID
12+
ARG TARGETARCH
13+
ARG TARGETOS
14+
15+
ENV CYCLONEDX_GOMOD_VERSION=$CYCLONEDX_GOMOD_VERSION
16+
ENV GOARCH=$TARGETARCH
17+
ENV GOOS=$TARGETOS
718

819
WORKDIR /statsd_exporter
920

10-
RUN --mount=type=cache,id=go-statsd-exporter,uid=${STACKABLE_USER_UID},target=/go_cache <<EOF
21+
RUN <<EOF
1122
microdnf update
1223

1324
# Tar and gzip are used to unpack the statsd_exporter source
14-
# Golang is used to build statsd_exporter
1525
# Git is needed by the cyclonedx-gomod tool to determine the version of statsd_exporter
1626
microdnf install \
1727
tar \
1828
gzip \
19-
git \
20-
golang
29+
git
2130

2231
microdnf clean all
2332
rm -rf /var/cache/yum
33+
EOF
2434

35+
# Manually install Go since the dnf package is sometimes not recent enough
36+
COPY --from=golang-image /usr/local/go/ /usr/local/go/
37+
ENV PATH="/usr/local/go/bin:${PATH}"
38+
39+
COPY --chown=${STACKABLE_USER_UID}:0 shared/statsd-exporter/stackable/patches/patchable.toml /statsd_exporter/src/shared/statsd-exporter/stackable/patches/patchable.toml
40+
COPY --chown=${STACKABLE_USER_UID}:0 shared/statsd-exporter/stackable/patches/${PRODUCT_VERSION} /statsd_exporter/src/shared/statsd-exporter/stackable/patches/${PRODUCT_VERSION}
41+
42+
RUN --mount=type=cache,id=go-statsd-exporter,uid=${STACKABLE_USER_UID},target=/go_cache <<EOF
2543
export GOPATH=/go_cache
26-
# We use version 1.7.0, since a newer version of cyclonedx-gomod is not compatible with the version of Golang (>= 1.23.1)
27-
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.7.0
44+
go install "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v${CYCLONEDX_GOMOD_VERSION}"
2845

29-
curl "https://repo.stackable.tech/repository/packages/statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.src.tar.gz" | tar -xzC .
3046
(
31-
cd "statsd_exporter-${PRODUCT_VERSION}" || exit
47+
cd "$(/stackable/patchable --images-repo-root=src checkout shared/statsd-exporter ${PRODUCT_VERSION})"
48+
49+
# Create snapshot of the source code including custom patches
50+
tar -czf /statsd_exporter/statsd-exporter-${PRODUCT_VERSION}-src.tar.gz .
3251

3352
# Unfortunately, we need to create a dummy Git repository to allow cyclonedx-gomod to determine the version of statsd_exporter
53+
rm .git
3454
git init
3555
git config user.email "fake.commiter@stackable.tech"
3656
git config user.name "Fake commiter"
3757
git commit --allow-empty --message "Fake commit, so that we can create a tag"
3858
git tag "v${PRODUCT_VERSION}"
39-
go build -o ../statsd_exporter
40-
$GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output ../statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files
59+
go build -o /statsd_exporter/statsd_exporter
60+
$GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output /statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files
4161
)
4262
rm -rf "statsd_exporter-${PRODUCT_VERSION}"
63+
# set correct groups
64+
chmod -R g=u /statsd_exporter/
4365
EOF

shared/statsd-exporter/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,21 @@ This is the Docker image that builds statsd_exporter.
55
This image does _not_ need to be built manually.
66
It will be built automatically if specified as a dependency in our `boil-config.toml` file.
77
Which will then be transformed to a dependency in a Docker `buildx bake` file.
8+
9+
## Updating
10+
11+
This image uses patchable for applying patch sets before building from source.
12+
Our mirror can be found here:
13+
14+
To update:
15+
16+
> [!CAUTION]
17+
> Check the changes since the last version, eg:
18+
> <https://github.com/prometheus/statsd_exporter/compare/v0.29.0...v0.30.0>
19+
20+
```shell
21+
STATSD_VERSION=0.29.0
22+
cargo patchable init version "shared/statsd-exporter" "$STATSD_VERSION" --base="v$STATSD_VERSION" --mirror
23+
```
24+
25+
Apply any necessary patches (see previous version's patch set).
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
[metadata]
22
"oci.stackable.tech" = { namespace = "sdp" }
33

4-
[versions."0.29.0".local-images]
5-
stackable-base = "1.0.0"
4+
[versions."0.30.0".build-arguments]
5+
# Find this in https://github.com/prometheus/statsd_exporter/blob/v0.30.0/go.mod
6+
# You can find the latest patch version at: https://go.dev/doc/devel/release
7+
# Mirror golang (no `v` prefix) via https://github.com/stackabletech/docker-images/actions/workflows/mirror.yaml
8+
# Note: currently mirrored to the `sdp` project, but should probably move elsewhere.
9+
golang-version = "1.25.11"
10+
# We use version 1.7.0, since a newer version of cyclonedx-gomod is not compatible with the version of Golang (>= 1.23.1)
11+
cyclonedx-gomod-version = "1.7.0"
12+
13+
[versions."0.30.0".local-images]
14+
stackable-devel = "1.0.0"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mirror = "https://github.com/stackabletech/statsd_exporter.git"
2+
base = "4a7feb4d0ec9f1061b9e2f548810dd6efc6a294a"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
upstream = "https://github.com/prometheus/statsd_exporter.git"
2+
default-mirror = "https://github.com/stackabletech/statsd_exporter.git"

0 commit comments

Comments
 (0)