Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
fb89743
fix: add DESTDIR prefix to spockctrl install (#89)
jason-lynch Jul 15, 2025
7bbd72f
Create a sample directory and README.md (#92)
susan-pgedge Jul 16, 2025
201f29f
Get functions.sql regression test working again
mason-sharp Jul 17, 2025
c355542
Simplify github actions for forked repos
mason-sharp Jul 15, 2025
e177c2b
Path to Dockerfile
mason-sharp Jul 16, 2025
19d6bf5
backslash missing
mason-sharp Jul 16, 2025
c9259dc
Update output for two huge regression tests
mason-sharp Jul 16, 2025
79de6e3
Only run huge_tx_many_tables
mason-sharp Jul 16, 2025
8b22afa
Try with larger runner
mason-sharp Jul 16, 2025
2cd8f2a
Update output of apply_delay and multiple_upstreams
mason-sharp Jul 16, 2025
e613062
Do not run huge_tx_many_tables
mason-sharp Jul 16, 2025
9190b55
Revert to using default runner
mason-sharp Jul 16, 2025
5f579cb
Add workflow_dispatch to allow manual runs of spockbench workflow (#96)
rasifr Jul 21, 2025
659172a
Adjust the configuration for the row_filter test (#97)
rasifr Jul 22, 2025
8f8f5dc
SPOC-125 : Added new sample files for ZODAN.
Jul 23, 2025
e772e6b
Updated links in README.md, guc_settings.md, limitations.md, spock_fu…
susan-pgedge Jul 23, 2025
e92c6ff
Merge pull request #102 from ibrarahmad/SPOC-125
susan-pgedge Jul 23, 2025
9d5ea95
Moving samples/zodan.* into Z0DAN folder and replacing samples/README…
susan-pgedge Jul 23, 2025
772e1a5
Replaced secrets.READ_SPOCKBENCH_PAT with secrets.GITHUB_TOKEN for (#…
rasifr Jul 24, 2025
0d2a502
Bump Spock extension version from 5.0.0 to 6.0.0-devel. (#106)
ibrarahmad Jul 25, 2025
cf22e94
Adding spockctrl workflow that adds a 4th node to a 3 node cluster; u…
susan-pgedge Jul 26, 2025
66b1cce
[SPOC-90] Fixed triggers regression test (#98)
rasifr Jul 28, 2025
06d2856
Add .codacy.yaml file
mason-sharp Jul 25, 2025
fcdff7f
Remove change for codacy test
mason-sharp Jul 25, 2025
56b0a5f
Codacy ignore .sql files
mason-sharp Jul 25, 2025
fa381f5
Add predicate filtering for partial unique indexes in conflict resolu…
rasifr Jul 28, 2025
8d3a99a
Show test status badge in README on github
mason-sharp Jul 29, 2025
1d1586b
Make the functions test more reliable
mason-sharp Jul 29, 2025
6b09049
Update functions.sql test
mason-sharp Jul 29, 2025
6fb520b
Revert change to 5.0.0.
mason-sharp Jul 28, 2025
4439beb
5.0.0 to 5.0.1 upgrade to 6.0.0-devel sql file rename
mason-sharp Jul 28, 2025
dc92825
fix regression tests
mason-sharp Jul 28, 2025
cdab5ce
make PG_CONFIG overridable and pass it to sub-make (#120)
rasifr Aug 7, 2025
3605ec2
SPOC-164: ZODAN - Enhanced add-node script to support multi-node addi…
ibrarahmad Aug 8, 2025
0d996fb
SPOC-154, SPOC-114, SPOC-115, SPOC-116: Spock regression framework. (…
ibrarahmad Aug 12, 2025
d6c00fe
[SPOC-144] Reduce memory usage (#122)
mason-sharp Aug 13, 2025
0169a21
Update patches for PG 18 to apply cleanly
mason-sharp Aug 12, 2025
d0498a2
SPOC-175: Restructure spock source tree (#125)
rasifr Aug 20, 2025
7bceff5
SPOC-184 Fix for Postgres 18
mason-sharp Aug 20, 2025
9921ae7
Fix path when checking output of tests
mason-sharp Aug 20, 2025
3247917
SPOC-177: Include running the TAP tests for PRs (#124)
mason-sharp Aug 21, 2025
7057507
SPOC-194: get_tuple_origin: initialize local timestamp and origin val…
rasifr Aug 26, 2025
fd78d91
Update release notes for v5.0.1
mason-sharp Aug 26, 2025
433e016
Fix compiler warnings from PostgreSQL 18: add 'static' to internal sy…
rasifr Aug 25, 2025
94d2ffe
SPOC-188: Update Zodan stored procedure for improved logging. (#128)
ibrarahmad Aug 26, 2025
5f29507
codacy config after updating repo structure
mason-sharp Aug 26, 2025
180fd1c
Use PostgreSQL license
mason-sharp Aug 29, 2025
21ceb38
Merge pull request #141 from pgEdge/task/pg-license
dpage Sep 1, 2025
782d078
SPOC-198: Postgres 18 initdb fix (#136)
mason-sharp Sep 2, 2025
921ddea
Additional changes to Z0dan cleanup (#145)
mason-sharp Sep 10, 2025
9cbbffc
SPOC-99: Remove fixed replay queue size limit and eliminate worker re…
Sep 10, 2025
c3764e7
SPOC-99: Removed apply_replay_overflow.
Sep 10, 2025
1767970
SPOC-201: Address some codacy issues (#147)
mason-sharp Sep 10, 2025
08436ed
SPOC-180: stricter row filter checks
mason-sharp Sep 4, 2025
33b93fe
Github action: compile Postgres with assertions
mason-sharp Sep 4, 2025
66a3ffe
Test against Postgrs 18, too
mason-sharp Sep 5, 2025
0a4c982
Do not get snapshot for row filters for PG 18+
mason-sharp Sep 10, 2025
59bea05
Fix minor issues in core patches to avoid warnings.
danolivo Sep 10, 2025
67db214
TAP test helpers (#153)
mason-sharp Sep 15, 2025
cd7d029
Include the spock_compat.h file locally
danolivo Sep 15, 2025
e00bafe
Let the backend remember the state of REPAIR mode.
danolivo Sep 12, 2025
f32424c
SPOC-216, SPOC-211: Add skip_schema functionality and addeds support …
ibrarahmad Sep 17, 2025
ea43a06
Doc updates for 5.0.2 (#162)
susan-pgedge Sep 18, 2025
9cdbcc8
Update docs to reflect spock_create_subscriber was removed
mason-sharp Sep 17, 2025
ec913d4
SPOC-223: Change the phase ordering- sync sooner. (#164)
ibrarahmad Sep 19, 2025
5d37fec
Doc updates for Spock 5.0.2 (#169)
susan-pgedge Sep 22, 2025
0207cad
Updated README.md for spock repo to reflect changes to the repo, and …
Sep 16, 2025
a5ce6ae
Added note with links about deploying spock clusters in Containers an…
Sep 17, 2025
a946e91
Added two node deployment example; DOC-26
Sep 17, 2025
a58d019
Added two node deployment example; DOC-26
Sep 17, 2025
306a518
Treat same origin updates as non-conflicts
mason-sharp Aug 6, 2025
7ff1480
SPOC-102 - INSERT into an absent table shouldn't halt the apply worke…
danolivo Sep 23, 2025
c8792f1
SPOC-51: obfuscate DSN password in error logs (#158)
danolivo Sep 23, 2025
87b56d6
Move documentation to MKDOCS (#175)
susan-pgedge Sep 26, 2025
57bb09b
Update README.md
susan-pgedge Sep 26, 2025
028d46d
Update README.md
susan-pgedge Sep 26, 2025
45d4247
Merge pull request #179 from pgEdge/susan-pgedge-patch-1
susan-pgedge Sep 26, 2025
5893775
Update README.md (#180)
susan-pgedge Sep 26, 2025
73b90f0
Updated README.md to add Monitoring node to TOC at top of file
Sep 29, 2025
14e53e7
Merge pull request #183 from pgEdge/README_TOC_UPDATE
susan-pgedge Sep 29, 2025
66a7e7a
Collect & Upload regression/TAP artifacts (#182)
rasifr Sep 29, 2025
a3fa5fc
SPOC-223, SPOC-224, SPOC-225, SPOC-233: Update ZODAN flow, add remove…
ibrarahmad Sep 30, 2025
20fbd6c
ZODAN: SPOC-218, SPOC-246, SPOC-239 and SPOC-248 fixes. (#190)
ibrarahmad Sep 30, 2025
3c932d2
Add upgrade path for 5.0.4
mason-sharp Sep 27, 2025
ec68001
fix: guard NULL from spock_relation_open() and fail with clear error
rasifr Oct 1, 2025
29f86bb
Code cleanup (#191)
danolivo Oct 2, 2025
0083269
SPOC-193: autoddl: guard extension-script subcommands using creating_…
rasifr Oct 4, 2025
672e510
Spock doc update for 5.0.4 (#185)
susan-pgedge Oct 7, 2025
f4eec6d
Updates to spock_info.md and install_spock.md (#184)
susan-pgedge Oct 7, 2025
4f043ab
Highlight spock.add_node and dblink in docs
mason-sharp Oct 7, 2025
6a3d31a
Rename zodrn.* -> zodremove
mason-sharp Oct 7, 2025
b8f1eea
Spock resource manager (#151)
rasifr Oct 8, 2025
8bd1c1b
SPOCK-45 - Note that spock configuration must be identical on the sou…
susan-pgedge Oct 8, 2025
24c3c01
Bugfix on cleared memory access at the COMMIT callback. (#200)
danolivo Oct 9, 2025
5be5b5a
SPOC-274: Add user validation to ZODAN add_node process. (#210)
ibrarahmad Oct 9, 2025
2fc72c7
Add note about zodan user check (#211)
mason-sharp Oct 9, 2025
f69f38f
SPOC-171: Remove snowflake-related functions and doc from the Spock
danolivo Oct 10, 2025
3c4f3c2
SPOC-209: Fix the Spock protocol
danolivo Oct 10, 2025
e0c337e
Clarify adding a node in Z0DAN (#214)
mason-sharp Oct 16, 2025
1bbcc87
Disable subscription if the worker is stuck in an unrecoverable stage…
danolivo Oct 16, 2025
caa6490
Generate subscription ID (#192)
danolivo Oct 16, 2025
ce11744
Qualify procedures with 'spock' schema in zodan_cleanup.sql (#218)
rasifr Oct 14, 2025
f5d1e81
rename 'verbose' param to 'verbose_mode' and remove redundant LANGUAG…
rasifr Oct 14, 2025
1f29628
SPOC-284: Fix the zodremove scripts (#219)
mason-sharp Oct 16, 2025
68fc487
SpockCtl - code cleanup (2nd iteration). (#196)
danolivo Oct 16, 2025
ef8574f
Fix adding node for 2 node case (#225)
mason-sharp Oct 20, 2025
2c8e356
SPOC-288: simplify zodan version checking (#226)
mason-sharp Oct 20, 2025
56c362d
Introduce a transient Docker image (SPOC-250). (#216)
danolivo Oct 20, 2025
ddee8f2
Fix link format for two-node cluster documentation (#230)
susan-pgedge Oct 20, 2025
da97b90
Fix set_repair_mode warning (#232)
mason-sharp Oct 21, 2025
b145e8b
SPOC-256: Add ZODAN test case and fix version comparison for -devel s…
Oct 21, 2025
eacc432
Multiple minor fixes in the Z0DAN SQL script
danolivo Oct 16, 2025
35be18e
SPOC-306: Fix zodan.py and add tap test (#238)
mason-sharp Oct 23, 2025
fa52495
Fix two bugs in the table re-sync routine. (#233)
danolivo Oct 23, 2025
92c7191
Block zodan if lolor is installed on new node (#245)
mason-sharp Oct 27, 2025
38dbe42
Zodan README.md improvements (#244)
mason-sharp Oct 27, 2025
9b076b8
Arrange the spock pg_dump/pg_restore code according to Postgres 18.
danolivo Oct 4, 2025
b5109c1
SPOC-212: document exception_replay_queue_size (#248)
mason-sharp Oct 31, 2025
46bae19
Add some maximum times to github workflow
mason-sharp Oct 31, 2025
a4e34ce
Add checkpoint hook integration for group resource and WAL progress (…
rasifr Nov 3, 2025
57a66ab
autoddl: stage-1 refactor — centralize AutoDDL in spock_autoddl.c
rasifr Oct 24, 2025
3cd9a33
autoddl: stage-2 — simplify control flow, tighten filters, remove rec…
rasifr Oct 27, 2025
6d29198
Increase stability of regression tests.
danolivo Oct 9, 2025
1ad8b59
Improve the wait_slot_confirm_lsn routine description.
danolivo Nov 10, 2025
2f162f9
Rebase: pg{15,16,17,18}-025-logical_commit_clock core patch
rasifr Nov 11, 2025
80b52e2
Trivial fixes
danolivo Oct 24, 2025
9c4267d
Rename some UI fields for clarity.
danolivo Oct 24, 2025
a95e44f
Bugfix: carefully check the manager state on a worker detachment.
danolivo Oct 27, 2025
3f471dd
Improvement: make the get_apply_group_progress shorter.
danolivo Oct 27, 2025
4a6298e
Be a little closer to the upstream LR statistics.
danolivo Oct 27, 2025
f986818
Update remote_insert_lsn more frequently.
danolivo Oct 29, 2025
6225e73
Teach apply_group_progress to return NULL if the timestamp is not set…
danolivo Oct 27, 2025
7c7ce7d
Add detailed comment on the SpockApplyProgress struct.
danolivo Oct 28, 2025
d5abc3b
Fixes after review.
danolivo Nov 3, 2025
a660f44
Require dbname value in a DSN string.
danolivo Nov 11, 2025
591ec87
Use patch instead of git apply (#268)
mason-sharp Nov 14, 2025
b5df41e
Rearranged documentation content for Zodan (#259)
susan-pgedge Nov 14, 2025
3792f5a
Fix typo in installation instructions
zaidshabbir25 Nov 14, 2025
76d5389
Change the Lag Tracker interface.
danolivo Oct 31, 2025
cb48e17
SPOC-307: Add lolor check to zodan.py health-check (#260)
mason-sharp Nov 14, 2025
73380fa
Let the 'spock.progress' VIEW show data for the current database only.
danolivo Nov 7, 2025
f655f59
Fix the destroy_cluster Perl routine.
danolivo Nov 7, 2025
325be0d
Plain Z0DAN SYNC test for the 2+1 node configuration.
danolivo Nov 4, 2025
57566f6
One more Z0DAN SYNC test for the 2+1 node configuration.
danolivo Nov 10, 2025
b90eefa
Separate the long-lasting Z0DAN sync TAP test.
danolivo Nov 27, 2025
0ea3a12
Improve the 011_zodan_sync_third TAP test.
danolivo Nov 28, 2025
e0d6a1c
Cumulative changes after review
danolivo Dec 2, 2025
c436818
Fix WAL recovery crash after apply worker failure (#279)
rasifr Dec 4, 2025
dc39dd0
Remove code tails.
danolivo Nov 27, 2025
40b35f6
Remove the SPI API support from the Spock protocol.
danolivo Dec 2, 2025
a9bc865
Bug with not using source node to wait on sync (#281)
mason-sharp Dec 9, 2025
27e5857
Minor improvement of the sync_event machinery. (#275)
danolivo Dec 9, 2025
321a303
Updated Spock typedefs for pgindent
rasifr Dec 10, 2025
e73c5b4
Reformatted the codebase using pgindent to restore canonical
rasifr Dec 10, 2025
72b7980
Add multi-protocol support for rolling upgrades between v5.0.x and v6…
rasifr Dec 1, 2025
a22baeb
Add TAP test for rolling upgrades between Spock v5.x and v6.0
rasifr Dec 11, 2025
f53ed07
Move check_simple_rowfilter_expr to the spock_compat module.
danolivo Dec 8, 2025
eb07816
Exception Handling Improvements:
rasifr Dec 10, 2025
3cf9758
Fix skip_lsn mechanism to prevent subscription re-disabling after skip
rasifr Dec 13, 2025
837ce5e
Fix grammatical errors in code comments
claude Dec 15, 2025
137d80f
Add license headers to C source files
claude Dec 16, 2025
e47a737
Standardize license headers - fix copyright year inconsistencies
claude Dec 16, 2025
937f2a6
Adopt PostgreSQL native conflict types for better compatibility
mason-sharp Dec 4, 2025
3387e1a
Fix replication errors with tables containing generated columns
danolivo Dec 16, 2025
3e8bdc3
Guard AutoDDL processing with transaction when needed
danolivo Dec 19, 2025
2680e7a
Check transactional state in spock_node.
danolivo Dec 19, 2025
c0928a3
Add transaction state assertions to catalog access functions
claude Dec 19, 2025
4ce1305
Filter DDL commands that require execution outside transaction blocks
danolivo Dec 19, 2025
77ac92d
Tweak comment
mason-sharp Dec 20, 2025
7edee5f
Tweak comment
mason-sharp Dec 20, 2025
7d63ca3
Tweak comment
mason-sharp Dec 20, 2025
43d3ec8
Minor change after review
danolivo Dec 20, 2025
dc39ea0
Remove hardcoded LLVM_CONFIG path from PostgreSQL build
claude Dec 26, 2025
6ff3f87
Use ENV directives instead of .bashrc for environment variables
claude Dec 26, 2025
4fa3765
Improve PostgreSQL configure command readability
claude Dec 26, 2025
40a8875
Combine RUN layers to reduce image size
claude Dec 26, 2025
ab10ad4
Add configurable build parallelism with MAKE_JOBS
claude Dec 26, 2025
d691bec
Use COPY --chmod instead of separate chmod layer
claude Dec 26, 2025
6d4db44
Fix Dockerfile-base.el9 architectural issues
claude Dec 26, 2025
ddfd95b
Fix Dockerfile-step-1.el9 USER context and permissions
claude Dec 26, 2025
31466f7
Introduce a delta_apply security label management.
danolivo Nov 24, 2025
9bc41d7
Replicate SECURITY LABEL commands.
danolivo Nov 25, 2025
43e3857
Use security labels to implement the delta_apply feature.
danolivo Nov 26, 2025
589b1af
Remove the core attribute options.
danolivo Nov 26, 2025
730cac0
Let the security label-based delta apply feature be a first-class cit…
danolivo Nov 28, 2025
7d9337b
Disallow the delta apply feature on nullable columns.
danolivo Dec 2, 2025
e544aaa
Rebase onto current master
danolivo Dec 17, 2025
1bea9e8
Rename delta_apply related variables.
danolivo Dec 30, 2025
7767985
Introduce quiet mode to reduce output verbosity
danolivo Dec 19, 2025
0fa52c6
Add PARALLEL SAFE clause to md5_agg-related and spock_gen_slot_name.
claude Dec 22, 2025
dfb3ee4
Two lock-related fixes.
claude Dec 22, 2025
e9f76cb
Check the IF EXISTS clause in add_ddl_to_repset.
danolivo Dec 22, 2025
20ed23b
Simplify the Z0DAN add_node process.
danolivo Dec 10, 2025
4e06dd0
Harmonize zodan.sql and zodan.py
mason-sharp Jan 6, 2026
4604124
Update copyright year to 2026
rasifr Jan 6, 2026
8e523a8
Cleanup the Z0DAN add_node script.
danolivo Dec 10, 2025
9c2f9d9
Remove duplicate key field from SpockGroupEntry structure
danolivo Dec 23, 2025
0066763
Remove unnecessary spock_shmem_attach routine
danolivo Dec 29, 2025
ceb8258
Rename SpockProgressKey back to SpockGroupKey
danolivo Jan 7, 2026
0c649c5
Remove the spock_group_lookup routine.
danolivo Dec 24, 2025
be20f7b
apply_worker_get_progress: access to the progress state under a lock.
danolivo Dec 24, 2025
b6e8ad7
Remove redundant parameter from the adjust_progress_info.
danolivo Dec 29, 2025
c231d4a
During subscription syncing, take progress info more consistently.
danolivo Dec 29, 2025
e74fb66
Replace memcpy with structure assignment in apply_worker_get_progress
danolivo Jan 9, 2026
0698eae
Fix memory leak and assertion bug
rasifr Jan 8, 2026
f38da44
Fix Z0DAN sync origin advancement to use slot creation LSN
rasifr Jan 5, 2026
ed24774
Port Z0DAN sync LSN fix to Python script
rasifr Jan 7, 2026
fc94fe3
Enhance Docker infrastructure
danolivo Jan 9, 2026
82622f6
Add Docker-base description for users and quick introduction
danolivo Jan 9, 2026
224b55d
Add build reproducibility metadata to base image
danolivo Jan 9, 2026
c7a1a22
Add multiplatform support (amd64/arm64) to base image workflow
danolivo Jan 9, 2026
8c9d111
Fix hallucinations of Claude
danolivo Jan 9, 2026
ad22c07
Let a user to vary the base image name - it is needed for testing pur…
danolivo Jan 12, 2026
f1e4f71
Fix hash table iteration safety issues.
Jan 13, 2026
064127a
Updated install_spock.md to fix wrapping, update links as needed, and…
Jan 14, 2026
2071c8e
Updated install_spock.md; these changes are in main, but need to be a…
Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 60 additions & 0 deletions .codacy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
exclude_paths:
- 'tests/regress/sql/*.sql' # non-standard SQL files with \ directives
- 'sql/*.sql' # non-standard SQL files with \ directives

# Ignore LOC and complexity for inherited files
engines:
metric:
exclude_paths:
- "src/spock_apply.c"
- "src/spock_apply_heap.c"
- "src/spock_apply_spi.c"
- "src/spock.c"
- "src/spock_conflict.c"
- "src/spock_dependency.c"
- "src/spock_executor.c"
- "src/spock_fe.c"
- "src/spock_functions.c"
- "src/spock_manager.c"
- "src/spock_monitoring.c"
- "src/spock_node.c"
- "src/spock_output.c"
- "src/spock_output_config.c"
- "src/spock_output_plugin.c"
- "src/spock_output_proto.c"
- "src/spock_proto_json.c"
- "src/spock_proto_native.c"
- "src/spock_queue.c"
- "src/spock_relcache.c"
- "src/spock_repset.c"
- "src/spock_rpc.c"
- "src/spock_sequences.c"
- "src/spock_sync.c"
- "src/spock_worker.c"
lizard:
exclude_paths:
- "src/spock_apply.c"
- "src/spock_apply_heap.c"
- "src/spock_apply_spi.c"
- "src/spock.c"
- "src/spock_conflict.c"
- "src/spock_dependency.c"
- "src/spock_executor.c"
- "src/spock_fe.c"
- "src/spock_functions.c"
- "src/spock_manager.c"
- "src/spock_monitoring.c"
- "src/spock_node.c"
- "src/spock_output.c"
- "src/spock_output_config.c"
- "src/spock_output_plugin.c"
- "src/spock_output_proto.c"
- "src/spock_proto_json.c"
- "src/spock_proto_native.c"
- "src/spock_queue.c"
- "src/spock_relcache.c"
- "src/spock_repset.c"
- "src/spock_rpc.c"
- "src/spock_sequences.c"
- "src/spock_sync.c"
- "src/spock_worker.c"
176 changes: 176 additions & 0 deletions .github/workflows/cache-base-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: Update base OS image
run-name: Updating the base OS and install necessary extra packages (multiplatform)

# This workflow builds the pgEdge base test image with full reproducibility metadata:
# - Captures build timestamp, git commit SHA, branch, and Rocky Linux version
# - Embeds build information in /etc/pgedge/build-info.txt within the image
# - Tags images with both :latest and :${GIT_COMMIT} for version tracking
# - Adds OCI labels for standard metadata inspection
# - Prints all build metadata to workflow output for issue reproduction

on:
workflow_dispatch:
inputs:
image_name:
description: 'Base image name (without registry/owner prefix)'
required: false
default: 'base-test-image'
type: string
image_tag:
description: 'Additional custom tag (besides :latest and :<commit-sha>)'
required: false
default: ''
type: string

permissions:
contents: read
packages: write

jobs:
pull-and-test:
strategy:
fail-fast: true

runs-on: ubuntu-latest

steps:
- name: Checkout spock
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Add permissions
run: |
sudo chmod -R a+w ${GITHUB_WORKSPACE}

# See https://github.com/orgs/community/discussions/27086
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'

# Capture build metadata for reproducibility
- name: Capture build metadata
id: meta
run: |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV}
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> ${GITHUB_ENV}
echo "GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> ${GITHUB_ENV}
echo "ROCKYLINUX_VERSION=$(docker run --rm rockylinux:9 cat /etc/rocky-release)" >> ${GITHUB_ENV}
echo "IMAGE_NAME=${{ inputs.image_name || 'base-test-image' }}" >> ${GITHUB_ENV}

# Print build information
echo "========================================="
echo "pgEdge Base Image Build Information"
echo "========================================="
echo "Image Name: ${{ inputs.image_name || 'base-test-image' }}"
echo "Custom Tag: ${{ inputs.image_tag }}"
echo "Build Date: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
echo "Git Commit: $(git rev-parse HEAD)"
echo "Git Branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Rocky Linux: $(docker run --rm rockylinux:9 cat /etc/rocky-release)"
echo "Platforms: linux/amd64, linux/arm64"
echo "========================================="

# Set up QEMU for multiplatform builds
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
with:
platforms: linux/amd64,linux/arm64

- name: Set up Docker Buildx
# Codacy wants us to use full commit SHA. This is for v3
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
with:
platforms: linux/amd64,linux/arm64

# Login to GHCR
- uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
registry: ghcr.io
username: $OWNER_LC
password: ${{ secrets.GITHUB_TOKEN }}

# Prepare cached version of the base image with build metadata
- name: Build and push multiplatform base system image
uses: docker/build-push-action@c382f710d39a5bb4e430307530a720f50c2d3318
with:
context: .
file: tests/docker/Dockerfile-base.el9
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:latest
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:${{ env.GIT_COMMIT }}
${{ inputs.image_tag && format('ghcr.io/{0}/{1}:{2}', env.OWNER_LC, env.IMAGE_NAME, inputs.image_tag) || '' }}
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
GIT_COMMIT=${{ env.GIT_COMMIT }}
GIT_BRANCH=${{ env.GIT_BRANCH }}
ROCKYLINUX_VERSION=${{ env.ROCKYLINUX_VERSION }}
cache-from: type=gha,scope=base
cache-to: type=gha,mode=max,scope=base
provenance: false
sbom: false

# Verify multiplatform manifest
- name: Inspect multiplatform manifest
run: |
docker buildx imagetools inspect ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:latest

# Verify and display build information from the image
- name: Display build information
run: |
echo ""
echo "========================================="
echo "Multiplatform Image Built Successfully!"
echo "========================================="
echo "Image Name: ${{ env.IMAGE_NAME }}"
echo "Platforms: linux/amd64, linux/arm64"
echo ""
echo "Image Tags:"
echo " - ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:latest"
echo " - ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:${{ env.GIT_COMMIT }}"
if [ -n "${{ inputs.image_tag }}" ]; then
echo " - ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:${{ inputs.image_tag }}"
fi
echo ""
echo "To pull this specific build:"
echo " docker pull ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:${{ env.GIT_COMMIT }}"
echo ""
echo "Docker will automatically select the correct architecture:"
echo " - linux/amd64 for Intel/AMD systems"
echo " - linux/arm64 for Apple Silicon Macs (M1/M2/M3/M4)"
echo ""
echo "To view build info from the image:"
echo " docker run --rm ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:latest cat /etc/pgedge/build-info.txt"
echo ""
echo "To inspect image labels:"
echo " docker inspect ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}:latest | jq '.[0].Config.Labels'"
echo "========================================="

# ==============================================================================
# Build Complete!
# ==============================================================================
# The base image is available at:
# https://github.com/pgedge/spock/pkgs/container/<image-name>
#
# Workflow Inputs (configurable through Actions UI):
# - image_name: Base image name (default: 'base-test-image')
# - image_tag: Optional custom tag in addition to :latest and :<commit-sha>
#
# Each build includes comprehensive reproducibility metadata:
# 1. /etc/pgedge/build-info.txt - Embedded build information file
# 2. OCI image labels with build timestamp, commit SHA, and branch
# 3. Commit-specific tag (:<commit-sha>) for immutable references
# 4. Optional custom tag (:<custom-tag>) if provided
# 5. Workflow output with all build parameters
#
# To reproduce any build:
# 1. Check workflow output or image labels for git commit SHA
# 2. Checkout that commit: git checkout <sha>
# 3. Run the docker build command shown in /etc/pgedge/build-info.txt
#
# Documentation: tests/docker/Dockerfile-base.md
# ==============================================================================
74 changes: 61 additions & 13 deletions .github/workflows/spockbench.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Regression Tests and Spockbench
run-name: Running Regression Tests and Spockbench
on: [push]

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
Expand All @@ -11,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
pgver: [15, 16, 17]
pgver: [15, 16, 17, 18]

runs-on: ${{ matrix.os }}

Expand All @@ -25,7 +29,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: pgedge/spockbench
token: ${{ secrets.READ_SPOCKBENCH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
path: spockbench
ref: master

Expand All @@ -34,35 +38,79 @@ jobs:
sudo chmod -R a+w ${GITHUB_WORKSPACE}

- name: Set up Docker
uses: docker/setup-buildx-action@v3
# Codacy wants us to use full commit SHA. This is for v3
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3

- name: Set up docker compose
uses: docker/setup-compose-action@v1
# Codacy wants us to use full commit SHA. This is for v1
uses: docker/setup-compose-action@364cc21a5de5b1ee4a7f5f9d3fa374ce0ccde746 # v1
with:
version: latest

- name: Build docker container
run: |
cd ${GITHUB_WORKSPACE}/tests/
echo PG_VER=${{ matrix.pgver }} >> pgedge.env
cd ${GITHUB_WORKSPACE}/
docker build \
--build-arg PGVER=${{ matrix.pgver }} \
--build-arg GITHUB_REF=${{ github.ref_name }} \
--build-arg REPO_URL=https://github.com/${{ github.repository }} \
-t spock -f Dockerfile.el9 .
-t spock -f tests/docker/Dockerfile-step-1.el9 .

- name: Run regression tests
run: |
docker run -e PGVER=${{ matrix.pgver }} spock /home/pgedge/run-spock-regress.sh
REG_CT_NAME="spock-regress-${{ matrix.pgver }}-${{ github.run_id }}-${{ github.run_attempt }}"
echo "REG_CT_NAME=$REG_CT_NAME" >> "$GITHUB_ENV"
docker run --name "$REG_CT_NAME" -e PGVER=${{ matrix.pgver }} spock /home/pgedge/run-spock-regress.sh
timeout-minutes: 15

- name: Collect regression artifacts (from container)
if: ${{ always() }}
run: |
docker cp "$REG_CT_NAME":/home/pgedge/spock/tests/regress/regression_output "${GITHUB_WORKSPACE}/tests/regress/" || true
docker rm -f "$REG_CT_NAME" || true

- name: Upload regression artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: regress-${{ matrix.pgver }}
path: |
tests/regress/regression_output/**
if-no-files-found: ignore
retention-days: 7

- name: Run TAP tests
run: |
TAP_CT_NAME="spock-tap-${{ matrix.pgver }}-${{ github.run_id }}-${{ github.run_attempt }}"
echo "TAP_CT_NAME=$TAP_CT_NAME" >> "$GITHUB_ENV"
docker run --name "$TAP_CT_NAME" -e PGVER=${{ matrix.pgver }} --workdir=/home/pgedge/spock/tests/tap \
spock /home/pgedge/spock/tests/tap/run_tests.sh
timeout-minutes: 15

- name: Collect TAP artifacts (from container)
if: ${{ always() }}
run: |
docker cp "$TAP_CT_NAME":/home/pgedge/spock/tests/tap/logs "${GITHUB_WORKSPACE}/tests/tap/logs" || true
docker cp "$TAP_CT_NAME":/home/pgedge/spock/tests/logs "${GITHUB_WORKSPACE}/tests/logs" || true
docker rm -f "$TAP_CT_NAME" || true

- name: Upload TAP artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: tap-${{ matrix.pgver }}
path: |
tests/tap/logs/**
tests/logs/**
if-no-files-found: ignore
retention-days: 7

- name: Start docker
run: |
cd ${GITHUB_WORKSPACE}/tests/
cd ${GITHUB_WORKSPACE}/tests/docker/
echo PG_VER=${{ matrix.pgver }} >> pgedge.env
docker compose up

- name: Check spockbench output
run: |
cd ${GITHUB_WORKSPACE}/tests
cd ${GITHUB_WORKSPACE}/tests/docker
./check-outputs.sh

Loading