This is an automated email from the ASF dual-hosted git repository.
snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 8906672c8 CI: GHCR docker.io mirror - testcontainers (#2725)
8906672c8 is described below
commit 8906672c8015e588a449acf39c2a6215199f8f97
Author: Robert Stupp <[email protected]>
AuthorDate: Wed Oct 1 10:07:22 2025 +0200
CI: GHCR docker.io mirror - testcontainers (#2725)
This change adds two "test environment setup" steps for our "Gradle CI"
workflow:
* Disable testcontainers startup checks, saving a few seconds, see
https://www.testcontainers.org/features/configuration/#disabling-the-startup-checks
* Use GitHub's docker.io mirror for containers. This works around potential
rate limits, and should also be a bit faster (network distance).
---
.github/actions/setup-test-env/action.yml | 61 +++++++++++++++++++++++++++++++
.github/workflows/gradle.yml | 6 +++
LICENSE | 1 +
3 files changed, 68 insertions(+)
diff --git a/.github/actions/setup-test-env/action.yml
b/.github/actions/setup-test-env/action.yml
new file mode 100644
index 000000000..06d41f888
--- /dev/null
+++ b/.github/actions/setup-test-env/action.yml
@@ -0,0 +1,61 @@
+# Copyright (C) 2020 Dremio
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# CODE_COPIED_TO_POLARIS Copied from Project Nessie v. 0.104.2
+
+name: 'Setup test environment'
+description: 'Disables testcontainers startup checks and sets up docker.io
mirror'
+runs:
+ using: "composite"
+ steps:
+ - name: Disable testcontainers startup checks
+ shell: bash
+ run: |
+ cat > ~/.testcontainers.properties <<!
+ # Disable startup checks - speeds up test execution by a few seconds.
+ # See
https://www.testcontainers.org/features/configuration/#disabling-the-startup-checks
+ checks.disable=true
+ !
+
+ - name: Setup docker.io mirror
+ shell: bash
+ run: |
+ cat > docker-io-mirror.conf <<!
+ [[registry]]
+ # In Nov. 2020, Docker rate-limits image pulling. To avoid hitting
these
+ # limits while testing, always use the google mirror for qualified and
+ # unqualified 'docker.io' images.
+ # Ref:
https://cloud.google.com/container-registry/docs/pulling-cached-images
+ prefix="docker.io"
+ location="mirror.gcr.io"
+ !
+ sudo mv docker-io-mirror.conf /etc/containers/registries.conf.d/
+
+ echo "::group::Added docker.io mirror"
+ cat /etc/containers/registries.conf.d/docker-io-mirror.conf
+ echo "::endgroup::"
+
+ echo "::group::Restarting Docker"
+ echo "ps auxww | grep docker before restart"
+ sudo ps auxww | grep docker
+ echo ""
+ sudo service docker restart
+ echo ""
+ echo "ps auxww | grep docker after restart"
+ sudo ps auxww | grep docker
+ echo "::endgroup::"
+
+ echo "::group::docker info"
+ docker info
+ echo "::endgroup::"
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 2fc2a813f..65989e4a1 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -53,6 +53,8 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'
+ - name: Setup test environment
+ uses: ./.github/actions/setup-test-env
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- name: Run unit tests
@@ -93,6 +95,8 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'
+ - name: Setup test environment
+ uses: ./.github/actions/setup-test-env
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- name: Run Quarkus runtime tests
@@ -200,6 +204,8 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'
+ - name: Setup test environment
+ uses: ./.github/actions/setup-test-env
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- name: Run integration tests
diff --git a/LICENSE b/LICENSE
index 54fe69af6..8f50538f8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -266,6 +266,7 @@ This product includes code from Project Nessie.
* .github/actions/ci-incr-build-cache-prepare/action.yml
* .github/actions/ci-incr-build-cache-save/action.yml
+* .github/actions/setup-test-env/action.yml
* build-logic/src/main/kotlin/LicenseFileValidation.kt
* build-logic/src/main/kotlin/copiedcode/CopiedCodeCheckerPlugin.kt
* build-logic/src/main/kotlin/copiedcode/CopiedCodeCheckerExtension.kt