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

[SPARK-23078] add tests for Spark Thrift Server on Kubernetes #38

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ozzieba
Copy link

@ozzieba ozzieba commented Jan 19, 2018

Adding tests in response to apache/spark#20272

@ozzieba
Copy link
Author

ozzieba commented Jan 19, 2018

woops, looks like merging from master broke my function...

@ozzieba
Copy link
Author

ozzieba commented Jan 19, 2018

Any way to get Jenkins to pull spark from my branch?

@@ -84,11 +87,21 @@
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to depend on hadoop-common?

Copy link
Author

Choose a reason for hiding this comment

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

Without it I get java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration. In general, I believe Hive JDBC requires some Hadoop dependencies, as discussed in eg https://issues.apache.org/jira/browse/HIVE-15110. Not sure if it's only configuration. Do you have a cleaner solution?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, thanks for the info.

@@ -20,6 +20,8 @@ import java.io.File
import java.nio.file.{Path, Paths}
import java.util.UUID
import java.util.regex.Pattern
import java.sql.DriverManager
import org.apache.hive.jdbc.HiveDriver
Copy link
Member

Choose a reason for hiding this comment

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

There should be an empty line separating java imports and the rest, and the order of imports should be java, scala, other third-party, and finally spark. So org.apache.hive.jdbc.HiveDriver should be to after io.fabric8....

@@ -239,6 +245,43 @@ private[spark] class KubernetesSuite extends FunSuite with BeforeAndAfterAll wit
appLocator)
}

private def runThriftServerAndVerifyQuery(
driverPodChecker: Pod => Unit = doBasicDriverPodCheck,
Copy link
Member

Choose a reason for hiding this comment

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

Indention for function parameters is wrong. Should be four spaces.

assert(resultSet.getInt(1) == 42)
} finally {
statement.close()
connection.close()
Copy link
Member

Choose a reason for hiding this comment

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

connection should be closed regardless of if statement.close throws an exception.

Copy link
Author

Choose a reason for hiding this comment

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

@ozzieba
Copy link
Author

ozzieba commented Jan 19, 2018

@liyinan926 thanks for checking this out, I'm still somewhat new to Scala, let me know if anything else needs to be fixed

@@ -239,6 +245,46 @@ private[spark] class KubernetesSuite extends FunSuite with BeforeAndAfterAll wit
appLocator)
}

private def runThriftServerAndVerifyQuery(
driverPodChecker: Pod => Unit = doBasicDriverPodCheck,
Copy link
Member

Choose a reason for hiding this comment

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

These should be 4 spaces indention.

@liyinan926
Copy link
Member

liyinan926 commented Jan 19, 2018

LGTM with a couple of minor comments. BTW: the added test failed in the last integration test run somehow.

@ozzieba
Copy link
Author

ozzieba commented Jan 19, 2018

@liyinan926 Thanks. The test succeeds using my fork of the Spark repo, and presumably should be merged together with apache/spark#20272. Is there a way to tell Jenkins to test my fork before this?

@liyinan926
Copy link
Member

liyinan926 commented Jan 19, 2018

dev/dev-run-integration-tests.sh has an option --spark-repo that allows you to specify a repo to test against. Were you using that to test against your fork? You can post your manual test result to apache/spark#20272.

@ozzieba
Copy link
Author

ozzieba commented Jan 20, 2018

I ran it that way successfully on my own machine, just wanted to make it ”official” on Jenkins

@foxish
Copy link
Member

foxish commented Jan 21, 2018

@ozzieba, looks like the test is failing here. Can you PTAL?

@ozzieba
Copy link
Author

ozzieba commented Jan 21, 2018

@foxish The failure in Jenkins is expected, since SparkSubmit before my PR explicitly blacklists STS from running on cluster mode.

For the record, here is the log of the tests running after my change

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants