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-31713][INFRA] Make test-dependencies.sh detect version string correctly #28532

Closed
wants to merge 2 commits into from
Closed

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented May 14, 2020

What changes were proposed in this pull request?

This PR makes test-dependencies.sh detect the version string correctly by ignoring all the other lines.

Why are the changes needed?

Currently, all SBT jobs are broken like the following.

[error] running /home/jenkins/workspace/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/dev/test-dependencies.sh ; received return code 1
Build step 'Execute shell' marked build as failure

The reason is that the script detects the old version like Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT when build/mvn did fallback.

Specifically, in the script, OLD_VERSION became Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT instead of 3.1.0-SNAPSHOT if build/mvn did fallback. Then, pom.xml file is corrupted like the following at the end and the exit code become 1 instead of 0. It causes Jenkins jobs fails

-    <version>3.1.0-SNAPSHOT</version>
+    <version>Falling</version>

NO FALLBACK

$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT

FALLBACK

$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT

In the script

$ echo $(build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT

This PR will prevent irrelevant logs like Falling back to archive.apache.org to download Maven.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the PR Builder.

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented May 14, 2020

Hi, @srowen . Could you review this PR? This PR will remove the weird test-dependency failures on the PR builder and Jenkins jobs.

@@ -47,7 +47,7 @@ OLD_VERSION=$($MVN -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec | grep -e '[0-9]\.[0-9]\.[0-9]')
Copy link
Member Author

Choose a reason for hiding this comment

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

I used [0-9] because \d is accepted only on Mac OS.

Copy link
Member

Choose a reason for hiding this comment

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

This would still match 3.1.0-SNAPSHOT wouldn't it - was the idea not to match it?
You could exclude "SNAPSHOT" matches but that might be just a band-aid.

You might need [0-9]+ in each case to account for double-digit versions.

\d might work with -E but not worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks . Yes. It matches SNAPSHOT, too.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is only grepping lines with version like string.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, just to be clear, what are you trying to match or not match here?

Copy link
Member Author

Choose a reason for hiding this comment

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

In the script, $(...) merges two lines into one.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, is the following working in grep on Mac?

You might need [0-9]+ in each case to account for double-digit versions.

Copy link
Member

Choose a reason for hiding this comment

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

It works but you need -E as that is 'extended' regex syntax, like many things. I think -E is standard across GNU / BSD grep.

OK if you tell me this works, then I'm missing something, but it seems like this grep does not exclude the line I think you are trying to exclude, unless you want to print only the matching version from that line, and that's -o I understand it's picking up "Falling" so I am assuming something needs to ignore this line or only extract the version. grep -v Falling would just ignore that line

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. BTW, grep -v Falling is not robust enough. If someone adds another warning output someday, this situation will repeat again.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll update to use grep -E '[0-9]+\.[0-9]+\.[0-9]+'.

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented May 15, 2020

The falling back is happening in this PR's PR Builder like the following, but this PR builder passed. Please see Falling back to archive.apache.org to download Maven messages.

========================================================================
Running Apache RAT checks
========================================================================
Attempting to fetch rat
RAT checks passed.

========================================================================
Running build tests
========================================================================
exec: curl --silent --show-error -L https://downloads.lightbend.com/zinc/0.3.15/zinc-0.3.15.tgz
exec: curl --silent --show-error -L https://downloads.lightbend.com/scala/2.12.10/scala-2.12.10.tgz
exec: curl --silent --show-error -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Performing Maven install for hadoop-2.7-hive-1.2
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Performing Maven validate for hadoop-2.7-hive-1.2
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Generating dependency manifest for hadoop-2.7-hive-1.2
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Performing Maven install for hadoop-2.7-hive-2.3
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Performing Maven validate for hadoop-2.7-hive-2.3
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Generating dependency manifest for hadoop-2.7-hive-2.3
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Performing Maven install for hadoop-3.2-hive-2.3
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Performing Maven validate for hadoop-3.2-hive-2.3
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Generating dependency manifest for hadoop-3.2-hive-2.3
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn

========================================================================
Building Spark
========================================================================
...

@SparkQA
Copy link

SparkQA commented May 15, 2020

Test build #122636 has finished for PR 28532 at commit b96806a.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member Author

Oh.. In Jenkins server, the new pattern seems not working.

@srowen
Copy link
Member

srowen commented May 15, 2020

do you mean grep -E "^[0-9]+\.[0-9]+\.[0-9]+$"? that would force it to match the whole line and not accept anything else

@dongjoon-hyun
Copy link
Member Author

Ah, it's different issue. There exists some corrupted ~/.m2/repository in some machines.

Using `mvn` from path: /home/jenkins/workspace/SparkPullRequestBuilder/build/apache-maven-3.6.3/bin/mvn
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-cli) on project spark-parent_2.12: ArtifactInstallerException: 
Failed to install metadata org.apache.spark:spark-parent_2.12/maven-metadata.xml: 
Could not parse metadata /home/jenkins/.m2/repository/org/apache/spark/spark-parent_2.12/maven-metadata-local.xml: 
in epilog non whitespace content is not allowed but got >
(position: END_TAG seen ...</metadata>\n>... @13:2) -> [Help 1]

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented May 15, 2020

