Skip to content

Commit

Permalink
Merge branch 'main' into PG-1206-TDE-intro
Browse files Browse the repository at this point in the history
  • Loading branch information
nastena1606 authored Dec 11, 2024
2 parents 635eed7 + ec1a9c1 commit 602feea
Show file tree
Hide file tree
Showing 98 changed files with 1,924 additions and 10,573 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/documentation"
schedule:
interval: "weekly"
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PG-0

### Description
<!--- Describe your changes in detail -->


### Links
<!--- Please provide links to any related PRs in this or other repositories --->

11 changes: 5 additions & 6 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Checks
on:
pull_request:

permissions:
contents: read

jobs:
format:
name: Format
Expand All @@ -15,23 +18,19 @@ jobs:
sudo apt-get install -y libcurl4-openssl-dev
- name: Clone postgres repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: 'postgres/postgres'
ref: 'REL_17_STABLE'

- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: 'contrib/pg_tde'

- name: Configure postgres
run: ./configure

- name: Configure pg_tde
run: ./configure
working-directory: contrib/pg_tde

- name: Install perltidy
run: sudo cpan -T SHANCOCK/Perl-Tidy-20230309.tar.gz

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1

- name: Build
uses: docker/build-push-action@v6
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
file: docker/Dockerfile
load: true # Put image in local docker
Expand All @@ -34,14 +37,14 @@ jobs:
- name: Login to Docker Hub
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v6
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
file: docker/Dockerfile
push: true
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
paths:
- "documentation/**"

permissions:
contents: read

jobs:
release:
name: Release
Expand All @@ -16,10 +19,10 @@ jobs:

steps:
- name: Chekout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"

Expand Down
31 changes: 24 additions & 7 deletions .github/workflows/postgresql-16-ppg-package-pgxs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ on:
push:
branches: [main]

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for ncipollo/release-action to create a release
name: pg-16-ppg-package-pgxs-build
runs-on: ubuntu-22.04
steps:
Expand All @@ -24,7 +29,7 @@ jobs:
run: |
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev wget \
zlib1g-dev libssl-dev libpam0g-dev bison flex libipc-run-perl \
libcurl4-openssl-dev libhttp-server-simple-perl
libcurl4-openssl-dev libhttp-server-simple-perl python3-pykmip
sudo /usr/bin/perl -MCPAN -e 'install IPC::Run'
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
Expand Down Expand Up @@ -55,26 +60,38 @@ jobs:
percona-postgis percona-pg-stat-monitor16
- name: Clone pg_tde repository
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: 'src/pg_tde'

- name: Checkout libkmip submodule
run: |
git submodule update --init --recursive
working-directory: src/pg_tde

- name: Change src owner to postgres
run: |
sudo chmod o+rx ~
sudo chown -R postgres:postgres src
- name: Build pg_tde
run: |
sudo -u postgres bash -c './configure'
sudo -u postgres bash -c 'make USE_PGXS=1'
sudo make USE_PGXS=1 install
working-directory: src/pg_tde

- name: Setup kmip 1
run: |
wget https://raw.githubusercontent.com/OpenKMIP/PyKMIP/refs/heads/master/bin/create_certificates.py
python3 create_certificates.py
cat client_certificate_jane_doe.pem >> client_key_jane_doe.pem
working-directory: /tmp

- name: Start pg_tde tests
run: |
TV=$(mktemp)
{ exec >$TV; vault server -dev; } &
pykmip-server -f `pwd`/../contrib/pg_tde/pykmip-server.conf -l /tmp/kmip-server.log &
sleep 10
export ROOT_TOKEN=$(cat $TV | grep "Root Token" | cut -d ":" -f 2 | xargs echo -n)
echo "Root token: $ROOT_TOKEN"
Expand All @@ -90,7 +107,7 @@ jobs:
working-directory: src/pg_tde

- name: Report on test fail
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ failure() }}
with:
name: Regressions diff and postgresql log
Expand All @@ -113,7 +130,7 @@ jobs:
sudo cp /usr/lib/postgresql/16/lib/pg_tde* pgtde-ppg16/usr/lib/postgresql/16/lib/
- name: Upload tgz
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: pg_tde_ppg16_binary
path: pgtde-ppg16
Expand All @@ -135,7 +152,7 @@ jobs:
sudo dpkg -i --debug=7777 pgtde-ppg16.deb
- name: Upload deb
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: pg_tde_deb
path: pgtde-ppg16.deb
Expand All @@ -145,7 +162,7 @@ jobs:
cd pgtde-ppg16 && sudo tar -czvf ../pgtde-ppg16.tar.gz .
- name: Publish release
uses: ncipollo/release-action@v1
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
# Only try and deploy on merged code
if: "github.repository == 'percona/pg_tde' && github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'schedule')"
with:
Expand Down
80 changes: 0 additions & 80 deletions .github/workflows/postgresql-16-src-make-macos.yml

This file was deleted.

25 changes: 20 additions & 5 deletions .github/workflows/postgresql-16-src-make-ssl11.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: postgresql-16-src-make-ssl11
on: [pull_request, workflow_dispatch]

permissions:
contents: read

jobs:
build:
name: pg-16-src-make-test-ssl11
Expand All @@ -26,24 +29,29 @@ jobs:
libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \
libsystemd-dev gettext tcl-dev libperl-dev pkg-config \
libselinux1-dev python3-dev libhttp-server-simple-perl\
uuid-dev liblz4-dev libcurl4-openssl-dev
uuid-dev liblz4-dev libcurl4-openssl-dev python3-pykmip
sudo /usr/bin/perl -MCPAN -e 'install IPC::Run'
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install -y vault
- name: Clone postgres repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: 'postgres/postgres'
ref: 'a81e5516fa4bc53e332cb35eefe231147c0e1749'
path: 'src'

- name: Clone pg_tde repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: 'src/contrib/pg_tde'

- name: Checkout libkmip submodule
run: |
git submodule update --init --recursive
working-directory: src/contrib/pg_tde

- name: Create pgsql dir
run: mkdir -p /opt/pgsql
Expand All @@ -57,7 +65,6 @@ jobs:

- name: Build pg_tde
run: |
./configure
make -j MAJORVERSION=16
sudo make install
working-directory: src/contrib/pg_tde
Expand All @@ -71,18 +78,26 @@ jobs:
/opt/pgsql/data/postgresql.conf
pg_ctl -D /opt/pgsql/data -l logfile start
- name: Setup kmip 1
run: |
wget https://raw.githubusercontent.com/OpenKMIP/PyKMIP/refs/heads/master/bin/create_certificates.py
python3 create_certificates.py
cat client_certificate_jane_doe.pem >> client_key_jane_doe.pem
working-directory: /tmp

- name: Test pg_tde
run: |
TV=$(mktemp)
{ exec >$TV; vault server -dev; } &
pykmip-server -f `pwd`/../contrib/pg_tde/pykmip-server.conf -l /tmp/kmip-server.log &
sleep 10
export ROOT_TOKEN=$(cat $TV | grep "Root Token" | cut -d ":" -f 2 | xargs echo -n)
echo "Root token: $ROOT_TOKEN"
make installcheck
working-directory: src/contrib/pg_tde

- name: Report on test fail
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ failure() }}
with:
name: Regressions diff and postgresql log
Expand Down
Loading

0 comments on commit 602feea

Please sign in to comment.