Skip to content

[SPARK-33104][BUILD] Exclude 'org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests' - #30133

Closed
HyukjinKwon wants to merge 2 commits into
apache:masterfrom
HyukjinKwon:SPARK-33104
Closed

[SPARK-33104][BUILD] Exclude 'org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests'#30133
HyukjinKwon wants to merge 2 commits into
apache:masterfrom
HyukjinKwon:SPARK-33104

Conversation

@HyukjinKwon

@HyukjinKwonHyukjinKwon commented Oct 22, 2020

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

This PR proposes to exclude org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests from hadoop-yarn-server-tests when we use Hadoop 2 profile.

For some reasons, after SBT 1.3 upgrade at SPARK-21708, SBT starts to pull the dependencies of 'hadoop-yarn-server-tests' with 'tests' classifier:

org/apache/hadoop/hadoop-common/2.7.4/hadoop-common-2.7.4-tests.jar
org/apache/hadoop/hadoop-yarn-common/2.7.4/hadoop-yarn-common-2.7.4-tests.jar
org/apache/hadoop/hadoop-yarn-server-resourcemanager/2.7.4/hadoop-yarn-server-resourcemanager-2.7.4-tests.jar

these were not pulled before the upgrade.

This specific hadoop-yarn-server-resourcemanager-2.7.4-tests.jar causes the problem (SPARK-33104)

  1. When the test case creates the Hadoop configuration here,

    valhadoopConf=SparkHadoopUtil.newConfiguration(conf)

  2. Such jars above have higher precedence in the class path, instead of the specified custom core-site.xml in the test:

    buildPath(Environment.PWD.$$(), LOCALIZED_CONF_DIR, LOCALIZED_HADOOP_CONF_DIR), env)

  3. Later, core-site.xml in the jar is picked instead in Hadoop's Configuration:

    Before this fix:

    jar:file:/.../https/maven-central.storage-download.googleapis.com/maven2/org/apache/hadoop/
    hadoop-yarn-server-resourcemanager/2.7.4/hadoop-yarn-server-resourcemanager-2.7.4-tests.jar!/core-site.xml
    

    After this fix:

    file:/.../spark/resource-managers/yarn/target/org.apache.spark.deploy.yarn.YarnClusterSuite/
    org.apache.spark.deploy.yarn.YarnClusterSuite-localDir-nm-0_0/
    usercache/.../filecache/10/__spark_conf__.zip/__hadoop_conf__/core-site.xml
    
  4. the core-site.xml in the jar of course does not contain:

    valcoreSite="""<?xml version="1.0" encoding="UTF-8"?>
    |<configuration>
    | <property>
    | <name>spark.test.key</name>
    | <value>testvalue</value>
    | </property>
    |</configuration>
    |""".stripMargin
    Files.write(coreSite, newFile(customConf, "core-site.xml"), StandardCharsets.UTF_8)

    and the specific test fails.

This PR uses some kind of hacky approach. It was excluded from 'hadoop-yarn-server-tests' with 'tests' classifier, and then added back as a proper dependency (when Hadoop 2 profile is used). In this way, SBT does not pull hadoop-yarn-server-resourcemanager with tests classifier anymore.

Why are the changes needed?

To make the build pass. This is a blocker.

Does this PR introduce any user-facing change?

No, test-only.

How was this patch tested?

Manually tested and debugged:

build/sbt clean "yarn/testOnly *.YarnClusterSuite -- -z SparkHadoopUtil" -Pyarn -Phadoop-2.7 -Phive -Phive-2.3

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

cc @srowen, @dongjoon-hyun and @gemelen

@HyukjinKwonHyukjinKwon changed the title [SPARK-33104][BUILD] Exclude 'org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests'[SPARK-33104][BUILD][test-hadoop2.7] Exclude 'org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests'Oct 22, 2020
@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

retest this please

@HyukjinKwon

HyukjinKwon commented Oct 22, 2020

Copy link
Copy Markdown
MemberAuthor

Thanks @srowen. I'll take a look if there are related test failures tomorrow although logically I think there'd not be because these were not pulled in before.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34771/

@dongjoon-hyun

Copy link
Copy Markdown
Member

Thank you so much, @HyukjinKwon !

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34772/

@dongjoon-hyundongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, LGTM (Pending Jenkins).
I verified that this fixes SPARK-33104, too.

$ build/sbt "yarn/testOnly *.YarnClusterSuite -- -z SparkHadoopUtil" -Pyarn -Phadoop-2.7 -Phive -Phive-2.3
[info] YarnClusterSuite:
[info] - yarn-cluster should respect conf overrides in SparkHadoopUtil (SPARK-16414, SPARK-23630) (13 seconds, 216 milliseconds)
[info] ScalaTest
[info] Run completed in 31 seconds, 103 milliseconds.
[info] Total number of tests run: 1
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
[success] Total time: 131 s (02:11), completed Oct 22, 2020 8:55:10 AM

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34771/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34772/

@gemelen

Copy link
Copy Markdown
Contributor

This PR proposes to exclude org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests from hadoop-yarn-server-tests.

For some reasons, after SBT 1.3 upgrade at SPARK-21708, SBT starts to pull the dependencies of 'hadoop-yarn-server-tests' with 'tests' classifier:

org/apache/hadoop/hadoop-common/2.7.4/hadoop-common-2.7.4-tests.jar
org/apache/hadoop/hadoop-yarn-common/2.7.4/hadoop-yarn-common-2.7.4-tests.jar
org/apache/hadoop/hadoop-yarn-server-resourcemanager/2.7.4/hadoop-yarn-server-resourcemanager-2.7.4-tests.jar

these were not pulled before the upgrade.

This sounds exactly as a new behaviour of 'sbt-pom-reader' plugin of latest version. It could be corner case of scope/classifier clash of maven dependency that we are pulling via this plugin.

@SparkQA

Copy link
Copy Markdown

Test build #130164 has finished for PR 30133 at commit 4748abd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun

Copy link
Copy Markdown
Member

Retest this please

@SparkQA

Copy link
Copy Markdown

Test build #130165 has finished for PR 30133 at commit 4748abd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34776/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34776/

@SparkQA

Copy link
Copy Markdown

Test build #130169 has finished for PR 30133 at commit 4748abd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun

Copy link
Copy Markdown
Member

Retest this please

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34782/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34782/

@SparkQA

Copy link
Copy Markdown

Test build #130176 has finished for PR 30133 at commit 4748abd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@sunchao

Copy link
Copy Markdown
Member

It seems the test failure in Yarn is related, although I don't know why yet. Also you may need to update dependency files.

@HyukjinKwon
HyukjinKwon marked this pull request as draft October 23, 2020 00:30
@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

Will take another look for the test failures.

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

The GitHub Actions build looked legitimate. I only excluded this explicitly with Hadoop 2 which should be more correct.
Jenkins build looks just flaky. I already have seen all these features regardless of the current fix.

@HyukjinKwon
HyukjinKwon marked this pull request as ready for review October 23, 2020 05:51
@dongjoon-hyun

Copy link
Copy Markdown
Member

Ya. The additional commit looks better. Let's see the result.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34792/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34792/

@SparkQA

This comment has been minimized.

@viirya

Copy link
Copy Markdown
Member

retest this please

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34794/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34794/

@SparkQA

Copy link
Copy Markdown

Test build #130193 has finished for PR 30133 at commit 00c8335.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

Looks like all tests passed properly. I am going to merge. Thanks all for taking care of this PR.

Merged to master.

@HyukjinKwonHyukjinKwon changed the title [SPARK-33104][BUILD][test-hadoop2.7] Exclude 'org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests'[SPARK-33104][BUILD] Exclude 'org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:tests'Oct 23, 2020
@dongjoon-hyun

Copy link
Copy Markdown
Member

Thank you!

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

Okay .. it finally starts to pass: https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-sbt-hadoop-2.7-hive-2.3/1454/ 👍

@dongjoon-hyun

Copy link
Copy Markdown
Member

Sorry, guys.

The original PR seems to exposes Apache Spark to HADOOP-16080 . We may need to revert this together.

We are searching all options.

  1. The Spark-side workaround
  2. New Hadoop release.
  3. Reverting to the old dependency ([SPARK-33618][CORE] Use hadoop-client instead of hadoop-client-api to make hadoop-aws work #30508)

@HyukjinKwon

Copy link
Copy Markdown
MemberAuthor

Sure, thats fine. Thanks for taking care of this.

@HyukjinKwon
HyukjinKwon deleted the SPARK-33104 branch December 7, 2020 02:05
Sign up for freeto 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.

7 participants

@HyukjinKwon@SparkQA@dongjoon-hyun@gemelen@sunchao@viirya@srowen