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

[Build] Use Maven-deamon to speed up Maven artifact publication #2727

Merged

Conversation

HannesWell
Copy link
Member

Using Maven-deamon reduces the runtime of the repository validation from ~14min to ~1.5min and the publication steps for the different projects from ~23min respectively ~5min to ~9min respectively ~2min.
Overall the runtime is reduced from ~42min to ~16min.

@@ -15,6 +15,9 @@ pipeline {
}
environment {
REPO = "${WORKSPACE}/repo"
PATH = "${installMavenDaemon('1.0.2')}/bin:${PATH}"
MVND_DAEMON_STORAGE = "${WORKSPACE}/tools/mvnd" // Folder ~/.m2 is not writable for builds, ensure mvnd metadata are written within the workspace.
TERM = 'dumb' // Prevent jline warning about inability to create a system terminal.
Copy link
Member Author

Choose a reason for hiding this comment

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

@merks
Copy link
Contributor

merks commented Jan 5, 2025

We really need a new I-build to fix the license checking...

@laeubi
Copy link
Contributor

laeubi commented Jan 5, 2025

Is this really mvn deamon or because we now store the m2 repository somewhere else?!? Seems a bit odd as the deamnon would be killed after the agent is stopped?

@HannesWell
Copy link
Member Author

Is this really mvn deamon or because we now store the m2 repository somewhere else?!? Seems a bit odd as the deamnon would be killed after the agent is stopped?

I don't expect the maven-repo to be stored somewhere else. The gain is still explainable since we start maven twice (once for verification and once for the actual deployment) for each artifact to publish. And since we publish 296 artifacts it means maven is launched almost 600 times. And for all those invocations the daemon can be reused, even if it's killed after the build.

@laeubi
Copy link
Contributor

laeubi commented Jan 5, 2025

The gain is still explainable since we start maven twice (once for verification and once for the actual deployment) for each artifact to publish.

ouch...

@HannesWell HannesWell force-pushed the maven-publication-mvnd branch 4 times, most recently from b04cfa5 to 5b10579 Compare January 5, 2025 23:30
@HannesWell HannesWell force-pushed the maven-publication-mvnd branch from 5b10579 to b2bb190 Compare January 6, 2025 21:37
@HannesWell
Copy link
Member Author

The gain is still explainable since we start maven twice (once for verification and once for the actual deployment) for each artifact to publish.

ouch...

Yep. At least we save 10min of total build time for each second of runtime reduction of each build. And it looks like we save some seconds per build with this.

After increasing the keep-alive timeout a bit using the maven-daemon works now stable as desired. I assume that's necessary due to the parallel execution of the matrix on a single-core CPU, which I think makes some threads sometimes sleep for some time.

With that this is ready for submission to me.

@HannesWell HannesWell merged commit 2916186 into eclipse-platform:master Jan 6, 2025
2 of 4 checks passed
@HannesWell HannesWell deleted the maven-publication-mvnd branch January 6, 2025 22:56
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.

3 participants