-
Notifications
You must be signed in to change notification settings - Fork 0
MINOR: Build test artifacts once in CI #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
be074da
ee37e92
569333e
727c23f
123a2d5
4683d0f
a06fa44
639a888
f52284b
9ad2010
082c2ec
24fbc90
280e3c3
318e38a
d035fc8
5586821
53a9ccd
66660c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,28 +34,16 @@ permissions: | |
| contents: read | ||
|
|
||
| env: | ||
| BUILD_JDK: "17" | ||
| DOCKER_VOLUME_PREFIX: ".docker/" | ||
| MAVEN: 3.9.16 | ||
|
|
||
| jobs: | ||
| ubuntu: | ||
| name: AMD64 ${{ matrix.name }} JDK ${{ matrix.jdk }} Maven ${{ matrix.maven }} | ||
| build-java: | ||
| name: Build Java artifacts | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| jdk: [17, 21, 25] | ||
| maven: [3.9.16] | ||
| image: [ubuntu, conda-jni-cdata] | ||
| include: | ||
| - image: ubuntu | ||
| name: "Ubuntu" | ||
| - image: conda-jni-cdata | ||
| name: "Conda JNI" | ||
| env: | ||
| JDK: ${{ matrix.jdk }} | ||
| MAVEN: ${{ matrix.maven }} | ||
| steps: | ||
| - name: Checkout Arrow | ||
| uses: actions/checkout@v7 | ||
|
|
@@ -65,85 +53,197 @@ jobs: | |
| - name: Cache Docker Volumes | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: .docker | ||
| key: maven-${{ matrix.jdk }}-${{ matrix.maven }}-${{ hashFiles('compose.yaml', '**/pom.xml') }} | ||
| restore-keys: maven-${{ matrix.jdk }}-${{ matrix.maven }}- | ||
| - name: Execute Docker Build | ||
| path: .docker/maven-cache | ||
| key: java-build-${{ env.BUILD_JDK }}-${{ env.MAVEN }}-${{ hashFiles('compose.yaml', '**/pom.xml') }} | ||
| restore-keys: java-build-${{ env.BUILD_JDK }}-${{ env.MAVEN }}- | ||
| - name: Build without tests | ||
| env: | ||
| # Enables build caching, but not strictly required | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| JDK: ${{ env.BUILD_JDK }} | ||
| run: | | ||
| docker compose run \ | ||
| --rm \ | ||
| -e CI=true \ | ||
| -e "DEVELOCITY_ACCESS_KEY=$DEVELOCITY_ACCESS_KEY" \ | ||
| ${{ matrix.image }} | ||
| ubuntu-artifacts | ||
| sudo chown -R "$(id -u):$(id -g)" .docker | ||
| - name: Pack reusable artifacts | ||
| run: | | ||
| tar -czf java-build.tgz \ | ||
| .docker/java-build \ | ||
| .docker/maven-cache/repository/org/apache/arrow | ||
| - name: Upload reusable artifacts | ||
| uses: actions/upload-artifact@v5 | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [conventions] |
||
| with: | ||
| name: java-build | ||
| path: java-build.tgz | ||
| retention-days: 1 | ||
|
xborder marked this conversation as resolved.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ci-robustness] |
||
| - name: Exclude reactor artifacts from Maven dependency cache | ||
| run: rm -rf .docker/maven-cache/repository/org/apache/arrow | ||
|
|
||
| macos: | ||
| name: ${{ matrix.arch }} macOS ${{ matrix.macos }} Java JDK ${{ matrix.jdk }} | ||
| runs-on: macos-${{ matrix.macos }} | ||
| test-java: | ||
| name: ${{ matrix.name || format('AMD64 Ubuntu JDK {0} Maven 3.9.16', matrix.jdk) }} | ||
| needs: build-java | ||
| runs-on: ${{ matrix.os }} | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| jdk: [17, 21, 25] | ||
| os: [ubuntu-latest] | ||
| include: | ||
| - arch: AMD64 | ||
| jdk: 17 | ||
| macos: 15-intel | ||
| - arch: AArch64 | ||
| jdk: 17 | ||
| macos: latest | ||
| - name: AMD64 Windows Server 2022 Java JDK 17 | ||
| os: windows-latest | ||
| jdk: 17 | ||
| env: | ||
| JDK: ${{ matrix.jdk }} | ||
| steps: | ||
| - name: Checkout Arrow | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| - name: Set up Java | ||
| if: ${{ !matrix.compose_service }} | ||
| uses: actions/setup-java@v6 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: ${{ matrix.jdk }} | ||
| cache: 'maven' | ||
| - name: Build | ||
| - name: Cache Docker Volumes | ||
| if: ${{ matrix.compose_service }} | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: .docker/maven-cache | ||
| key: java-build-${{ env.BUILD_JDK }}-${{ env.MAVEN }}-${{ hashFiles('compose.yaml', '**/pom.xml') }} | ||
| restore-keys: java-build-${{ env.BUILD_JDK }}-${{ env.MAVEN }}- | ||
| - name: Download reusable artifacts | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| name: java-build | ||
| - name: Restore reusable artifacts | ||
| shell: bash | ||
| run: | | ||
| rm -rf \ | ||
| .docker/java-build \ | ||
| .docker/maven-cache/repository/org/apache/arrow | ||
| tar -xzf java-build.tgz | ||
| - name: Restore reusable artifacts for hosted runner | ||
| if: ${{ !matrix.compose_service }} | ||
| shell: bash | ||
| run: | | ||
| cp -a .docker/java-build/build build | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [correctness] This |
||
| rm -rf "${HOME}/.m2/repository/org/apache/arrow" | ||
| mkdir -p "${HOME}/.m2/repository/org/apache" | ||
| cp -a .docker/maven-cache/repository/org/apache/arrow "${HOME}/.m2/repository/org/apache/" | ||
| - name: Test prebuilt artifacts on macOS/Windows | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [test-coverage] macOS/Windows lanes no longer run
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is accepted. The binaries that get distributed are built in linux eitherway. as long as the tests run in all operating systems, it is fine |
||
| if: ${{ !matrix.compose_service }} | ||
| shell: bash | ||
| env: | ||
| ARROW_JAVA_TEST_PREBUILT: "ON" | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| run: ci/scripts/build.sh . build jni | ||
| - name: Test | ||
| run: ci/scripts/test.sh . build jni | ||
| - name: Test prebuilt artifacts on Ubuntu Docker | ||
| if: ${{ matrix.compose_service }} | ||
| shell: bash | ||
| env: | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| run: ci/scripts/test.sh . build jni | ||
| run: | | ||
| docker compose run \ | ||
| --rm \ | ||
| -e CI=true \ | ||
| -e "DEVELOCITY_ACCESS_KEY=$DEVELOCITY_ACCESS_KEY" \ | ||
| ${{ matrix.compose_service }} | ||
| - name: Exclude reactor artifacts from hosted Maven dependency cache | ||
| if: ${{ !matrix.compose_service && always() }} | ||
| shell: bash | ||
| run: rm -rf "${HOME}/.m2/repository/org/apache/arrow" | ||
|
|
||
| windows: | ||
| name: AMD64 Windows Server 2022 Java JDK ${{ matrix.jdk }} | ||
| runs-on: windows-latest | ||
| build-cdata: | ||
| name: Build C Data artifacts | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| jdk: [17] | ||
| steps: | ||
| - name: Checkout Arrow | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| - name: Set up Java | ||
| uses: actions/setup-java@v6 | ||
| - name: Cache Docker Volumes | ||
| uses: actions/cache@v6 | ||
| with: | ||
| java-version: ${{ matrix.jdk }} | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Build | ||
| shell: bash | ||
| path: .docker/maven-cache | ||
| key: cdata-${{ env.BUILD_JDK }}-${{ env.MAVEN }}-${{ hashFiles('compose.yaml', '**/pom.xml') }} | ||
| restore-keys: cdata-${{ env.BUILD_JDK }}-${{ env.MAVEN }}- | ||
| - name: Build C Data without tests | ||
| env: | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| run: ci/scripts/build.sh . build jni | ||
| - name: Test | ||
| shell: bash | ||
| JDK: ${{ env.BUILD_JDK }} | ||
| run: | | ||
| docker compose run \ | ||
| --rm \ | ||
| -e CI=true \ | ||
| -e "DEVELOCITY_ACCESS_KEY=$DEVELOCITY_ACCESS_KEY" \ | ||
| cdata-artifacts | ||
| sudo chown -R "$(id -u):$(id -g)" .docker | ||
| - name: Pack reusable C Data artifacts | ||
| run: | | ||
| tar -czf cdata-build.tgz \ | ||
| .docker/cdata-build \ | ||
| .docker/cdata-jni-dist \ | ||
| .docker/maven-cache/repository/org/apache/arrow | ||
| - name: Upload reusable C Data artifacts | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: cdata-build | ||
| path: cdata-build.tgz | ||
| retention-days: 1 | ||
| - name: Exclude reactor artifacts from Maven dependency cache | ||
| run: rm -rf .docker/maven-cache/repository/org/apache/arrow | ||
|
|
||
| test-cdata: | ||
| name: AMD64 Conda JNI JDK ${{ matrix.jdk }} Maven 3.9.16 | ||
| needs: build-cdata | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| jdk: [17, 21, 25] | ||
| env: | ||
| JDK: ${{ matrix.jdk }} | ||
| steps: | ||
| - name: Checkout Arrow | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| submodules: recursive | ||
| - name: Cache Docker Volumes | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: .docker/maven-cache | ||
| key: cdata-${{ env.BUILD_JDK }}-${{ env.MAVEN }}-${{ hashFiles('compose.yaml', '**/pom.xml') }} | ||
| restore-keys: cdata-${{ env.BUILD_JDK }}-${{ env.MAVEN }}- | ||
| - name: Download reusable C Data artifacts | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| name: cdata-build | ||
| - name: Restore reusable C Data artifacts | ||
| run: | | ||
| rm -rf \ | ||
| .docker/cdata-build \ | ||
| .docker/cdata-jni-dist \ | ||
| .docker/maven-cache/repository/org/apache/arrow | ||
| tar -xzf cdata-build.tgz | ||
| - name: Test C Data without compiler lifecycle | ||
| env: | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| run: ci/scripts/test.sh . build jni | ||
| run: | | ||
| docker compose run \ | ||
| --rm \ | ||
| -e CI=true \ | ||
| -e "DEVELOCITY_ACCESS_KEY=$DEVELOCITY_ACCESS_KEY" \ | ||
| cdata-test-prebuilt | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[efficiency] Arrow snapshot artifacts travel into every Docker test job twice: once inside the actions/cache of the whole
.docker/maven-cache, and again in this tgz — and the cached copy is immediatelyrm -rf'd by the restore step (~50–150MB × 3 rows, same pattern on the cdata side). Cheaper: droprepository/org/apache/arrowfrom the cache (delete it after packing, or exclude it from the cache path) so the tgz is its sole carrier. Related: the 9 test jobs usefetch-depth: 0+ recursive submodules but never need history —fetch-depth: 1saves 1–3 min each.