This is an automated email from the ASF dual-hosted git repository.
ostinru pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git
The following commit(s) were added to refs/heads/main by this push:
new d35ba21a CI: add caching for testcontainer images (#98)
d35ba21a is described below
commit d35ba21aad9331965e3235d372a6d175190afe33
Author: Nikolay Antonov <[email protected]>
AuthorDate: Sat Apr 11 11:15:06 2026 +0500
CI: add caching for testcontainer images (#98)
Speed up our CI pipeline:
* cache testcontainer images
* do not rebuild singlecluster image on every test run
* allow gradle parallel builds It was disabled for gradle 4.x in
https://github.com/apache/cloudberry-pxf/commit/124115d1733fcea7c91514c98b2c58a1a0aaf81f
---
.github/workflows/pxf-ci.yml | 34 ++++++++++++++++++++++++++--------
server/gradle.properties | 2 +-
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/pxf-ci.yml b/.github/workflows/pxf-ci.yml
index 308de960..80cf5cb7 100644
--- a/.github/workflows/pxf-ci.yml
+++ b/.github/workflows/pxf-ci.yml
@@ -253,36 +253,56 @@ jobs:
retention-days: 1
build-pxf-cbdb-testcontainer-image:
- name: Build PXF-CBDB Testcontainer Image (${{ matrix.distro }})
+ name: Build Testcontainer Images (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: ubuntu
base_image:
apache/incubator-cloudberry:cbdb-build-ubuntu22.04-latest
- image_tag: pxf/cbdb-testcontainer:1
+ image_tag: pxf/cbdb-testcontainer-ubuntu:1
- distro: rocky9
base_image: apache/incubator-cloudberry:cbdb-build-rocky9-latest
image_tag: pxf/cbdb-testcontainer-rocky9:1
steps:
+ - name: Get month number
+ id: get-month
+ run: echo "month=$(/bin/date -u '+%Y-%m')" >> "$GITHUB_OUTPUT"
+
- name: Checkout PXF source
uses: actions/checkout@v4
with:
fetch-depth: 1
- - name: Build pxf-cbdb testcontainer image
+ - name: Restore testcontainer image cache
+ id: cache-tc
+ uses: actions/cache/restore@v4
+ with:
+ path: pxf-cbdb-testcontainer-${{ matrix.distro }}.tar
+ key: pxf-cbdb-testcontainer-${{ matrix.distro }}-${{
steps.get-month.outputs.month }}-${{
hashFiles('automation/src/main/resources/testcontainers/pxf-cbdb/**') }}
+
+ - name: Build testcontainer images
+ if: steps.cache-tc.outputs.cache-hit != 'true'
run: |
docker build \
--build-arg BASE_IMAGE=${{ matrix.base_image }} \
-t ${{ matrix.image_tag }} \
automation/src/main/resources/testcontainers/pxf-cbdb
- docker save ${{ matrix.image_tag }} >
/tmp/pxf-cbdb-testcontainer-${{ matrix.distro }}.tar
+ docker save ${{ matrix.image_tag }} >
"${GITHUB_WORKSPACE}/pxf-cbdb-testcontainer-${{ matrix.distro }}.tar"
+
+ - name: Save testcontainer image cache
+ # save cache from default branch only (reuse between PRs for the same
month and context)
+ if: steps.cache-tc.outputs.cache-hit != 'true' && github.ref ==
'refs/heads/main'
+ uses: actions/cache/save@v4
+ with:
+ path: pxf-cbdb-testcontainer-${{ matrix.distro }}.tar
+ key: pxf-cbdb-testcontainer-${{ matrix.distro }}-${{
steps.get-month.outputs.month }}-${{
hashFiles('automation/src/main/resources/testcontainers/pxf-cbdb/**') }}
- - name: Upload pxf-cbdb testcontainer image
+ - name: Upload testcontainer images
uses: actions/upload-artifact@v4
with:
name: pxf-cbdb-testcontainer-image-${{ matrix.distro }}
- path: /tmp/pxf-cbdb-testcontainer-${{ matrix.distro }}.tar
+ path: pxf-cbdb-testcontainer-${{ matrix.distro }}.tar
retention-days: 1
# Stage 2: Parallel test jobs using matrix strategy
@@ -364,7 +384,6 @@ jobs:
run: |
cd cloudberry-pxf
docker compose -f ci/docker/pxf-cbdb-dev/ubuntu/docker-compose.yml
down -v || true
- docker compose -f ci/docker/pxf-cbdb-dev/ubuntu/docker-compose.yml
build
docker compose -f ci/docker/pxf-cbdb-dev/ubuntu/docker-compose.yml up
-d
docker exec pxf-cbdb-dev sudo chown -R gpadmin:gpadmin
/home/gpadmin/workspace/cloudberry
docker cp /tmp/*.deb pxf-cbdb-dev:/tmp/
@@ -536,7 +555,6 @@ jobs:
run: |
cd cloudberry-pxf
docker compose -f ci/docker/pxf-cbdb-dev/rocky9/docker-compose.yml
down -v || true
- docker compose -f ci/docker/pxf-cbdb-dev/rocky9/docker-compose.yml
build
docker compose -f ci/docker/pxf-cbdb-dev/rocky9/docker-compose.yml up
-d
docker exec pxf-cbdb-dev sudo chown -R gpadmin:gpadmin
/home/gpadmin/workspace/cloudberry
docker cp /tmp/*.rpm pxf-cbdb-dev:/tmp/
diff --git a/server/gradle.properties b/server/gradle.properties
index e0f41634..ca150237 100644
--- a/server/gradle.properties
+++ b/server/gradle.properties
@@ -27,5 +27,5 @@ parquetVersion=1.15.2
awsJavaSdk=1.12.261
springBootVersion=2.7.18
org.gradle.daemon=true
-org.gradle.parallel=false
+org.gradle.parallel=true
orcVersion=1.7.11
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]