It seems that we need to clean up ./m2/repository at all Jenkins machine. During recent network outage, the directory might be corrupted.

@dongjoon-hyun
Copy link
Member Author

Retest this please.

@SparkQA
Copy link

SparkQA commented May 15, 2020

Test build #122635 has finished for PR 28532 at commit e9bdb59.

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

@SparkQA
Copy link

SparkQA commented May 15, 2020

Test build #122638 has finished for PR 28532 at commit b96806a.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented May 15, 2020

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented May 15, 2020

@srowen . If you don't mind, can we merge this? This PR passed already on amp-jenkins-worker-03 with a fallback situation (#28532 (comment)). We don't have a configuration to assign this PR into another Jenkins job machine.

@srowen
Copy link
Member

srowen commented May 15, 2020

I trust your judgment; it can't really make things worse either if most PR builds are failing.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

Okay, same logic. LGTM

@dongjoon-hyun
Copy link
Member Author

Thank you, @srowen and @HyukjinKwon !

@HyukjinKwon
Copy link
Member

Should we clean that specific correct corrupted one in .m2, @shaneknapp?

dongjoon-hyun added a commit that referenced this pull request May 15, 2020
…correctly

### What changes were proposed in this pull request?

This PR makes `test-dependencies.sh` detect the version string correctly by ignoring all the other lines.

### Why are the changes needed?

Currently, all SBT jobs are broken like the following.
- https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/job/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/476/console
```
[error] running /home/jenkins/workspace/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/dev/test-dependencies.sh ; received return code 1
Build step 'Execute shell' marked build as failure
```

The reason is that the script detects the old version like `Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT` when `build/mvn` did fallback.

Specifically, in the script, `OLD_VERSION` became `Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT` instead of `3.1.0-SNAPSHOT` if build/mvn did fallback. Then, `pom.xml` file is corrupted like the following at the end and the exit code become `1` instead of `0`. It causes Jenkins jobs fails
```
-    <version>3.1.0-SNAPSHOT</version>
+    <version>Falling</version>
```

**NO FALLBACK**
```
$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT
```

**FALLBACK**
```
$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT
```

**In the script**
```
$ echo $(build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT
```

This PR will prevent irrelevant logs like `Falling back to archive.apache.org to download Maven`.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the PR Builder.

Closes #28532 from dongjoon-hyun/SPARK-31713.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit cd5fbcf)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit that referenced this pull request May 15, 2020
…correctly

### What changes were proposed in this pull request?

This PR makes `test-dependencies.sh` detect the version string correctly by ignoring all the other lines.

### Why are the changes needed?

Currently, all SBT jobs are broken like the following.
- https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/job/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/476/console
```
[error] running /home/jenkins/workspace/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/dev/test-dependencies.sh ; received return code 1
Build step 'Execute shell' marked build as failure
```

The reason is that the script detects the old version like `Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT` when `build/mvn` did fallback.

Specifically, in the script, `OLD_VERSION` became `Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT` instead of `3.1.0-SNAPSHOT` if build/mvn did fallback. Then, `pom.xml` file is corrupted like the following at the end and the exit code become `1` instead of `0`. It causes Jenkins jobs fails
```
-    <version>3.1.0-SNAPSHOT</version>
+    <version>Falling</version>
```

**NO FALLBACK**
```
$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT
```

**FALLBACK**
```
$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT
```

**In the script**
```
$ echo $(build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT
```

This PR will prevent irrelevant logs like `Falling back to archive.apache.org to download Maven`.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the PR Builder.

Closes #28532 from dongjoon-hyun/SPARK-31713.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit cd5fbcf)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@HyukjinKwon
Copy link
Member

Shall we file a JIRA and assign @shaneknapp? I think he asked this before :-).

@dongjoon-hyun
Copy link
Member Author

I left a comment on the existing JIRA. But, new JIRA sounds good.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-31713 branch May 15, 2020 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants