Skip to content
Merged
53 changes: 0 additions & 53 deletions .scripts/upload_new_statsd_exporter_version.sh

This file was deleted.

8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ All notable changes to this project will be documented in this file.

### Changed

- airflow: Bump statsd_exporter to `0.29.0` ([#1522]).
- airflow: Bump statsd_exporter to `0.30.0` ([#1524]).
- 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]).
- hbase: Update `hbase-opa-authorizer` from `0.1.0` to `0.2.0` and then `0.3.0` ([#1446], [#1454]).
- stackable-base: Bump `containerdebug` to `0.4.0` and `config-utils` to `0.4.0` ([#1521]).
- statsd_exporter: Bump version from `0.28.0` to `0.29.0` ([#1522]).
- superset: Bump statsd_exporter to `0.29.0` ([#1522]).
- statsd_exporter: Bump version from `0.28.0` to `0.30.0` ([#1524]).
This uses a git mirror and patchable instead of sourcing from Nexus.
- superset: Bump statsd_exporter to `0.30.0` ([#1524]).

### Fixed

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

## [26.3.0] - 2026-03-16

Expand Down
2 changes: 1 addition & 1 deletion airflow/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
# check=error=true;skip=InvalidDefaultArgInFrom,SecretsUsedInArgOrEnv
# Disabled error checks:
# - SecretsUsedInArgOrEnv : OPA_AUTH_MANAGER is a false positive and breaks the build.
# check=error=true;skip=InvalidDefaultArgInFrom,SecretsUsedInArgOrEnv

ARG GIT_SYNC_VERSION

Expand Down
6 changes: 3 additions & 3 deletions airflow/boil-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Deprecated since SDP 25.11
[versions."2.9.3".local-images]
"shared/statsd-exporter" = "0.29.0"
"shared/statsd-exporter" = "0.30.0"
vector = "0.55.0"
stackable-devel = "1.0.0"

Expand All @@ -20,7 +20,7 @@ nodejs-version = "20"

# LTS
[versions."3.0.6".local-images]
"shared/statsd-exporter" = "0.29.0"
"shared/statsd-exporter" = "0.30.0"
vector = "0.55.0"
stackable-devel = "1.0.0"

Expand Down Expand Up @@ -56,7 +56,7 @@ nodejs-version = "20"

# Supported
[versions."3.1.6".local-images]
"shared/statsd-exporter" = "0.29.0"
"shared/statsd-exporter" = "0.30.0"
vector = "0.55.0"
stackable-devel = "1.0.0"

Expand Down
3 changes: 2 additions & 1 deletion opa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
# check=error=true;skip=InvalidDefaultArgInFrom

ARG GOLANG_VERSION

FROM oci.stackable.tech/sdp/library/golang:${GOLANG_VERSION} AS golang-image

FROM local-image/stackable-devel AS multilog-builder
Expand Down
46 changes: 34 additions & 12 deletions shared/statsd-exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,65 @@
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
# check=error=true
# check=error=true;skip=InvalidDefaultArgInFrom

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

FROM local-image/stackable-devel AS statsd-exporter-builder

FROM local-image/stackable-base
ARG PRODUCT_VERSION
ARG CYCLONEDX_GOMOD_VERSION
ARG STACKABLE_USER_UID
ARG TARGETARCH
ARG TARGETOS

ENV CYCLONEDX_GOMOD_VERSION=$CYCLONEDX_GOMOD_VERSION
ENV GOARCH=$TARGETARCH
ENV GOOS=$TARGETOS

WORKDIR /statsd_exporter

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

# Tar and gzip are used to unpack the statsd_exporter source
# Golang is used to build statsd_exporter
# Git is needed by the cyclonedx-gomod tool to determine the version of statsd_exporter
microdnf install \
tar \
gzip \
git \
golang
git

microdnf clean all
rm -rf /var/cache/yum
EOF

# Manually install Go since the dnf package is sometimes not recent enough
COPY --from=golang-image /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"

COPY --chown=${STACKABLE_USER_UID}:0 shared/statsd-exporter/stackable/patches/patchable.toml /statsd_exporter/src/shared/statsd-exporter/stackable/patches/patchable.toml
COPY --chown=${STACKABLE_USER_UID}:0 shared/statsd-exporter/stackable/patches/${PRODUCT_VERSION} /statsd_exporter/src/shared/statsd-exporter/stackable/patches/${PRODUCT_VERSION}

RUN --mount=type=cache,id=go-statsd-exporter,uid=${STACKABLE_USER_UID},target=/go_cache <<EOF
export GOPATH=/go_cache
# We use version 1.7.0, since a newer version of cyclonedx-gomod is not compatible with the version of Golang (>= 1.23.1)
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.7.0
go install "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v${CYCLONEDX_GOMOD_VERSION}"

curl "https://repo.stackable.tech/repository/packages/statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.src.tar.gz" | tar -xzC .
(
cd "statsd_exporter-${PRODUCT_VERSION}" || exit
cd "$(/stackable/patchable --images-repo-root=src checkout shared/statsd-exporter ${PRODUCT_VERSION})"

# Create snapshot of the source code including custom patches
tar -czf /statsd_exporter/statsd-exporter-${PRODUCT_VERSION}-src.tar.gz .

# Unfortunately, we need to create a dummy Git repository to allow cyclonedx-gomod to determine the version of statsd_exporter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this? Or can we use the tag/commit/ whatever we are on that is generated by patchable?
Especially important as soon as we actually start patching stuff

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't quite understand. This tar happens after the patchable checkout (so after any would-be patches are applied).

Did you mean something else?

FWIW, I kept the same order as OPA:

cd "$(/stackable/patchable --images-repo-root=src checkout opa ${PRODUCT_VERSION})"
ORIGINAL_VERSION=${PRODUCT_VERSION}
NEW_VERSION="${PRODUCT_VERSION}-stackable${RELEASE_VERSION}"
sed -i 's/var Version = "'${ORIGINAL_VERSION}'"/var Version = "'${NEW_VERSION}'"/g' v1/version/version.go
# Create snapshot of the source code including custom patches
tar -czf /stackable/opa-${NEW_VERSION}-src.tar.gz .

I just removed the SDP version bits of code in between (since this is an intermediary dependency, and I'm not sure we want to have another place to remember to update SDP versions (ie: the boil config for statsd).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to

Unfortunately, we need to create a dummy Git repository to allow cyclonedx-gomod to determine the version of statsd_exporter

That was back in the day where we downloaded and extracted a .tar.gz. But now we actually have a git repo (don't we?), so we should be able to remove this "let's init a dummy git repo" workaround.
Didn't test it though

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test it, since opa does the same thing (it probably needs its thing removed too then).

IMO, this is ready to go, and that improvement can be done across the board. I'm happy to raise it straight after.

What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, happy to merge if you promise to have a look ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the naiive way, to no avail.

diff --git i/shared/statsd-exporter/Dockerfile w/shared/statsd-exporter/Dockerfile
index 5b0210b..66da2b8 100644
--- i/shared/statsd-exporter/Dockerfile
+++ w/shared/statsd-exporter/Dockerfile
@@ -49,13 +49,6 @@ go install "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v${CYCLONED
   # Create snapshot of the source code including custom patches
   tar -czf /statsd_exporter/statsd-exporter-${PRODUCT_VERSION}-src.tar.gz .
 
-  # Unfortunately, we need to create a dummy Git repository to allow cyclonedx-gomod to determine the version of statsd_exporter
-  rm .git
-  git init
-  git config user.email "fake.commiter@stackable.tech"
-  git config user.name "Fake commiter"
-  git commit --allow-empty --message "Fake commit, so that we can create a tag"
-  git tag "v${PRODUCT_VERSION}"
   go build -o /statsd_exporter/statsd_exporter
   $GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output /statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files
 )
14.46 2:00PM ERR error="failed to determine version of main module: reference not found"

Maybe we still need a tag, which then needs all that extra git stuff. Not sure it's worth it right now :/

rm .git
git init
git config user.email "fake.commiter@stackable.tech"
git config user.name "Fake commiter"
git commit --allow-empty --message "Fake commit, so that we can create a tag"
git tag "v${PRODUCT_VERSION}"
go build -o ../statsd_exporter
$GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output ../statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files
go build -o /statsd_exporter/statsd_exporter
$GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output /statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files
)
rm -rf "statsd_exporter-${PRODUCT_VERSION}"
# set correct groups
chmod -R g=u /statsd_exporter/
EOF
18 changes: 18 additions & 0 deletions shared/statsd-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,21 @@ This is the Docker image that builds statsd_exporter.
This image does _not_ need to be built manually.
It will be built automatically if specified as a dependency in our `boil-config.toml` file.
Which will then be transformed to a dependency in a Docker `buildx bake` file.

## Updating

This image uses patchable for applying patch sets before building from source.
Our mirror can be found here:

To update:

> [!CAUTION]
> Check the changes since the last version, eg:
> <https://github.com/prometheus/statsd_exporter/compare/v0.29.0...v0.30.0>

```shell
STATSD_VERSION=0.29.0
cargo patchable init version "shared/statsd-exporter" "$STATSD_VERSION" --base="v$STATSD_VERSION" --mirror
```

Apply any necessary patches (see previous version's patch set).
13 changes: 11 additions & 2 deletions shared/statsd-exporter/boil-config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
[metadata]
"oci.stackable.tech" = { namespace = "sdp" }

[versions."0.29.0".local-images]
stackable-base = "1.0.0"
[versions."0.30.0".build-arguments]
# Find this in https://github.com/prometheus/statsd_exporter/blob/v0.30.0/go.mod
# You can find the latest patch version at: https://go.dev/doc/devel/release
# Mirror golang (no `v` prefix) via https://github.com/stackabletech/docker-images/actions/workflows/mirror.yaml
# Note: currently mirrored to the `sdp` project, but should probably move elsewhere.
golang-version = "1.25.11"
# We use version 1.7.0, since a newer version of cyclonedx-gomod is not compatible with the version of Golang (>= 1.23.1)
cyclonedx-gomod-version = "1.7.0"

[versions."0.30.0".local-images]
stackable-devel = "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mirror = "https://github.com/stackabletech/statsd_exporter.git"
base = "4a7feb4d0ec9f1061b9e2f548810dd6efc6a294a"
2 changes: 2 additions & 0 deletions shared/statsd-exporter/stackable/patches/patchable.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
upstream = "https://github.com/prometheus/statsd_exporter.git"
default-mirror = "https://github.com/stackabletech/statsd_exporter.git"
6 changes: 3 additions & 3 deletions superset/boil-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"oci.stackable.tech" = { namespace = "sdp" }

[versions."4.1.4".local-images]
"shared/statsd-exporter" = "0.29.0"
"shared/statsd-exporter" = "0.30.0"
stackable-devel = "1.0.0"
vector = "0.55.0"

Expand All @@ -22,7 +22,7 @@ nodejs-version = "18.20.1"
nvm-version = "v0.40.4"

[versions."6.0.0".local-images]
"shared/statsd-exporter" = "0.29.0"
"shared/statsd-exporter" = "0.30.0"
stackable-devel = "1.0.0"
vector = "0.55.0"

Expand All @@ -41,7 +41,7 @@ nodejs-version = "20.18.3"
nvm-version = "v0.40.4"

[versions."6.1.0".local-images]
"shared/statsd-exporter" = "0.28.0"
"shared/statsd-exporter" = "0.30.0"
stackable-devel = "1.0.0"
vector = "0.55.0"

Expand Down