Skip to content
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

[CELEBORN-850][INFRA] Add SBT CI #1771

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .github/workflows/sbt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
#
# 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: Celeborn SBT CI

on:
push:
branches:
- main
- branch-*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm ... I'm afraid we should exclude branch-0.3 and lower

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't backport this to branch-0.3, I think it's safe.

pull_request:
branches:
- main
- branch-*

jobs:
service:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java:
- 8
- 11
- 17
steps:
- uses: actions/checkout@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
check-latest: false
- name: Test Service with SBT
run: |
build/sbt "clean; test"
- name: Upload test log
if: failure()
uses: actions/upload-artifact@v3
with:
name: service-${{ matrix.java }}-unit-test-log
path: |
**/target/test-reports/**

spark2:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java:
- 8
spark:
- '2.4'
steps:
- uses: actions/checkout@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
check-latest: false
- name: Test with SBT
run: |
build/sbt -Pspark-${{ matrix.spark }} "clean; celeborn-spark-group/test"
- name: Upload test log
if: failure()
uses: actions/upload-artifact@v3
with:
name: spark-${{ matrix.spark }}-unit-test-log
path: |
**/target/test-reports/**

spark3:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java:
- 8
- 11
- 17
spark:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'
exclude:
# SPARK-33772: Spark supports JDK 17 since 3.3.0
- java: 17
spark: '3.0'
- java: 17
spark: '3.1'
- java: 17
spark: '3.2'
steps:
- uses: actions/checkout@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
check-latest: false
- name: Test with SBT
run: |
build/sbt -Pspark-${{ matrix.spark }} "clean; celeborn-spark-group/test"
- name: Upload test log
if: failure()
uses: actions/upload-artifact@v3
with:
name: spark-${{ matrix.spark }}-unit-test-log
path: |
**/target/test-reports/**

flink:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java:
- 8
- 11
flink:
- '1.14'
- '1.15'
- '1.17'
steps:
- uses: actions/checkout@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
check-latest: false
- name: Test with SBT
run: |
build/sbt -Pflink-${{ matrix.flink }} "clean; celeborn-flink-group/test"
- name: Upload test log
if: failure()
uses: actions/upload-artifact@v3
with:
name: flink-${{ matrix.flink }}-unit-test-log
path: |
**/target/test-reports/**
34 changes: 29 additions & 5 deletions project/CelebornBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,23 @@ object CelebornCommonSettings {

// Make sure any tests in any project that uses Spark is configured for running well locally
Test / javaOptions ++= Seq(
"-Xmx4g"
"-Xmx4g",
"-XX:+IgnoreUnrecognizedVMOptions",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens=java.base/java.io=ALL-UNNAMED",
"--add-opens=java.base/java.net=ALL-UNNAMED",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
"--add-opens=java.base/java.util.concurrent=ALL-UNNAMED",
"--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.cs=ALL-UNNAMED",
"--add-opens=java.base/sun.security.action=ALL-UNNAMED",
"--add-opens=java.base/sun.util.calendar=ALL-UNNAMED",
"-Dio.netty.tryReflectionSetAccessible=true"
),

testOptions += Tests.Argument("-oF"),
Expand Down Expand Up @@ -125,7 +141,7 @@ object CelebornCommonSettings {
lazy val commonUnitTestDependencies = Seq(
"org.mockito" % "mockito-core" % "4.11.0" % "test",
"org.scalatest" %% "scalatest" % "3.2.16" % "test",
"junit" % "junit" % "4.12" % "test",
"junit" % "junit" % "4.13.2" % "test",
// https://www.scala-sbt.org/1.x/docs/Testing.html
"com.github.sbt" % "junit-interface" % "0.13.3" % "test")
}
Expand Down Expand Up @@ -489,7 +505,11 @@ trait SparkClientProjects {
val sparkVersion: String
val zstdJniVersion: String

def modules: Seq[Project] = Seq(sparkCommon, sparkClient, sparkIt, sparkClientShade)
def modules: Seq[Project] = Seq(sparkCommon, sparkClient, sparkIt, sparkGroup, sparkClientShade)

// for test only, don't use this group for any other projects
lazy val sparkGroup = (project withId "celeborn-spark-group")
.aggregate(sparkCommon, sparkClient, sparkIt)

def sparkCommon: Project = {
Project("celeborn-spark-common", file("client-spark/common"))
Expand Down Expand Up @@ -553,7 +573,7 @@ trait SparkClientProjects {
) ++ commonUnitTestDependencies
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be covered by spotless?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after experimentation, it seems that the maven spotless plugin is unable to format source files located outside the source directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a big deal.


def sparkClientShade: Project = {
Project(sparkClientShadedProjectName, file(sparkClientShadedProjectPath))
.dependsOn(sparkClient)
Expand Down Expand Up @@ -657,7 +677,11 @@ trait FlinkClientProjects {
lazy val flinkClientsDependency: ModuleID = "org.apache.flink" % "flink-clients" % flinkVersion % "test"
lazy val flinkRuntimeWebDependency: ModuleID = "org.apache.flink" % "flink-runtime-web" % flinkVersion % "test"

def modules: Seq[Project] = Seq(flinkCommon, flinkClient, flinkIt, flinkClientShade)
def modules: Seq[Project] = Seq(flinkCommon, flinkClient, flinkIt, flinkGroup, flinkClientShade)

// for test only, don't use this group for any other projects
lazy val flinkGroup = (project withId "celeborn-flink-group")
.aggregate(flinkCommon, flinkClient, flinkIt)

// get flink major version. e.g:
// 1.17.0 -> 1.17
Expand Down
Loading