Skip to content

Commit 9c2347a

Browse files
itay-grudevphilippemnoel
authored andcommitted
ParadeDB Support (#1)
Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com> Co-authored-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com> ci: AWS EKS LocalStack Tests (#14) Co-authored-by: Itay Grudev <itay.grudev@essentim.com> Co-authored-by: Itay Grudev <itay+github.com@grudev.com> Updated documentation workflows and cleanup (#18) Revert "Add postgresql default to tests" This reverts commit a9f340d. Add repository_dispatch Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com> chore: Configure repository for ParadeDB (#15) Co-authored-by: Itay Grudev <itay+github.com@grudev.com> chore: Create artifacthub-repo.yml (#20) Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com> Put artifacthub-repo.yml in the right location Bug Fix: Tests (#21) Renamed chart to `paradedb-cluster` (#22) Co-authored-by: Philippe Noël <philippemnoel@gmail.com> Rm .DS_Store
1 parent 0bfb297 commit 9c2347a

File tree

197 files changed

+1898
-19019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+1898
-19019
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Order is important. The last matching pattern has the most precedence. In each subsection folders are ordered first by depth, then alphabetically
2+
3+
/.github/ @philippemnoel
4+
/charts/ @philippemnoel

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [paradedb] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Bug Description**
10+
Please describe the bug.
11+
12+
**How To Reproduce**
13+
Please describe how to reproduce the bug.
14+
15+
**Proposed Fix**
16+
Please describe how you think this bug could be fixed.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**What**
10+
Please describe the feature.
11+
12+
**Why**
13+
Please describe why this feature is important.
14+
15+
**How**
16+
Please describe how you'd implement this feature.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ticket(s) Closed
2+
3+
- Closes #
4+
5+
## What
6+
7+
## Why
8+
9+
## How
10+
11+
## Tests

.github/actions/deploy-operator/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ runs:
66
- name: Deploy the operator
77
shell: bash
88
run:
9-
helm dependency update charts/cloudnative-pg
9+
helm repo add cnpg https://cloudnative-pg.github.io/charts
1010

1111
helm upgrade
1212
--install
1313
--namespace cnpg-system
1414
--create-namespace
1515
--wait
16-
cnpg charts/cloudnative-pg
16+
cnpg cnpg/cloudnative-pg

.github/actions/verify-cluster-ready/action.yml

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

.github/config/cr.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Reference: https://github.com/helm/chart-releaser
2+
index-path: "./index.yaml"
3+
4+
# PGP signing
5+
sign: true
6+
key: ParadeDB
7+
# keyring: # Set via env variable CR_KEYRING
8+
# passphrase-file: # Set via env variable CR_PASSPHRASE_FILE
9+
10+
# Enable automatic generation of release notes using GitHub's release notes generator.
11+
# see: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
12+
generate-release-notes: true

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
ignore:
9+
- dependency-name: "*"
10+
update-types: ["version-update:semver-patch"]
11+
groups:
12+
github-actions-dependencies:
13+
patterns:
14+
- "*"

.github/renovate.json5

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# workflows/paradedb-publish-chart.yml
2+
#
3+
# ParadeDB Publish Chart
4+
# Publish the ParadeDB Helm chart to paradedb.github.io via GitHub Pages. This workflow also
5+
# triggers the creation of a GitHub Release. It only runs on pushes to `main` or when we trigger
6+
# a workflow_dispatch event, either manually or via creating a release in `paradedb/paradedb`.
7+
8+
name: ParadeDB Publish Chart
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
workflow_dispatch:
15+
inputs:
16+
appVersion:
17+
description: "The ParadeDB version to publish in the Helm Chart (e.g. 0.1.0)"
18+
required: true
19+
default: ""
20+
21+
concurrency:
22+
group: paradedb-publish-chart-${{ github.head_ref || github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
paradedb-publish-chart:
27+
name: Publish ParadeDB Helm Charts to GitHub Pages
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Configure Git
37+
run: |
38+
git config user.name "$GITHUB_ACTOR"
39+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
40+
41+
- name: Set Helm Chart Release Versions
42+
id: set_versions
43+
working-directory: charts/paradedb-cluster/
44+
env:
45+
GH_TOKEN: ${{ secrets.GHA_CREATE_RELEASE_PAT }}
46+
run: |
47+
# If no appVersion is provided, we use the latest ParadeDB version
48+
if [ -z "${{ github.event.inputs.appVersion }}" ]; then
49+
LATEST_TAG=$(curl -s https://api.github.com/repos/paradedb/paradedb/tags | jq -r '.[0].name')
50+
APP_VERSION=${LATEST_TAG#v}
51+
else
52+
APP_VERSION=${{ github.event.inputs.appVersion }}
53+
fi
54+
# Update appVersion to the GitHub Release version and version to the Helm Chart version
55+
sed -i "s/^[[:space:]]*paradedb: .*/ paradedb: \"$APP_VERSION\"/" values.yaml
56+
sed -i "s/^version: .*/version: ${{ vars.CHART_VERSION_MAJOR }}.${{ vars.CHART_VERSION_MINOR }}.${{ vars.CHART_VERSION_PATCH }}/" Chart.yaml
57+
echo "values.yaml:"
58+
cat values.yaml
59+
echo "----------------------------------------"
60+
echo "Chart.yaml:"
61+
cat Chart.yaml
62+
63+
# Set output to update post-release, increasing the Helm Chart version patch number by one to update in GitHub Actions Variables
64+
echo "new_chart_version_patch=$(( ${{ vars.CHART_VERSION_PATCH }} + 1 ))" >> $GITHUB_OUTPUT
65+
66+
# The GitHub repository secret `PARADEDB_PGP_PRIVATE_KEY` contains the private key
67+
# in ASCII-armored format. To export a (new) key, run this command:
68+
# `gpg --armor --export-secret-key <my key>`
69+
- name: Prepare ParadeDB PGP Key
70+
env:
71+
PGP_PRIVATE_KEY: "${{ secrets.PARADEDB_PGP_PRIVATE_KEY }}"
72+
PGP_PASSPHRASE: "${{ secrets.PARADEDB_PGP_PASSPHRASE }}"
73+
run: |
74+
IFS=""
75+
echo "$PGP_PRIVATE_KEY" | gpg --dearmor --verbose > /tmp/secring.gpg
76+
echo "$PGP_PASSPHRASE" > /tmp/passphrase.txt
77+
78+
# Tell chart-releaser-action where to find the key and its passphrase
79+
echo "CR_KEYRING=/tmp/secring.gpg" >> "$GITHUB_ENV"
80+
echo "CR_PASSPHRASE_FILE=/tmp/passphrase.txt" >> "$GITHUB_ENV"
81+
82+
- name: Add Grafana Chart Dependencies
83+
run: helm repo add cnpg-grafana-dashboard https://cloudnative-pg.github.io/grafana-dashboards
84+
85+
- name: Run chart-releaser
86+
uses: helm/chart-releaser-action@v1.6.0
87+
with:
88+
config: "./.github/config/cr.yaml"
89+
env:
90+
CR_TOKEN: "${{ secrets.GHA_CREATE_RELEASE_PAT }}"
91+
92+
# We have a separate version for our Helm Chart, since it needs to always increment by
93+
# one for every production release, independently of the ParadeDB version. Any non-patch
94+
# version increment should be done manually in GitHub Actions Variables.
95+
- name: Increment Helm Chart Version Number in GitHub Actions Variables
96+
env:
97+
GH_TOKEN: ${{ secrets.GHA_CREATE_RELEASE_PAT }}
98+
run: |
99+
gh api \
100+
--method PATCH \
101+
-H "Accept: application/vnd.github+json" \
102+
-H "X-GitHub-Api-Version: 2022-11-28" \
103+
/repos/paradedb/charts/actions/variables/CHART_VERSION_PATCH \
104+
-f name='CHART_VERSION_PATCH' \
105+
-f value='${{ steps.set_versions.outputs.new_chart_version_patch }}'
106+
107+
- name: Securely Delete the PGP Key and Passphrase
108+
if: always()
109+
run: shred --remove=wipesync /tmp/secring.gpg /tmp/passphrase.txt
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# workflows/paradedb-test-eks.yml
2+
#
3+
# ParadeDB Test EKS
4+
# Test the ParadeDB Helm chart against a local AWS EKS cluster via LocalStack. This test workflow is
5+
# specific to the ParadeDB cloudnative-pg/charts fork.
6+
7+
name: ParadeDB Test EKS
8+
9+
on:
10+
pull_request:
11+
types: [opened, synchronize, reopened, ready_for_review]
12+
paths:
13+
- "charts/paradedb-cluster/*"
14+
- ".github/workflows/paradedb-test-eks.yml"
15+
repository_dispatch:
16+
workflow_dispatch:
17+
18+
concurrency:
19+
group: paradedb-test-eks-${{ github.head_ref || github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
paradedb-test-eks:
24+
name: Test ParadeDB Helm Chart on AWS EKS via LocalStack
25+
runs-on: ubuntu-latest
26+
if: github.event.pull_request.draft == false
27+
28+
steps:
29+
- name: Checkout Git Repository
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Kubectl
33+
uses: azure/setup-kubectl@v4
34+
35+
- name: Set up Helm
36+
uses: azure/setup-helm@v4
37+
38+
- name: Start LocalStack
39+
uses: LocalStack/setup-localstack@v0.2.2
40+
with:
41+
image-tag: "latest"
42+
install-awslocal: "true"
43+
configuration: DEBUG=1
44+
use-pro: "true"
45+
env:
46+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
47+
48+
- name: Configure AWS CLI for LocalStack
49+
run: |
50+
awslocal configure set aws_secret_access_key test
51+
awslocal configure set aws_access_key_id test
52+
awslocal configure set region us-east-1
53+
54+
# As of writing, the latest Kubernetes version available on LocalStack EKS
55+
# is 1.29. CloudNativePG requires version 1.25+
56+
- name: Create the LocalStack AWS EKS Cluster
57+
run: |
58+
awslocal --endpoint-url=http://localhost:4566 eks create-cluster \
59+
--name paradedb-eks \
60+
--role-arn arn:aws:iam::000000000000:role/eks-service-role \
61+
--resources-vpc-config subnetIds=subnet-12345 \
62+
--kubernetes-version 1.29
63+
64+
- name: Wait for LocalStack AWS EKS Cluster to be Active
65+
run: |
66+
for i in {1..10}; do
67+
STATUS=$(awslocal --endpoint-url=http://localhost:4566 --region us-east-1 eks describe-cluster --name paradedb-eks --query 'cluster.status' --output text)
68+
if [ "$STATUS" == "ACTIVE" ]; then
69+
echo "Cluster is ACTIVE"
70+
break
71+
else
72+
echo "Cluster status is $STATUS. Waiting..."
73+
sleep 10
74+
fi
75+
done
76+
77+
- name: Update Kubeconfig to Use the LocalStack AWS EKS Cluster
78+
run: awslocal --endpoint-url=http://localhost:4566 eks update-kubeconfig --name paradedb-eks
79+
80+
- name: Wait for the LocalStack AWS EKS Cluster to be Ready
81+
run: |
82+
nodes=$(kubectl get nodes --no-headers -o custom-columns=NAME:.metadata.name)
83+
for node in $nodes; do
84+
kubectl wait --for=condition=ready node/$node --timeout=120s
85+
done
86+
87+
- name: Install the CloudNativePG Operator
88+
run: |
89+
helm repo add cnpg https://cloudnative-pg.github.io/charts
90+
helm upgrade --install cnpg --namespace cnpg-system --create-namespace cnpg/cloudnative-pg
91+
92+
- name: Wait for CNPG Webhook Service to be Ready
93+
run: |
94+
kubectl wait --namespace cnpg-system --for=condition=available --timeout=120s deployment/cnpg-cloudnative-pg
95+
kubectl get svc -n cnpg-system cnpg-webhook-service
96+
97+
- name: Test Helm Dependency Update
98+
working-directory: charts/paradedb-cluster/
99+
run: helm dependency update . --debug
100+
101+
- name: Fetch the latest ParadeDB release tag
102+
id: paradedb-version
103+
run: |
104+
# Fetch the latest release tag and strip the 'v' prefix
105+
LATEST_TAG=$(curl -s https://api.github.com/repos/paradedb/paradedb/releases/latest | jq -r '.tag_name')
106+
CLEANED_TAG=${LATEST_TAG#v}
107+
echo $CLEANED_TAG
108+
echo "version=$CLEANED_TAG" >> $GITHUB_OUTPUT
109+
110+
- name: Test Helm Install
111+
working-directory: charts/paradedb-cluster/
112+
run: helm install paradedb . --namespace paradedb --create-namespace --set version.paradedb=${{ steps.paradedb-version.outputs.version }} --debug
113+
114+
- name: Test Helm Upgrade
115+
working-directory: charts/paradedb-cluster/
116+
run: helm upgrade paradedb . --namespace paradedb --reuse-values --wait --debug
117+
118+
- name: Test PostgreSQL Connection
119+
run: helm test paradedb --namespace paradedb

0 commit comments

Comments
 (0)