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

Parallel builds #286

Open
sknop opened this issue Feb 4, 2019 · 3 comments
Open

Parallel builds #286

sknop opened this issue Feb 4, 2019 · 3 comments
Labels
2.x Issue related to the 2.x series enhancement

Comments

@sknop
Copy link

sknop commented Feb 4, 2019

It looks like the asciidoctor gradle plugin does not support parallel builds.
We have a repository with multiple (independent) documents, and it would be great if these could be build in parallel.

@ysb33r ysb33r added enhancement 2.x Issue related to the 2.x series labels Feb 4, 2019
@ysb33r
Copy link
Member

ysb33r commented Feb 4, 2019

In the current 2.x context:

  • If --parallel is specified on the command-line and there are multiple asciidoctorX tasks they should be able to run in parallel if Gradle decides to schedule them so.
  • There is a parallelMode property that is on by default for asciidoctorX tasks. If there are more than one backend in the specific tasks, processing for those backends will happen in parallel. If inProcess==JAVA_EXC the parallel mode is ignored. Currently only the generic AsciidoctorTask type supports this parallel feature.

The idea of generating independent documents in parallel is an excellent concept in principle, so let's explore it.

  • In order to to achieve this, multiple AsciidoctorJ instances must be made available. This can either be done via the worker API (keeping in mind the current limitations of this API and related open issues with Gradle) or inside the worker of external Java process, multiple Asciidoctor instances can simply be created.
  • Depending on the model of operation this will need to be separate processes or threads.
  • Assuming that the documents come from the same task, we can safely assume that the classpath, GEM requirements, and extensions will be the same thus making multiple threads or actors a possibility.
  • As this parallel processing could be highly contextual to the environment of the script author parameters such as memory and concurrency limit should be configurable.
  • There is no guarantee that processing the documents in parallel will be faster as start-up time for instance could be more than the time saved in concurrency. Therefore this will need to be configurable behaviour and turned off by default.

It is possible that the curretn parallelMode implementation could be extended to accommodate the above all be it with additional DSL.

@ysb33r ysb33r mentioned this issue Mar 22, 2019
28 tasks
@shevek
Copy link

shevek commented May 28, 2019

Failing miserably for us; tends to crash the JVM.

@ysb33r
Copy link
Member

ysb33r commented May 28, 2019

@shevek parallel builds are not supported in anything prior to 2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue related to the 2.x series enhancement
Projects
None yet
Development

No branches or pull requests

3 participants