Skip to content

Commit 0436fd5

Browse files
committed
Merge branch 'main' into feat/add-pg_vim-extension
Signed-off-by: Husn E Rabbi <shussan@gmail.com>
2 parents 0d14730 + 0505da2 commit 0436fd5

25 files changed

+698
-63
lines changed

.github/workflows/bake.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- pgvector
1313
- postgis
1414
- pgaudit
15+
- pg-crash
1516
- pg_ivm
1617

1718
defaults:
@@ -34,7 +35,7 @@ jobs:
3435
persist-credentials: false
3536

3637
- name: Check for changes
37-
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
38+
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
3839
id: filter
3940
with:
4041
filters: |
@@ -53,6 +54,9 @@ jobs:
5354
pgaudit:
5455
- 'pgaudit/**'
5556
- *shared
57+
pg-crash:
58+
- 'pg-crash/**'
59+
- *shared
5660
pg_ivm:
5761
- 'pg_ivm/**'
5862
- *shared
@@ -65,8 +69,9 @@ jobs:
6569
CHANGES: ${{ steps.filter.outputs.changes }}
6670
# Input Extension name
6771
INPUT_EXTENSION_NAME: ${{ github.event.inputs.extension_name }}
72+
EVENT_NAME: ${{ github.event_name }}
6873
run: |
69-
if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
74+
if [[ "${EVENT_NAME}" == 'workflow_dispatch' ]]; then
7075
CHANGES="[\"$INPUT_EXTENSION_NAME\"]"
7176
fi
7277

.github/workflows/bake_targets.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ jobs:
3232
persist-credentials: false
3333

3434
- name: Log in to the GitHub Container registry
35-
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
35+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
3636
with:
3737
registry: ghcr.io
3838
username: ${{ github.actor }}
3939
password: ${{ secrets.GITHUB_TOKEN }}
4040

4141
- name: Set up QEMU
42-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
42+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
4343
with:
4444
platforms: 'linux/arm64'
4545

4646
- name: Set up Docker Buildx
47-
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
47+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
4848

4949
- name: Build and push
50-
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6
50+
uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7
5151
id: build
5252
env:
5353
BUILDX_METADATA_PROVENANCE: disabled
@@ -127,12 +127,12 @@ jobs:
127127
persist-credentials: false
128128

129129
- name: Install Task
130-
uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0
130+
uses: go-task/setup-task@70f2430ad412f838533de8c0515c749ffb2b8bd3 # v1.1.0
131131

132132
- name: Install Dagger
133133
env:
134134
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
135-
DAGGER_VERSION: 0.19.11
135+
DAGGER_VERSION: 0.20.1
136136
run: |
137137
curl -L https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/.local/bin sh
138138
@@ -141,15 +141,20 @@ jobs:
141141
task e2e:setup-env
142142
143143
- name: Generate Chainsaw testing values
144+
env:
145+
MATRIX_IMAGE: ${{ matrix.image }}
146+
EXTENSION_NAME: ${{ inputs.extension_name }}
144147
run: |
145-
task e2e:generate-values EXTENSION_IMAGE="${{ matrix.image }}" TARGET="${{ inputs.extension_name }}"
148+
task e2e:generate-values EXTENSION_IMAGE="${MATRIX_IMAGE}" TARGET="${EXTENSION_NAME}"
146149
147150
- name: Run e2e tests
151+
env:
152+
EXTENSION_NAME: ${{ inputs.extension_name }}
148153
run: |
149154
# Get Kind cluster internal kubeconfig
150155
task e2e:export-kubeconfig KUBECONFIG_PATH=./kubeconfig INTERNAL=true
151156
152-
task e2e:test TARGET="${{ inputs.extension_name }}" KUBECONFIG_PATH="./kubeconfig"
157+
task e2e:test TARGET="${EXTENSION_NAME}" KUBECONFIG_PATH="./kubeconfig"
153158
154159
copytoproduction:
155160
name: Copy images to production

.github/workflows/update-catalogs.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ defaults:
1616

1717
jobs:
1818
update-catalogs:
19+
name: Updating catalogs
1920
runs-on: ubuntu-24.04
21+
permissions:
22+
id-token: write
2023
steps:
2124
- name: Checkout
2225
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -33,15 +36,25 @@ jobs:
3336

3437
- name: Update catalogs
3538
id: update-extension-catalogs
36-
uses: dagger/dagger-for-github@d913e70051faf3b907d4dd96ef1161083c88c644 # v8.2.0
39+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
3740
env:
3841
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
39-
DAGGER_VERSION: 0.19.11
42+
DAGGER_VERSION: 0.20.1
4043
with:
4144
version: ${{ env.DAGGER_VERSION }}
4245
verb: call
4346
module: ./dagger/maintenance/
44-
args: generate-catalogs --catalogs-dir artifacts/image-catalogs/ export --path artifacts/image-catalogs/
47+
args: generate-catalogs --catalogs-dir artifacts/image-catalogs/ export --path artifacts/image-catalogs-extensions/
48+
49+
- name: Install cosign
50+
uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3
51+
52+
- name: Sign catalogs
53+
run: |
54+
for file in artifacts/image-catalogs-extensions/*.yaml; do
55+
echo "Signing $file..."
56+
cosign sign-blob "$file" --bundle "$file.sigstore.json" --yes
57+
done
4558
4659
- name: Diff
4760
working-directory: artifacts
@@ -54,7 +67,7 @@ jobs:
5467
if: github.ref == 'refs/heads/main'
5568
with:
5669
cwd: 'artifacts'
57-
add: 'image-catalogs'
70+
add: 'image-catalogs-extensions'
5871
author_name: CloudNativePG Automated Updates
5972
author_email: noreply@cnpg.com
6073
message: 'chore: update extensions imageCatalogs'

.github/workflows/update_os_libraries.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525

2626
- name: Fetch extensions
2727
id: get-extensions-dagger
28-
uses: dagger/dagger-for-github@d913e70051faf3b907d4dd96ef1161083c88c644 # v8.2.0
28+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
2929
env:
3030
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
31-
DAGGER_VERSION: 0.19.11
31+
DAGGER_VERSION: 0.20.1
3232
with:
3333
version: ${{ env.DAGGER_VERSION }}
3434
verb: call
@@ -37,8 +37,10 @@ jobs:
3737

3838
- name: Set extensions output
3939
id: get-extensions
40+
env:
41+
EXTENSIONS_OUTPUT: ${{ steps.get-extensions-dagger.outputs.output }}
4042
run: |
41-
EXTENSIONS='${{ steps.get-extensions-dagger.outputs.output }}'
43+
EXTENSIONS="${EXTENSIONS_OUTPUT}"
4244
echo "extensions=$(echo "$EXTENSIONS" | jq -c .)" >> $GITHUB_OUTPUT
4345
4446
update-extension-os-libs:
@@ -54,17 +56,17 @@ jobs:
5456
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5557

5658
- name: Log in to the GitHub Container registry
57-
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
59+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
5860
with:
5961
registry: ghcr.io
6062
username: ${{ github.actor }}
6163
password: ${{ secrets.GITHUB_TOKEN }}
6264

6365
- name: Update OS libs for ${{ matrix.extension }}
64-
uses: dagger/dagger-for-github@d913e70051faf3b907d4dd96ef1161083c88c644 # v8.2.0
66+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
6567
env:
6668
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
67-
DAGGER_VERSION: 0.19.11
69+
DAGGER_VERSION: 0.20.1
6870
with:
6971
version: ${{ env.DAGGER_VERSION }}
7072
verb: call

BUILD.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ This guide explains how to build Postgres extensions container images for
44
[CloudNativePG](https://cloudnative-pg.io) locally, using
55
[Docker Bake](https://docs.docker.com/build/bake/).
66

7+
> [!IMPORTANT]
8+
> If you are looking to contribute a new PostgreSQL extension to this
9+
> repository, please refer to the [`CONTRIBUTING_NEW_EXTENSION.md` file](CONTRIBUTING_NEW_EXTENSION.md).
10+
> This guide covers the entire lifecycle, from proposing the extension and
11+
> scaffolding the project to local validation and submitting a Pull Request.
12+
713
## Prerequisites
814

915
Before you begin, ensure that you have met the following
@@ -45,6 +51,8 @@ following scaffolded files:
4551
> [!NOTE]
4652
> These files are generated from generic templates and should be customized to
4753
> meet your extension's specific requirements.
54+
> For a complete walkthrough of the requirements and package discovery phase,
55+
> see [`CONTRIBUTING_NEW_EXTENSION.md`](./CONTRIBUTING_NEW_EXTENSION.md).
4856
4957
### Advanced Scaffolding
5058

@@ -172,6 +180,20 @@ task e2e:setup-env
172180
> If changed, you must pass this variable to all subsequent tasks that interact
173181
> with the registry to ensure connectivity.
174182
183+
#### Configuring credentials for private registries
184+
185+
If you need to pull images from a private registry during testing, you can
186+
configure authentication credentials when setting up the environment:
187+
188+
```bash
189+
REGISTRY_PASSWORD="your-password" task e2e:setup-env \
190+
REGISTRY_HOST="registry.example.com" \
191+
REGISTRY_USERNAME="your-username"
192+
```
193+
194+
These credentials are configured at the kubelet level, allowing pods to pull
195+
images from the private registry without requiring ImagePullSecrets.
196+
175197
### Get access to the cluster
176198

177199
To interact with the cluster via `kubectl` from your local terminal:
@@ -218,6 +240,18 @@ the E2E tests:
218240
task e2e:generate-values TARGET="<extension>" EXTENSION_IMAGE="<my-local-image>"
219241
```
220242

243+
#### Using private registries
244+
245+
If your extension image is hosted in a private registry, you can provide authentication
246+
credentials when generating test values:
247+
248+
```bash
249+
REGISTRY_PASSWORD="your-password" task generate-values \
250+
TARGET="<extension>" \
251+
EXTENSION_IMAGE="<my-private-registry>/image:tag" \
252+
REGISTRY_USERNAME="your-username"
253+
```
254+
221255
### Execute End-to-End tests
222256

223257
Run the test suite using the internal Kubeconfig. This executes both the
@@ -228,6 +262,15 @@ generic tests (global `/test` folder) and extension-specific tests (target
228262
task e2e:test TARGET="<extension>" KUBECONFIG_PATH="./kubeconfig"
229263
```
230264

265+
#### Pass arguments to chainsaw test
266+
267+
It is possible to pass arguments to the [Chainsaw test command](https://kyverno.github.io/chainsaw/latest/reference/commands/chainsaw_test/) by using the `EXTRA_ARGS`
268+
argument, like:
269+
270+
```bash
271+
task e2e:test TARGET="pgvector" KUBECONFIG_PATH="./kubeconfig" EXTRA_ARGS="--skip-delete,--fail-fast"
272+
```
273+
231274
---
232275

233276
### Tear down the local test environment

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to CloudNativePG
2+
3+
Thank you for your interest in contributing! 💖
4+
5+
To ensure consistency across the project, all CloudNativePG repositories follow
6+
a common set of guidelines regarding code of conduct, AI usage, and
7+
contribution workflows.
8+
9+
Please review the [CloudNativePG Project contributing guidelines](https://github.com/cloudnative-pg/governance/blob/main/CONTRIBUTING.md)
10+
before searching for issues, reporting bugs, or submitting a pull request.
11+
12+
## Adding a New Extension
13+
14+
This repository is specifically designed for the lifecycle of PostgreSQL
15+
extension container images. If you are looking to add a new extension, we have
16+
a dedicated guide that covers everything from environment setup and package
17+
discovery to local testing and submission:
18+
19+
- [Guide to adding a new extension: `CONTRIBUTING_NEW_EXTENSION.md`](CONTRIBUTING_NEW_EXTENSION.md)
20+
21+
## Development Environment
22+
23+
If you are working on the build system or testing framework itself, please
24+
refer to [BUILD.md](./BUILD.md) for technical details on how Dagger and Task are
25+
used to manage the pipeline.

0 commit comments

Comments
 (0)