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-856] Add mapreduce integration test #2073

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
31 changes: 31 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,34 @@ jobs:
name: flink-${{ matrix.flink }}-unit-test-log
path: |
**/target/unit-tests.log

mr:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java:
- 8
- 11
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 Maven
run: |
PROFILES="-Pgoogle-mirror,mr"
TEST_MODULES="client-mr/mr,client-mr/mr-shaded,tests/mr-it"
build/mvn $PROFILES -pl $TEST_MODULES -am clean install -DskipTests
build/mvn $PROFILES -pl $TEST_MODULES test
- name: Upload test log
if: failure()
uses: actions/upload-artifact@v3
with:
name: mr-unit-test-log
path: |
**/target/unit-tests.log
27 changes: 27 additions & 0 deletions .github/workflows/sbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,30 @@ jobs:
name: flink-${{ matrix.flink }}-unit-test-log
path: |
**/target/test-reports/**

mr:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java:
- 8
- 11
Copy link
Contributor

Choose a reason for hiding this comment

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

jdk 17?

Copy link
Contributor

Choose a reason for hiding this comment

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

Add jdk 17 is reasonable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

guice 4.0 does not support JDK17 - InaccessibleObjectException

guice 4.0 + JDK17

2023-11-22T10:53:55,768 ERROR [Listener at 0.0.0.0/56065] org.apache.celeborn.mapreduce.v2.app.MRAppMasterWithCeleborn: Error starting MRAppMaster
java.lang.ExceptionInInitializerError: null
	at com.google.inject.internal.cglib.reflect.$FastClassEmitter.<init>(FastClassEmitter.java:67) ~[guice-4.0.jar:?]
	at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass(FastClass.java:72) ~[guice-4.0.jar:?]
	at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[guice-4.0.jar:?]
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:216) ~[guice-4.0.jar:?]
	at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:64) ~[guice-4.0.jar:?]
	at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:204) ~[guice-4.0.jar:?]
	at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.<init>(ProviderMethod.java:256) ~[guice-4.0.jar:?]
	at com.google.inject.internal.ProviderMethod.create(ProviderMethod.java:71) ~[guice-4.0.jar:?]
	at com.google.inject.internal.ProviderMethodsModule.createProviderMethod(ProviderMethodsModule.java:275) ~[guice-4.0.jar:?]
	at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:144) ~[guice-4.0.jar:?]
	at com.google.inject.internal.ProviderMethodsModule.configure(ProviderMethodsModule.java:123) ~[guice-4.0.jar:?]
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) ~[guice-4.0.jar:?]
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:349) ~[guice-4.0.jar:?]
	at com.google.inject.AbstractModule.install(AbstractModule.java:122) ~[guice-4.0.jar:?]
	at com.google.inject.servlet.ServletModule.configure(ServletModule.java:52) ~[guice-servlet-4.0.jar:?]
	at com.google.inject.AbstractModule.configure(AbstractModule.java:62) ~[guice-4.0.jar:?]
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) ~[guice-4.0.jar:?]
	at com.google.inject.spi.Elements.getElements(Elements.java:110) ~[guice-4.0.jar:?]
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138) ~[guice-4.0.jar:?]
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) ~[guice-4.0.jar:?]
	at com.google.inject.Guice.createInjector(Guice.java:96) ~[guice-4.0.jar:?]
	at com.google.inject.Guice.createInjector(Guice.java:73) ~[guice-4.0.jar:?]
	at com.google.inject.Guice.createInjector(Guice.java:62) ~[guice-4.0.jar:?]
	at org.apache.hadoop.yarn.webapp.WebApps$Builder.build(WebApps.java:394) ~[hadoop-yarn-common-3.2.4.jar:?]

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @689349f1
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[?:?]	

https://issues.apache.org/jira/browse/HADOOP-17177

google/guice#1536

apache/incubator-heron#3790

steps:
- uses: actions/checkout@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
check-latest: false
- name: Test with SBT
run: |
build/sbt -Pmr "clean; celeborn-mr-group/test"
- name: Upload test log
if: failure()
uses: actions/upload-artifact@v3
with:
name: mr-unit-test-log
path: |
**/target/test-reports/**
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,7 @@
<modules>
<module>client-mr/mr</module>
<module>client-mr/mr-shaded</module>
<module>tests/mr-it</module>
</modules>
</profile>

Expand Down
55 changes: 53 additions & 2 deletions project/CelebornBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object Dependencies {

val zstdJniVersion = sparkClientProjects.map(_.zstdJniVersion).getOrElse("1.5.2-1")
val lz4JavaVersion = sparkClientProjects.map(_.lz4JavaVersion).getOrElse("1.8.0")

// Dependent library versions
val commonsCompressVersion = "1.4.1"
val commonsCryptoVersion = "1.0.0"
Expand Down Expand Up @@ -933,6 +933,26 @@ object MRClientProjects {
)
}

def mrIt: Project = {
val hadoopVersion = "3.2.4"

Project("celeborn-mr-it", file("tests/mr-it"))
// ref: https://www.scala-sbt.org/1.x/docs/Multi-Project.html#Classpath+dependencies
.dependsOn(CelebornCommon.common % "test->test;compile->compile")
.dependsOn(CelebornClient.client % "test->test;compile->compile")
.dependsOn(CelebornMaster.master % "test->test;compile->compile")
.dependsOn(CelebornWorker.worker % "test->test;compile->compile")
.dependsOn(mrClient % "test->test;compile->compile")
.settings(
commonSettings,
copyDepsSettings,
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-client-minicluster" % hadoopVersion % "test",
cxzl25 marked this conversation as resolved.
Show resolved Hide resolved
"org.apache.hadoop" % "hadoop-mapreduce-examples" % hadoopVersion % "test"
) ++ commonUnitTestDependencies
)
}

def mrClientShade: Project = {
Project("celeborn-client-mr-shaded", file("client-mr/mr-shaded"))
.dependsOn(mrClient)
Expand Down Expand Up @@ -996,6 +1016,37 @@ object MRClientProjects {
}

def modules: Seq[Project] = {
Seq(mrClient, mrClientShade)
Seq(mrClient, mrIt, mrGroup, mrClientShade)
}

// for test only, don't use this group for any other projects
lazy val mrGroup = (project withId "celeborn-mr-group").aggregate(mrClient, mrIt)

val copyDeps = TaskKey[Unit]("copyDeps", "Copies needed dependencies to the build directory.")
val destPath = (Compile / crossTarget) {
_ / "mapreduce_lib"
}

lazy val copyDepsSettings = Seq(
copyDeps := {
val dest = destPath.value
if (!dest.isDirectory() && !dest.mkdirs()) {
throw new java.io.IOException("Failed to create jars directory.")
}

(Compile / dependencyClasspath).value.map(_.data)
.filter { jar => jar.isFile() }
.foreach { jar =>
val destJar = new File(dest, jar.getName())
if (destJar.isFile()) {
destJar.delete()
}
Files.copy(jar.toPath(), destJar.toPath())
}
},
(Test / compile) := {
copyDeps.value
(Test / compile).value
}
)
}
177 changes: 177 additions & 0 deletions tests/mr-it/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-parent_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>celeborn-mr-it_${scala.binary.version}</artifactId>
<packaging>jar</packaging>
<name>Celeborn MapReduce Integration Test</name>

<dependencies>
<dependency>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-common_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-client_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-master_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-worker_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-worker_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.celeborn</groupId>
<artifactId>celeborn-client-mr-shaded_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-server-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-auth</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-server-web-proxy</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-server-nodemanager</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-common</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-minicluster</artifactId>
<version>${hadoop.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-examples</artifactId>
<version>${hadoop.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-api</artifactId>
<version>${hadoop.version}</version>
<scope>test</scope>
</dependency>

<!-- The compile scope is to generate mapreduce_lib -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-server-web-proxy</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<goals>
<goal>copy-dependencies</goal>
</goals>
<phase>package</phase>
<configuration>
<outputDirectory>${project.build.directory}/mapreduce_lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
25 changes: 25 additions & 0 deletions tests/mr-it/src/test/resources/container-log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# 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.
#

# STDOUT Appender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{1} - %m%n

log4j.rootLogger=INFO, stdout
41 changes: 41 additions & 0 deletions tests/mr-it/src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->

<Configuration status="INFO">
<Appenders>
<Console name="stdout" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yy/MM/dd HH:mm:ss,SSS} %p [%t] %c{1}: %m%n%ex"/>
<Filters>
<ThresholdFilter level="ERROR"/>
</Filters>
</Console>
<File name="file" fileName="target/unit-tests.log">
<PatternLayout pattern="%d{yy/MM/dd HH:mm:ss,SSS} %p [%t] %c{1}: %m%n%ex"/>
</File>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="stdout"/>
<AppenderRef ref="file"/>
</Root>
<Logger name="org.sparkproject.jetty" level="WARN" additivity="false">
<AppenderRef ref="stdout"/>
<AppenderRef ref="file"/>
</Logger>
</Loggers>
</Configuration>
Loading
Loading