diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml deleted file mode 100644 index 1ae94f2741..0000000000 --- a/.github/workflows/pr_build.yml +++ /dev/null @@ -1,344 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -name: PR Build - -concurrency: - group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} - cancel-in-progress: true - -on: - push: - paths-ignore: - - "doc/**" - - "docs/**" - - "**.md" - pull_request: - paths-ignore: - - "doc/**" - - "docs/**" - - "**.md" - # manual trigger - # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow - workflow_dispatch: - -env: - RUST_VERSION: stable - -jobs: - - # run Comet test with full matrix of Java and Scala versions for the latest supported 3.5.x release - linux-test: - strategy: - matrix: - os: [ubuntu-latest] - java_version: [11, 17] - test-target: [rust, java] - spark-version: ['3.5'] - scala-version: ['2.12', '2.13'] - is_push_event: - - ${{ github.event_name == 'push' }} - exclude: # exclude java 11 for pull_request event - - java_version: 11 - is_push_event: false - fail-fast: false - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }} - runs-on: ${{ matrix.os }} - container: - image: amd64/rust - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - if: matrix.test-target == 'rust' - name: Rust test steps - uses: ./.github/actions/rust-test - - if: matrix.test-target == 'java' - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} - # upload test reports only for java 17 - upload-test-reports: ${{ matrix.java_version == '17' }} - - # run Comet tests for older 3.5.x releases with one java and scala versions - linux-test-35-minor-versions: - strategy: - matrix: - os: [ubuntu-latest] - java_version: [17] - test-target: [java] - spark-version: ['3.5'] - spark-patch-version: ['3.5.2', '3.5.3', '3.5.4'] - scala-version: ['2.12'] - is_push_event: - - ${{ github.event_name == 'push' }} - fail-fast: false - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-patch-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }} - runs-on: ${{ matrix.os }} - container: - image: amd64/rust - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - if: matrix.test-target == 'rust' - name: Rust test steps - uses: ./.github/actions/rust-test - - if: matrix.test-target == 'java' - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: "-Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} -Dspark.version=${{ matrix.spark-patch-version }}" - # upload test reports only for java 17 - upload-test-reports: ${{ matrix.java_version == '17' }} - - linux-test-native-datafusion-scan: - strategy: - matrix: - os: [ubuntu-latest] - scan_impl: ['native_datafusion', 'native_iceberg_compat'] - java_version: [17] - test-target: [rust, java] - spark-version: ['3.5'] - scala-version: ['2.12'] - is_push_event: - - ${{ github.event_name == 'push' }} - fail-fast: false - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }}-${{ matrix.scan_impl }} - runs-on: ${{ matrix.os }} - env: - COMET_PARQUET_SCAN_IMPL: ${{ matrix.scan_impl }} - container: - image: amd64/rust - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - if: matrix.test-target == 'rust' - name: Rust test steps - uses: ./.github/actions/rust-test - - if: matrix.test-target == 'java' - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} - # upload test reports only for java 17 - upload-test-reports: ${{ matrix.java_version == '17' }} - - linux-test-with-spark4_0: - strategy: - matrix: - os: [ubuntu-latest] - java_version: [17] - test-target: [java] - spark-version: ['4.0'] - is_push_event: - - ${{ github.event_name == 'push' }} - fail-fast: false - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}/${{ matrix.test-target }} - runs-on: ${{ matrix.os }} - container: - image: amd64/rust - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }} - upload-test-reports: true - - linux-test-with-old-spark: - strategy: - matrix: - os: [ubuntu-latest] - java_version: [11, 17] - test-target: [java] - spark-version: ['3.4'] - scala-version: ['2.12', '2.13'] - fail-fast: false - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }} - runs-on: ${{ matrix.os }} - container: - image: amd64/rust - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} - - macos-test: - strategy: - matrix: - os: [macos-13] - java_version: [11, 17] - test-target: [rust, java] - spark-version: ['3.4', '3.5'] - scala-version: ['2.12', '2.13'] - fail-fast: false - if: github.event_name == 'push' - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-macos-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - if: matrix.test-target == 'rust' - name: Rust test steps - uses: ./.github/actions/rust-test - - if: matrix.test-target == 'java' - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} - - macos-aarch64-test: - strategy: - matrix: - java_version: [11, 17] - test-target: [rust, java] - spark-version: ['3.4', '3.5'] - scala-version: ['2.12', '2.13'] - is_push_event: - - ${{ github.event_name == 'push' }} - exclude: # exclude java 11 for pull_request event - - java_version: 11 - is_push_event: false - fail-fast: false - name: macos-14(Silicon)/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }} - runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-macos-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - jdk-architecture: aarch64 - protoc-architecture: aarch_64 - - if: matrix.test-target == 'rust' - name: Rust test steps - uses: ./.github/actions/rust-test - - if: matrix.test-target == 'java' - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} - - macos-test-with-spark4_0: - strategy: - matrix: - os: [macos-13] - java_version: [17] - test-target: [java] - spark-version: ['4.0'] - fail-fast: false - if: github.event_name == 'push' - name: ${{ matrix.os }}/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}/${{ matrix.test-target }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-macos-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }} - upload-test-reports: true - - macos-aarch64-test-with-spark4_0: - strategy: - matrix: - java_version: [17] - test-target: [java] - spark-version: ['4.0'] - is_push_event: - - ${{ github.event_name == 'push' }} - exclude: # exclude java 11 for pull_request event - - java_version: 11 - is_push_event: false - fail-fast: false - name: macos-14(Silicon)/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}/${{ matrix.test-target }} - runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-macos-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - jdk-architecture: aarch64 - protoc-architecture: aarch_64 - - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }} - upload-test-reports: true - - macos-aarch64-test-with-old-spark: - strategy: - matrix: - java_version: [17] - test-target: [java] - spark-version: ['3.4'] - scala-version: ['2.12', '2.13'] - exclude: - - java_version: 8 - fail-fast: false - name: macos-14(Silicon)/java ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}}/${{ matrix.test-target }} - runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - name: Setup Rust & Java toolchain - uses: ./.github/actions/setup-macos-builder - with: - rust-version: ${{env.RUST_VERSION}} - jdk-version: ${{ matrix.java_version }} - jdk-architecture: aarch64 - protoc-architecture: aarch_64 - - if: matrix.test-target == 'java' - name: Java test steps - uses: ./.github/actions/java-test - with: - maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }} - diff --git a/.github/workflows/pr_build_new.yml b/.github/workflows/pr_build_new.yml new file mode 100644 index 0000000000..802a6ef0c3 --- /dev/null +++ b/.github/workflows/pr_build_new.yml @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +name: PR Build (Linux + Spark 4) + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +on: + push: + paths-ignore: + - "doc/**" + - "docs/**" + - "**.md" + pull_request: + paths-ignore: + - "doc/**" + - "docs/**" + - "**.md" + # manual trigger + # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow + workflow_dispatch: + +jobs: + + create-docker-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build image + uses: docker/build-push-action@v5 + with: + context: . + file: dev/Dockerfile + push: true + tags: comet-build:${{ github.sha }} + + + linux-test: + needs: create-docker-image + strategy: + matrix: + spark_version: ['3.5', '4.0'] + suites: + - { name: "fuzz", value: "org.apache.comet.CometFuzzTestSuite" } + - { name: "shuffle", value: "org.apache.comet.exec.CometShuffleSuite,org.apache.comet.exec.CometAsyncShuffleSuite,org.apache.comet.exec.DisableAQECometShuffleSuite,org.apache.comet.exec.DisableAQECometAsyncShuffleSuite" } + - { name: "parquet", value: "org.apache.comet.parquet.ParquetReadV1Suite,org.apache.comet.parquet.ParquetReadV2Suite" } + - { name: "exec", value: "org.apache.comet.exec.CometExecSuite,org.apache.comet.CometExpressionSuite" } + is_push_event: + - ${{ github.event_name == 'push' }} + fail-fast: false + name: ubuntu-spark-${{ matrix.spark_version }}-${{ matrix.suites.name }} + runs-on: ubuntu-latest + steps: + - name: Run Comet test suite + run: docker run comet-build:latest make test PROFILES="--batch-mode -Pspark-${{ matrix.spark_version }} -DwildcardSuites=${{ matrix.suites.value }}" diff --git a/Makefile b/Makefile index 9382d1aeee..c27927c540 100644 --- a/Makefile +++ b/Makefile @@ -30,13 +30,13 @@ core: cd native && cargo build test-rust: # We need to compile CometException so that the cargo test can pass - ./mvnw compile -pl common -DskipTests $(PROFILES) + ./mvnw compile -pl common -DskipTests $(PROFILES) -Dmaven.gitcommitid.skip=true cd native && cargo build && \ RUST_BACKTRACE=1 cargo test jvm: ./mvnw clean package -DskipTests $(PROFILES) test-jvm: core - SPARK_HOME=`pwd` COMET_CONF_DIR=$(shell pwd)/conf RUST_BACKTRACE=1 ./mvnw verify $(PROFILES) + SPARK_HOME=`pwd` COMET_CONF_DIR=$(shell pwd)/conf RUST_BACKTRACE=1 ./mvnw verify $(PROFILES) -Dmaven.gitcommitid.skip=true test: test-rust test-jvm clean: cd native && cargo clean diff --git a/dev/Dockerfile b/dev/Dockerfile new file mode 100644 index 0000000000..aeeda1b60c --- /dev/null +++ b/dev/Dockerfile @@ -0,0 +1,77 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# + +FROM ubuntu:24.10 + +# Install dependencies +RUN apt-get update && apt-get install -y \ + curl \ + unzip \ + git \ + make \ + build-essential \ + ca-certificates \ + pkg-config \ + libssl-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install protoc +ENV PROTOC_VERSION=24.4 + +RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip \ + && unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local \ + && rm protoc-${PROTOC_VERSION}-linux-x86_64.zip + +# Install Rust +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustc --version && cargo --version + +# Install Java +RUN apt-get update && apt-get install -y \ + openjdk-17-jdk \ + && rm -rf /var/lib/apt/lists/* +ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 +ENV PATH="$JAVA_HOME/bin:$PATH" +RUN java -version + +# Add Comet sources +RUN mkdir /comet +WORKDIR /comet +COPY ./.mvn /comet/.mvn +COPY ./common /comet/common +COPY ./dev /comet/dev +COPY ./docs /comet/docs +COPY ./fuzz-testing /comet/fuzz-testing +COPY ./spark /comet/spark +COPY ./spark-integration /comet/spark-integration +COPY ./native /comet/native +COPY ./pom.xml /comet +COPY ./Makefile /comet +COPY ./rust-toolchain.toml /comet +COPY ./mvnw /comet +COPY ./scalafmt.conf /comet +COPY ./.scalafix.conf /comet + +# run make to download and cache dependencies and build Rust code +RUN make + +# Shallow clone of Apache Spark and apply diffs +#RUN git clone -b 'v3.5.5' --single-branch --depth 1 https://github.com/apache/spark.git apache-spark \ +# && cd apache-spark \ +# && git apply ../dev/diffs/3.5.5.diff +