|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# Runs Delta Lake's OWN test suite against Comet (contrib-delta variant). |
| 19 | +# Mirrors the PR #3932 workflow but uses the contrib-delta build path: |
| 20 | +# Comet is installed with `-Pcontrib-delta`, the native library is built |
| 21 | +# with `--features contrib-delta`, and diffs live under |
| 22 | +# `contrib/delta/dev/diffs/`. |
| 23 | +# |
| 24 | +# The smoke job runs first as a cheap fail-fast (3 tests asserting Comet |
| 25 | +# is wired into Delta's test SparkSession). The full job runs Delta's |
| 26 | +# entire test suite for the matching Delta version with Comet enabled, |
| 27 | +# and only fires after the matching smoke cell passes. |
| 28 | + |
| 29 | +name: Delta Lake Regression Tests (contrib-delta) |
| 30 | + |
| 31 | +concurrency: |
| 32 | + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} |
| 33 | + cancel-in-progress: true |
| 34 | + |
| 35 | +on: |
| 36 | + push: |
| 37 | + branches: |
| 38 | + - main |
| 39 | + paths-ignore: |
| 40 | + - "benchmarks/**" |
| 41 | + - "doc/**" |
| 42 | + - "docs/**" |
| 43 | + - "**.md" |
| 44 | + - "dev/changelog/*.md" |
| 45 | + - "native/core/benches/**" |
| 46 | + - "native/spark-expr/benches/**" |
| 47 | + - "spark/src/test/scala/org/apache/spark/sql/benchmark/**" |
| 48 | + pull_request: |
| 49 | + paths-ignore: |
| 50 | + - "benchmarks/**" |
| 51 | + - "doc/**" |
| 52 | + - "docs/**" |
| 53 | + - "**.md" |
| 54 | + - "dev/changelog/*.md" |
| 55 | + - "native/core/benches/**" |
| 56 | + - "native/spark-expr/benches/**" |
| 57 | + - "spark/src/test/scala/org/apache/spark/sql/benchmark/**" |
| 58 | + workflow_dispatch: |
| 59 | + |
| 60 | +permissions: |
| 61 | + contents: read |
| 62 | + |
| 63 | +env: |
| 64 | + RUST_VERSION: stable |
| 65 | + RUST_BACKTRACE: 1 |
| 66 | + RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd" |
| 67 | + |
| 68 | +jobs: |
| 69 | + # Build libcomet ONCE with --features contrib-delta and share via artifact. |
| 70 | + # Identical to the build-native job in delta_contrib_test.yml; kept |
| 71 | + # separate to let this workflow run independently on workflow_dispatch. |
| 72 | + build-native: |
| 73 | + name: Build Native Library (contrib-delta) |
| 74 | + runs-on: ubuntu-24.04 |
| 75 | + container: |
| 76 | + image: amd64/rust |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v6 |
| 79 | + |
| 80 | + - name: Setup Rust & Java toolchain |
| 81 | + uses: ./.github/actions/setup-builder |
| 82 | + with: |
| 83 | + rust-version: ${{ env.RUST_VERSION }} |
| 84 | + jdk-version: 17 |
| 85 | + |
| 86 | + - name: Restore Cargo cache |
| 87 | + uses: actions/cache/restore@v5 |
| 88 | + with: |
| 89 | + path: | |
| 90 | + ~/.cargo/registry |
| 91 | + ~/.cargo/git |
| 92 | + native/target |
| 93 | + key: ${{ runner.os }}-cargo-ci-contrib-delta-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml', 'contrib/delta/native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs', 'contrib/delta/native/**/*.rs') }} |
| 94 | + restore-keys: | |
| 95 | + ${{ runner.os }}-cargo-ci-contrib-delta-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml', 'contrib/delta/native/**/Cargo.toml') }}- |
| 96 | +
|
| 97 | + - name: Build native library with contrib-delta |
| 98 | + run: | |
| 99 | + cd native && cargo build --profile ci --features contrib-delta |
| 100 | + env: |
| 101 | + RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd" |
| 102 | + |
| 103 | + - name: Save Cargo cache |
| 104 | + uses: actions/cache/save@v5 |
| 105 | + if: github.ref == 'refs/heads/main' |
| 106 | + with: |
| 107 | + path: | |
| 108 | + ~/.cargo/registry |
| 109 | + ~/.cargo/git |
| 110 | + native/target |
| 111 | + key: ${{ runner.os }}-cargo-ci-contrib-delta-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml', 'contrib/delta/native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs', 'contrib/delta/native/**/*.rs') }} |
| 112 | + |
| 113 | + - name: Upload native library |
| 114 | + uses: actions/upload-artifact@v7 |
| 115 | + with: |
| 116 | + name: native-lib-delta-regression |
| 117 | + path: native/target/ci/libcomet.so |
| 118 | + retention-days: 1 |
| 119 | + |
| 120 | + # Smoke: 3 tests proving Comet is registered and active in Delta's |
| 121 | + # SparkSession. Fails the workflow before spending time on the full |
| 122 | + # suite if config-wiring has drifted. |
| 123 | + delta-smoke: |
| 124 | + needs: build-native |
| 125 | + strategy: |
| 126 | + matrix: |
| 127 | + include: |
| 128 | + - delta-version: '3.3.2' |
| 129 | + spark-short: '3.5' |
| 130 | + - delta-version: '4.0.0' |
| 131 | + spark-short: '4.0' |
| 132 | + - delta-version: '4.1.0' |
| 133 | + spark-short: '4.1' |
| 134 | + fail-fast: false |
| 135 | + name: smoke/delta-${{ matrix.delta-version }} |
| 136 | + runs-on: ubuntu-24.04 |
| 137 | + container: |
| 138 | + image: amd64/rust |
| 139 | + env: |
| 140 | + SPARK_LOCAL_IP: localhost |
| 141 | + steps: |
| 142 | + - uses: actions/checkout@v6 |
| 143 | + |
| 144 | + - name: Setup Rust & Java toolchain |
| 145 | + uses: ./.github/actions/setup-builder |
| 146 | + with: |
| 147 | + rust-version: ${{ env.RUST_VERSION }} |
| 148 | + jdk-version: 17 |
| 149 | + |
| 150 | + - name: Download native library |
| 151 | + uses: actions/download-artifact@v8 |
| 152 | + with: |
| 153 | + name: native-lib-delta-regression |
| 154 | + # run-regression.sh's FAST=1 path expects native/target/release/ |
| 155 | + path: native/target/release/ |
| 156 | + |
| 157 | + - name: Run Delta smoke test with Comet |
| 158 | + run: | |
| 159 | + FAST=1 bash contrib/delta/dev/run-regression.sh ${{ matrix.delta-version }} smoke |
| 160 | +
|
| 161 | + - name: Upload regression log on failure |
| 162 | + if: failure() |
| 163 | + uses: actions/upload-artifact@v7 |
| 164 | + with: |
| 165 | + name: smoke-log-delta-${{ matrix.delta-version }} |
| 166 | + path: target/delta-regression-logs/ |
| 167 | + retention-days: 5 |
| 168 | + |
| 169 | + # Full Delta suite under Comet. Gated on the matching smoke cell. |
| 170 | + delta-full: |
| 171 | + needs: delta-smoke |
| 172 | + if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' |
| 173 | + strategy: |
| 174 | + matrix: |
| 175 | + include: |
| 176 | + - delta-version: '3.3.2' |
| 177 | + spark-short: '3.5' |
| 178 | + - delta-version: '4.0.0' |
| 179 | + spark-short: '4.0' |
| 180 | + - delta-version: '4.1.0' |
| 181 | + spark-short: '4.1' |
| 182 | + fail-fast: false |
| 183 | + name: full/delta-${{ matrix.delta-version }} |
| 184 | + runs-on: ubuntu-24.04 |
| 185 | + container: |
| 186 | + image: amd64/rust |
| 187 | + env: |
| 188 | + SPARK_LOCAL_IP: localhost |
| 189 | + steps: |
| 190 | + - uses: actions/checkout@v6 |
| 191 | + |
| 192 | + - name: Setup Rust & Java toolchain |
| 193 | + uses: ./.github/actions/setup-builder |
| 194 | + with: |
| 195 | + rust-version: ${{ env.RUST_VERSION }} |
| 196 | + jdk-version: 17 |
| 197 | + |
| 198 | + - name: Download native library |
| 199 | + uses: actions/download-artifact@v8 |
| 200 | + with: |
| 201 | + name: native-lib-delta-regression |
| 202 | + path: native/target/release/ |
| 203 | + |
| 204 | + - name: Run Delta full suite with Comet |
| 205 | + timeout-minutes: 240 |
| 206 | + run: | |
| 207 | + FAST=1 bash contrib/delta/dev/run-regression.sh ${{ matrix.delta-version }} full |
| 208 | +
|
| 209 | + - name: Upload regression log on failure |
| 210 | + if: failure() |
| 211 | + uses: actions/upload-artifact@v7 |
| 212 | + with: |
| 213 | + name: full-log-delta-${{ matrix.delta-version }} |
| 214 | + path: target/delta-regression-logs/ |
| 215 | + retention-days: 5 |
0 commit comments