Skip to content

[MDEPLOY-206] Support parallel deployment for deployAtEnd #35

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

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

slawekjaranowski
Copy link
Member

Each whole module will be deployed by resolver in one thread.
We have parallel deployment on module level.


Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MDEPLOY-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MDEPLOY-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Each whole module will be deployed by resolver in one thread.
We have parallel deployment on module level.
@gnodet
Copy link
Contributor

gnodet commented Jan 27, 2023

@slawekjaranowski the code for multi-threaded deploy should work if the number of threads is set to 1. Should we just use a single code path for both ?

@gnodet
Copy link
Contributor

gnodet commented Jan 27, 2023

@slawekjaranowski the code for multi-threaded deploy should work if the number of threads is set to 1. Should we just use a single code path for both ?

In case we really want to avoid creating a thread pool with 1 thread, we could use https://guava.dev/releases/19.0/api/docs/com/google/common/util/concurrent/MoreExecutors.html#newDirectExecutorService() ...

@slawekjaranowski
Copy link
Member Author

There are two code paths:

  • number of threads <= 1 - collect all artifacts from all module and call in one request for Resolver
  • number of threads > 1 - create thread pool and create separate deploy request per module

@slawekjaranowski
Copy link
Member Author

@gnodet Is my answer sufficient for you?

@gnodet
Copy link
Contributor

gnodet commented Jan 28, 2023

@gnodet Is my answer sufficient for you?

Yes, though, due to the locking that happens inside the resolver, I wonder if it would make more sense to have this parallel upload done inside the resolver rather than in the deploy plugin. @cstamas ?

@slawekjaranowski
Copy link
Member Author

Yes, though, due to the locking that happens inside the resolver, I wonder if it would make more sense to have this parallel upload done inside the resolver rather than in the deploy plugin.

That is the reason that I execute deploy for whole module in separate thread - we have the same situation like executing Maven with -T, each module will be deployed in own thread.

@slawekjaranowski slawekjaranowski merged commit 59bee05 into master Jan 31, 2023
@slawekjaranowski slawekjaranowski deleted the MDEPLOY-206 branch January 31, 2023 15:42
@slawekjaranowski slawekjaranowski added the enhancement New feature or request label Jan 31, 2023
*
* @since 3.1.0
*/
@Parameter(property = "maven.deploy.parallelThreads", defaultValue = "1")

Choose a reason for hiding this comment

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

sorry for the late review.

Would it be possible to support dynamic syntax like is done with the CLI parallelism flag -T 1C that way the deploy threads could scale with the hardware without being tightly coupled to config.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can be ... 😄

@cstamas
Copy link
Member

cstamas commented Jan 31, 2023

@gnodet Is my answer sufficient for you?

Yes, though, due to the locking that happens inside the resolver, I wonder if it would make more sense to have this parallel upload done inside the resolver rather than in the deploy plugin. @cstamas ?

See https://issues.apache.org/jira/browse/MRESOLVER-32?focusedCommentId=17607557&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17607557

And I agree, this should be better solved in resolver (would be nicer at least). IMO this plugin should simply create 1 deploy request and lump it onto resolver to "solve it".

@jira-importer
Copy link
Collaborator

Resolve #480

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

Successfully merging this pull request may close these issues.

5 participants