Skip to content

[SPARK-56162] Prevent Jackson from using reflection on final fields d… #1538

[SPARK-56162] Prevent Jackson from using reflection on final fields d…

[SPARK-56162] Prevent Jackson from using reflection on final fields d… #1538

name: Build and test
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancel previous PR build and test
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true
jobs:
license-check:
name: "License Check"
runs-on: ubuntu-slim
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Check license header
uses: apache/skywalking-eyes@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config: .github/.licenserc.yaml
build-test:
name: "Build Test CI"
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
max-parallel: 20
matrix:
os: [ 'ubuntu-slim', 'ubuntu-24.04-arm' ]
java-version: [ 17, 21, 25, 26 ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
cache: 'gradle'
- name: Cache Gradle Java Toolchain
uses: actions/cache@v4
with:
path: ~/.gradle/jdks/
key: gradle-jdks-${{ matrix.os }}-${{ matrix.java-version }}
- name: Build with Gradle
run: |
if [[ "${{ matrix.java-version }}" == "25" || "${{ matrix.java-version }}" == "26" ]]; then
export JDK_JAVA_OPTIONS="-XX:+UseCompactObjectHeaders"
fi
./gradlew build
build-image:
name: "Build Operator Image CI"
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 26
uses: actions/setup-java@v5
with:
java-version: 26
distribution: 'zulu'
cache: 'gradle'
- name: Build Operator Image
run: |
./gradlew buildDockerImage
k8s-integration-tests:
name: "K8s Integration Tests"
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
max-parallel: 20
matrix:
kubernetes-version:
- "1.33.0"
- "1.35.0"
mode:
- dynamic
- static
- selector
test-group:
- spark-versions
- python
- state-transition
- resource-retain-duration
- resource-retain-on-failure
- resource-selector
- watched-namespaces
- driver-start-timeout
exclude:
- mode: dynamic
test-group: spark-versions
- mode: dynamic
test-group: python
- mode: dynamic
test-group: state-transition
- mode: dynamic
test-group: resource-retain-duration
- mode: dynamic
test-group: resource-retain-on-failure
- mode: dynamic
test-group: resource-selector
- mode: dynamic
test-group: driver-start-timeout
- mode: static
test-group: watched-namespaces
- mode: static
test-group: resource-selector
- mode: selector
test-group: spark-versions
- mode: selector
test-group: python
- mode: selector
test-group: state-transition
- mode: selector
test-group: resource-retain-duration
- mode: selector
test-group: resource-retain-on-failure
- mode: selector
test-group: watched-namespaces
- mode: selector
test-group: driver-start-timeout
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 26
uses: actions/setup-java@v5
with:
java-version: 26
distribution: 'zulu'
cache: 'gradle'
- name: Set up Minikube
uses: medyagh/[email protected]
with:
cache: true
kubernetes-version: ${{ matrix.kubernetes-version }}
cpus: 3
memory: 10240m
- name: Set Up Go
uses: actions/setup-go@v5
- name: Set Up Chainsaw
run: |
go install github.com/kyverno/chainsaw@latest
- name: Print K8S pods and nodes info
run: |
kubectl get pods -A
kubectl describe node
- name: Run Spark K8s Operator on K8S with Dynamic Configuration Disabled
if: matrix.mode == 'static'
run: |
eval $(minikube docker-env)
./gradlew buildDockerImage
helm install spark --create-namespace -f build-tools/helm/spark-kubernetes-operator/values.yaml build-tools/helm/spark-kubernetes-operator/
helm test spark
# Use remote host' s docker image
minikube docker-env --unset
- name: Run E2E Test with Dynamic Configuration Disabled
if: matrix.mode == 'static'
run: |
chainsaw test --test-dir ./tests/e2e/${{ matrix.test-group }} --parallel 1
- name: Run Spark K8s Operator on K8S with Dynamic Configuration Enabled
if: matrix.mode == 'dynamic'
run: |
eval $(minikube docker-env)
./gradlew buildDockerImage
helm install spark --create-namespace -f \
build-tools/helm/spark-kubernetes-operator/values.yaml -f \
tests/e2e/helm/dynamic-config-values.yaml \
build-tools/helm/spark-kubernetes-operator/
minikube docker-env --unset
- name: Run E2E Test with Dynamic Configuration Enabled
if: matrix.mode == 'dynamic'
run: |
chainsaw test --test-dir ./tests/e2e/${{ matrix.test-group }} --parallel 1
- name: Run Spark K8s Operator on K8S with Resource Selector Enabled
if: matrix.mode == 'selector'
run: |
eval $(minikube docker-env)
./gradlew buildDockerImage
helm install spark --create-namespace -f \
build-tools/helm/spark-kubernetes-operator/values.yaml -f \
tests/e2e/helm/selector-config-values.yaml \
build-tools/helm/spark-kubernetes-operator/
minikube docker-env --unset
- name: Run E2E Test with Resource Selector Enabled
if: matrix.mode == 'selector'
run: |
chainsaw test --test-dir ./tests/e2e/${{ matrix.test-group }} --parallel 1
helm-tests:
name: "Helm Tests"
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
max-parallel: 20
matrix:
kubernetes-version:
- "1.35.0"
test-group:
- configmap-metadata
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 26
uses: actions/setup-java@v5
with:
java-version: 26
distribution: 'zulu'
cache: 'gradle'
- name: Set up Minikube
uses: medyagh/[email protected]
with:
cache: true
kubernetes-version: ${{ matrix.kubernetes-version }}
cpus: 3
memory: 10240m
- name: Print K8S pods and nodes info
run: |
kubectl get pods -A
kubectl describe node
- name: Run Spark K8s Operator Helm Tests
run: |
eval $(minikube docker-env)
./gradlew buildDockerImage
helm install spark --create-namespace -f \
build-tools/helm/spark-kubernetes-operator/values.yaml -f \
tests/e2e/helm/helm-test-values/${{ matrix.test-group }}/values.yaml \
build-tools/helm/spark-kubernetes-operator/
minikube docker-env --unset
helm test spark
lint:
name: "Linter and documentation"
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 26
uses: actions/setup-java@v5
with:
java-version: 26
distribution: 'zulu'
cache: 'gradle'
- name: Cache Gradle Java Toolchain
uses: actions/cache@v4
with:
path: ~/.gradle/jdks/
key: gradle-jdks-lint
- name: Linters
run: |
./gradlew build -x test
- name: Javadoc Generation
run: |
./gradlew javadoc
- name: Validate helm chart linting
run: |
helm lint --strict build-tools/helm/spark-kubernetes-operator