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

chore(Jeninsfile) Switch Maven commands to infra.runWithMaven #5843

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

dduportal
Copy link
Contributor

@dduportal dduportal commented Oct 21, 2021

The goal is to benefits from infra's JDK and maven setups per agent kind.

It avoid infamous errors The JAVA_HOME environment variable is not defined correctly, in the ATH and benefits the work from jenkins-infra/pipeline-library#231 abd jenkins-infra/pipeline-library#232 (not downloading JDK on each agent)

Related to #5841 which "ath" step failed.

Proposed changelog entries

N.A.

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@jglick @timja

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@timja timja requested a review from jglick October 21, 2021 13:34
@timja timja added the skip-changelog Should not be shown in the changelog label Oct 21, 2021
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Accidental deletion of important git diff call.

Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Show resolved Hide resolved
@dduportal
Copy link
Contributor Author

@jglick many thanks for your review (I learned about the $WORKSPACE_TMP variable). I tried to take all in account, and you can find the "replay" build with the pipeline content : https://ci.jenkins.io/job/Core/job/jenkins/job/PR-5843/14/console

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks like it should work.

Jenkinsfile Show resolved Hide resolved
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

As a rule, I really dislike runMaven and think it should be deprecated. Prefer runWithMaven + sh 'mvn …' for transparency. Would that suffice to solve the issues mentioned in the description?

Jenkinsfile Outdated
runTests ? '-Dmaven.test.failure.ignore' : '-DskipTests',
"-V",
"-B",
"-ntp", // Requires Maven >= 3.6.1
Copy link
Member

Choose a reason for hiding this comment

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

Apparently already part of runMaven?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dduportal
Copy link
Contributor Author

As a rule, I really dislike runMaven and think it should be deprecated. Prefer runWithMaven + sh 'mvn …' for transparency. Would that suffice to solve the issues mentioned in the description?

Make sense, it sounds like we can pass a closue block to runWithMaven which avoid the tedious string lists.
I'll try with this instead but tomorrow. Thanks @jglick

The goal is to benefit from the the shared library jenkins-infra/pipeline-library
that manages agents and tools.

Signed-off-by: Damien Duportal <[email protected]>
@dduportal dduportal changed the title ath: use the pipeline library infra.runMaven chore(Jeninsfile) Switch Maven commands to infra.runWithMaven Oct 22, 2021
@dduportal
Copy link
Contributor Author

dduportal commented Oct 22, 2021

@jglick @timja I've reworked the PR to use the infra.runWithMaven() command instead. WDYT?

"Replayed" Job to test the pipeline changes: https://ci.jenkins.io/job/Core/job/jenkins/job/PR-5843/18/console

@@ -10,6 +10,8 @@ def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumbe
// TEST FLAG - to make it easier to turn on/off unit tests for speeding up access to later stuff.
def runTests = true
def failFast = false
// Same memory sizing for both builds and ATH
def javaOpts = ["JAVA_OPTS=-Xmx1536m -Xms512m","MAVEN_OPTS=-Xmx1536m -Xms512m"]
Copy link
Member

Choose a reason for hiding this comment

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

not directly related to this PR but is this why the tests are so darn slow. cc @basil

Locally my Jenkins core tests are soo much faster, our agents have far more resources than this =/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm that maps to the 8Gb of the container agents (rule of thumb: Xmx+Xms = 1/4 of available memory), but on the highmeme instances that could be increased. Shouldn't we remove these options and let the JVM deal with the available memory instead (I mean: even with "old" JDK8 builds", the container cgroup memory is now handled correctly without OOM)

Copy link
Member

Choose a reason for hiding this comment

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

yeah once we merge this I plan to try out a PR to see if it does anything.

Copy link
Member

Choose a reason for hiding this comment

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

@timja
Copy link
Member

timja commented Oct 22, 2021

I plan to ship this if it works, we can debate style later, given the master build is broken right now...

@dduportal
Copy link
Contributor Author

I plan to ship this if it works, we can debate style later, given the master build is broken right now...

cc @jglick when it will be daylight for you: don't hesitate to comment this PR, even if merged: I'll take care of adding a new PR with any style/feedbacks.

@timja timja merged commit d738127 into jenkinsci:master Oct 22, 2021
@dduportal dduportal deleted the patch-1 branch October 22, 2021 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Should not be shown in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants