Skip to content

Commit 4df8898

Browse files
GabriFedi97NiccoloFeimnencia
authored
ci: automate the update of OS libraries (#45)
Add automation to verify if we need to rebuild container images due to OS dependencies updates being available. This PR adds a dagger module exposing the commands to perform dependency updates checks only. A set of files will be maintained under the `system-libs` folder for each extension requiring OS deps, which will keep track of dependencies updates. The related workflow will check if any of these files change in any of the extension folders, and it will open a dedicated PR for each extension. Each extension has to explicitly set the metadata field `auto_update_os_libs = true` in the `metadata.hcl` file in order to be part of this mechanism. Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent 52ea4b5 commit 4df8898

File tree

13 files changed

+949
-1
lines changed

13 files changed

+949
-1
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Check OS Library Updates
2+
3+
on:
4+
schedule:
5+
- cron: "0 3 * * *"
6+
workflow_dispatch:
7+
8+
defaults:
9+
run:
10+
shell: 'bash -Eeuo pipefail -x {0}'
11+
12+
permissions: {}
13+
14+
jobs:
15+
fetch-extensions:
16+
name: Fetch target extensions
17+
runs-on: ubuntu-24.04
18+
outputs:
19+
extensions: ${{ steps.get-extensions.outputs.extensions }}
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
23+
with:
24+
persist-credentials: false
25+
26+
- name: Fetch extensions
27+
id: get-extensions-dagger
28+
uses: dagger/dagger-for-github@d913e70051faf3b907d4dd96ef1161083c88c644 # v8.2.0
29+
env:
30+
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
31+
DAGGER_VERSION: 0.19.7
32+
with:
33+
version: ${{ env.DAGGER_VERSION }}
34+
verb: call
35+
module: ./dagger/maintenance/
36+
args: get-oslibs-targets
37+
38+
- name: Set extensions output
39+
id: get-extensions
40+
run: |
41+
EXTENSIONS='${{ steps.get-extensions-dagger.outputs.output }}'
42+
echo "extensions=$(echo "$EXTENSIONS" | jq -c .)" >> $GITHUB_OUTPUT
43+
44+
update-extension-os-libs:
45+
name: Update OS libs for ${{ matrix.extension }}
46+
runs-on: ubuntu-24.04
47+
needs:
48+
- fetch-extensions
49+
strategy:
50+
matrix:
51+
extension: ${{ fromJson(needs.fetch-extensions.outputs.extensions) }}
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
55+
56+
- name: Log in to the GitHub Container registry
57+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
58+
with:
59+
registry: ghcr.io
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Update OS libs for ${{ matrix.extension }}
64+
uses: dagger/dagger-for-github@d913e70051faf3b907d4dd96ef1161083c88c644 # v8.2.0
65+
env:
66+
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
67+
DAGGER_VERSION: 0.19.7
68+
with:
69+
version: ${{ env.DAGGER_VERSION }}
70+
verb: call
71+
module: ./dagger/maintenance/
72+
args: update-oslibs --target ${{ matrix.extension }} export --path=.
73+
74+
- name: Diff
75+
run: |
76+
git status
77+
git diff
78+
79+
- name: Check for changes
80+
id: check-changes
81+
run: |
82+
if git diff --quiet; then
83+
echo "No changes detected for ${{ matrix.extension }}"
84+
echo "changed=false" >> $GITHUB_OUTPUT
85+
else
86+
echo "Changes detected for ${{ matrix.extension }}"
87+
echo "changed=true" >> $GITHUB_OUTPUT
88+
fi
89+
90+
- name: Create a PR if versions have been updated on main
91+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
92+
if: github.ref == 'refs/heads/main' && steps.check-changes.outputs.changed == 'true'
93+
with:
94+
token: ${{ secrets.REPO_GHA_PAT }}
95+
title: "chore: update ${{ matrix.extension }} OS libraries"
96+
body: "Updating the OS libraries of ${{ matrix.extension }}"
97+
branch: "${{ matrix.extension }}-os-libraries"
98+
author: "extension-os-libs-updater <extension-os-libs-updater@users.noreply.github.com>"
99+
add-paths: |
100+
${{ matrix.extension }}/**
101+
commit-message: "chore: update ${{ matrix.extension }} OS libraries"
102+
signoff: true

dagger/maintenance/.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/dagger.gen.go linguist-generated
2+
/internal/dagger/** linguist-generated
3+
/internal/querybuilder/** linguist-generated
4+
/internal/telemetry/** linguist-generated

dagger/maintenance/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/dagger.gen.go
2+
/internal/dagger
3+
/internal/querybuilder
4+
/internal/telemetry
5+
/.env
6+
vendor

dagger/maintenance/dagger.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "maintenance",
3+
"engineVersion": "v0.19.7",
4+
"sdk": {
5+
"source": "go"
6+
}
7+
}

dagger/maintenance/go.mod

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
module dagger/maintenance
2+
3+
go 1.25.3
4+
5+
require (
6+
github.com/docker/buildx v0.30.1
7+
github.com/hashicorp/hcl/v2 v2.24.0
8+
github.com/vektah/gqlparser/v2 v2.5.30
9+
go.opentelemetry.io/otel v1.38.0
10+
go.opentelemetry.io/otel/sdk v1.38.0
11+
go.opentelemetry.io/otel/trace v1.38.0
12+
)
13+
14+
require (
15+
github.com/99designs/gqlgen v0.17.81
16+
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
17+
github.com/Khan/genqlient v0.8.1
18+
github.com/Microsoft/go-winio v0.6.2 // indirect
19+
github.com/agext/levenshtein v1.2.3 // indirect
20+
github.com/apparentlymart/go-cidr v1.0.1 // indirect
21+
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
22+
github.com/aws/aws-sdk-go-v2 v1.38.1 // indirect
23+
github.com/aws/aws-sdk-go-v2/config v1.31.3 // indirect
24+
github.com/aws/aws-sdk-go-v2/credentials v1.18.7 // indirect
25+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.4 // indirect
26+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.4 // indirect
27+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4 // indirect
28+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
29+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 // indirect
30+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.4 // indirect
31+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.2 // indirect
32+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.0 // indirect
33+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.0 // indirect
34+
github.com/aws/smithy-go v1.22.5 // indirect
35+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
36+
github.com/compose-spec/compose-go/v2 v2.9.1 // indirect
37+
github.com/containerd/console v1.0.5 // indirect
38+
github.com/containerd/containerd/api v1.10.0 // indirect
39+
github.com/containerd/containerd/v2 v2.2.1-0.20251115011841-efd86f2b0bc2 // indirect
40+
github.com/containerd/continuity v0.4.5 // indirect
41+
github.com/containerd/errdefs v1.0.0 // indirect
42+
github.com/containerd/errdefs/pkg v0.3.0 // indirect
43+
github.com/containerd/log v0.1.0 // indirect
44+
github.com/containerd/platforms v1.0.0-rc.2 // indirect
45+
github.com/containerd/ttrpc v1.2.7 // indirect
46+
github.com/containerd/typeurl/v2 v2.2.3 // indirect
47+
github.com/distribution/reference v0.6.0 // indirect
48+
github.com/docker/cli v28.5.1+incompatible // indirect
49+
github.com/docker/docker v28.5.1+incompatible // indirect
50+
github.com/docker/docker-credential-helpers v0.9.3 // indirect
51+
github.com/docker/go v1.5.1-1 // indirect
52+
github.com/docker/go-connections v0.5.0 // indirect
53+
github.com/docker/go-units v0.5.0 // indirect
54+
github.com/felixge/httpsnoop v1.0.4 // indirect
55+
github.com/fvbommel/sortorder v1.0.1 // indirect
56+
github.com/go-logr/logr v1.4.3 // indirect
57+
github.com/go-logr/stdr v1.2.2 // indirect
58+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
59+
github.com/gofrs/flock v0.13.0 // indirect
60+
github.com/gogo/protobuf v1.3.2 // indirect
61+
github.com/golang/protobuf v1.5.4 // indirect
62+
github.com/google/go-cmp v0.7.0 // indirect
63+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
64+
github.com/google/uuid v1.6.0 // indirect
65+
github.com/gorilla/mux v1.8.1 // indirect
66+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
67+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
68+
github.com/hashicorp/go-cty-funcs v0.0.0-20250818135842-6aab67130928 // indirect
69+
github.com/in-toto/in-toto-golang v0.9.0 // indirect
70+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
71+
github.com/klauspost/compress v1.18.1 // indirect
72+
github.com/mattn/go-runewidth v0.0.16 // indirect
73+
github.com/mattn/go-shellwords v1.0.12 // indirect
74+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
75+
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
76+
github.com/moby/buildkit v0.26.1 // indirect
77+
github.com/moby/docker-image-spec v1.3.1 // indirect
78+
github.com/moby/locker v1.0.1 // indirect
79+
github.com/moby/patternmatcher v0.6.0 // indirect
80+
github.com/moby/sys/atomicwriter v0.1.0 // indirect
81+
github.com/moby/sys/mountinfo v0.7.2 // indirect
82+
github.com/moby/sys/sequential v0.6.0 // indirect
83+
github.com/moby/sys/signal v0.7.1 // indirect
84+
github.com/moby/term v0.5.2 // indirect
85+
github.com/morikuni/aec v1.0.0 // indirect
86+
github.com/opencontainers/go-digest v1.0.0 // indirect
87+
github.com/opencontainers/image-spec v1.1.1 // indirect
88+
github.com/pelletier/go-toml v1.9.5 // indirect
89+
github.com/pkg/errors v0.9.1 // indirect
90+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
91+
github.com/rivo/uniseg v0.2.0 // indirect
92+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
93+
github.com/secure-systems-lab/go-securesystemslib v0.9.1 // indirect
94+
github.com/shibumi/go-pathspec v1.3.0 // indirect
95+
github.com/sirupsen/logrus v1.9.3 // indirect
96+
github.com/sosodev/duration v1.3.1 // indirect
97+
github.com/spf13/cobra v1.10.1 // indirect
98+
github.com/spf13/pflag v1.0.10 // indirect
99+
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect
100+
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect
101+
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
102+
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
103+
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
104+
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
105+
github.com/zclconf/go-cty v1.17.0 // indirect
106+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
107+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
108+
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.61.0 // indirect
109+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
110+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0
111+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.14.0
112+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0
113+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.38.0
114+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
115+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0
116+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0
117+
go.opentelemetry.io/otel/log v0.14.0
118+
go.opentelemetry.io/otel/metric v1.38.0
119+
go.opentelemetry.io/otel/sdk/log v0.14.0
120+
go.opentelemetry.io/otel/sdk/metric v1.38.0
121+
go.opentelemetry.io/proto/otlp v1.8.0
122+
go.yaml.in/yaml/v3 v3.0.4 // indirect
123+
golang.org/x/crypto v0.42.0 // indirect
124+
golang.org/x/mod v0.29.0 // indirect
125+
golang.org/x/net v0.44.0 // indirect
126+
golang.org/x/sync v0.17.0
127+
golang.org/x/sys v0.37.0 // indirect
128+
golang.org/x/text v0.29.0 // indirect
129+
golang.org/x/time v0.14.0 // indirect
130+
golang.org/x/tools v0.37.0 // indirect
131+
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect
132+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
133+
google.golang.org/grpc v1.76.0
134+
google.golang.org/protobuf v1.36.10 // indirect
135+
)
136+
137+
replace go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc => go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0
138+
139+
replace go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp => go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.14.0
140+
141+
replace go.opentelemetry.io/otel/log => go.opentelemetry.io/otel/log v0.14.0
142+
143+
replace go.opentelemetry.io/otel/sdk/log => go.opentelemetry.io/otel/sdk/log v0.14.0

0 commit comments

Comments
 (0)