-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Setup Validates runner tests for Spark4 runner #38478
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
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # 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: PostCommit Java PVR Spark4 Batch | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '45 5/6 * * *' | ||
| pull_request_target: | ||
| paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Java_PVR_Spark4_Batch.json'] | ||
| workflow_dispatch: | ||
|
|
||
| # This allows a subsequently queued workflow run to interrupt previous runs | ||
| concurrency: | ||
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}' | ||
| cancel-in-progress: true | ||
|
|
||
| #Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event | ||
| permissions: | ||
| actions: write | ||
| pull-requests: write | ||
| checks: write | ||
| contents: read | ||
| deployments: read | ||
| id-token: none | ||
| issues: write | ||
| discussions: read | ||
| packages: read | ||
| pages: read | ||
| repository-projects: read | ||
| security-events: read | ||
| statuses: read | ||
|
|
||
| env: | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }} | ||
| GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }} | ||
|
|
||
| jobs: | ||
| beam_PostCommit_Java_PVR_Spark4_Batch: | ||
| name: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) | ||
| runs-on: [self-hosted, ubuntu-24.04, main] | ||
| timeout-minutes: 240 | ||
| strategy: | ||
| matrix: | ||
| job_name: [beam_PostCommit_Java_PVR_Spark4_Batch] | ||
| job_phrase: [Run Java Spark4 PortableValidatesRunner Batch] | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event_name == 'pull_request_target' || | ||
| (github.event_name == 'schedule' && github.repository == 'apache/beam') | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Setup repository | ||
| uses: ./.github/actions/setup-action | ||
| with: | ||
| comment_phrase: ${{ matrix.job_phrase }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) | ||
| - name: Setup environment | ||
| uses: ./.github/actions/setup-environment-action | ||
| with: | ||
| java-version: 17 | ||
| - name: run PostCommit Java PortableValidatesRunner Spark4 Batch script | ||
| env: | ||
| CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}} | ||
| uses: ./.github/actions/gradle-command-self-hosted-action | ||
| with: | ||
| gradle-command: | | ||
| :runners:spark:4:job-server:validatesPortableRunnerBatch \ | ||
| :runners:spark:4:job-server:validatesPortableRunnerDocker | ||
| - name: Archive JUnit Test Results | ||
| uses: actions/upload-artifact@v7 | ||
| if: ${{ !success() }} | ||
| with: | ||
| name: JUnit Test Results | ||
| path: "**/build/reports/tests/" | ||
| - name: Publish JUnit Test Results | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| if: always() | ||
| with: | ||
| large_files: true | ||
| commit: '${{ env.prsha || env.GITHUB_SHA }}' | ||
| comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }} | ||
| files: '**/build/test-results/**/*.xml' | ||
| - name: Archive SpotBugs Results | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: SpotBugs Results | ||
| path: "**/build/reports/spotbugs/*.html" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # 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: PostCommit Java PVR Spark4 Streaming | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '45 5/6 * * *' | ||
| pull_request_target: | ||
| paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Java_PVR_Spark4_Streaming.json'] | ||
| workflow_dispatch: | ||
|
|
||
| # This allows a subsequently queued workflow run to interrupt previous runs | ||
| concurrency: | ||
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}' | ||
| cancel-in-progress: true | ||
|
|
||
| #Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event | ||
| permissions: | ||
| actions: write | ||
| pull-requests: write | ||
| checks: write | ||
| contents: read | ||
| deployments: read | ||
| id-token: none | ||
| issues: write | ||
| discussions: read | ||
| packages: read | ||
| pages: read | ||
| repository-projects: read | ||
| security-events: read | ||
| statuses: read | ||
|
|
||
| env: | ||
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | ||
| GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }} | ||
| GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }} | ||
|
|
||
| jobs: | ||
| beam_PostCommit_Java_PVR_Spark4_Streaming: | ||
| name: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) | ||
| runs-on: [self-hosted, ubuntu-24.04, main] | ||
| timeout-minutes: 180 | ||
| strategy: | ||
| matrix: | ||
| job_name: [beam_PostCommit_Java_PVR_Spark4_Streaming] | ||
| job_phrase: [Run Java Spark v4 PortableValidatesRunner Streaming] | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event_name == 'pull_request_target' || | ||
| (github.event_name == 'schedule' && github.repository == 'apache/beam') || | ||
| github.event.comment.body == 'Run Java Spark v4 PortableValidatesRunner Streaming' | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Setup repository | ||
| uses: ./.github/actions/setup-action | ||
| with: | ||
| comment_phrase: ${{ matrix.job_phrase }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) | ||
| - name: Setup environment | ||
| uses: ./.github/actions/setup-environment-action | ||
| with: | ||
| java-version: 17 | ||
| - name: run PostCommit Java PortableValidatesRunner Spark4 Streaming script | ||
| uses: ./.github/actions/gradle-command-self-hosted-action | ||
| with: | ||
| gradle-command: :runners:spark:4:job-server:validatesPortableRunnerStreaming | ||
| - name: Archive JUnit Test Results | ||
| uses: actions/upload-artifact@v7 | ||
| if: ${{ !success() }} | ||
| with: | ||
| name: JUnit Test Results | ||
| path: "**/build/reports/tests/" | ||
| - name: Publish JUnit Test Results | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| if: always() | ||
| with: | ||
| commit: '${{ env.prsha || env.GITHUB_SHA }}' | ||
| comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }} | ||
| files: '**/build/test-results/**/*.xml' | ||
| large_files: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,13 +36,23 @@ apply from: "$basePath/spark_runner.gradle" | |
|
|
||
| // Spark 4 always requires Java 17, so unconditionally add the --add-opens flags | ||
| // required by Kryo and other libraries that use reflection on JDK internals. | ||
| test { | ||
| tasks.withType(Test).configureEach { | ||
| jvmArgs "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.nio=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.util=ALL-UNNAMED", | ||
| "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED" | ||
| } | ||
|
|
||
| tasks.validatesStructuredStreamingRunnerBatch { | ||
| filter { | ||
| // TODO(https://github.com/apache/beam/issues/36841): currently failing with INTERNAL_ERROR] | ||
| // Couldn't find method fromByteArray with arguments | ||
| excludeTestsMatching 'org.apache.beam.sdk.transforms.CombineTest$BasicTests.testHotKeyCombining' | ||
| } | ||
| } | ||
|
Comment on lines
+46
to
+52
Contributor
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. To support Gradle configuration avoidance, it is recommended to use |
||
|
|
||
| tasks.validatesRunner.dependsOn(validatesStructuredStreamingRunnerBatch) | ||
|
Contributor
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. The PR description mentions adding "portable validates runner tests", but they are not included as a dependency for the |
||
|
|
||
| // Exclude DStream-based streaming tests from the shared-base copy: the Spark 4 module | ||
| // supports only structured streaming (batch) and does not include legacy DStream support. | ||
| // Streaming test utilities also depend on kafka.server.KafkaServerStartable which was | ||
|
|
||
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.
Spark 4 on Java 17 typically requires a more comprehensive set of
--add-opensflags to handle internal reflection used by Spark's memory management and serialization (e.g., Kryo). Missing flags likejava.lang,java.io, andjava.netcan lead toIllegalAccessExceptionin certain workloads.