Skip to content

Build packages in parallel. #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
May 11, 2025
Merged

Build packages in parallel. #35

merged 1 commit into from
May 11, 2025

Conversation

mmuetzel
Copy link
Member

@mmuetzel mmuetzel commented May 9, 2025

MXE Octave doesn't (currently?) support building with parallel make initially. However, once Octave has been (cross-)built, building multiple packages in parallel works fine. And it is more efficient to do so, e.g., because some parts of the build steps of any of the built packages (like running a configure script) cannot be parallelized. Building multiple packages in parallel allows using more CPU threads at the same time in these cases.

To allow that, invoke make twice: First, to build Octave (without parallel make). And then again if the previous invocation was successful, to build the remaining tools and packages (with four parallel make processes).

That should be the equivalent of running the following command locally:
make JOBS=8 && make -j4 JOBS=2 all 7z-dist zip-dist nsis-installer

@siko1056: I don't know how to test these changes. Does this look reasonable to you?

MXE Octave doesn't (currently?) support building with parallel `make`
initially. However, once Octave has been (cross-)built, building multiple
packages in parallel works fine. And it is more efficient to do so, e.g.,
because some parts of the build steps of any of the built packages (like
running a configure script) cannot be parallelized. Building multiple packages
in parallel allows using more CPU threads at the same time in these cases.

To allow that, invoke `make` twice: First, to build Octave (without parallel
`make`). And then again if the previous invocation was successful, to build
the remaining tools and packages (with four parallel `make` processes).

That should be the equivalent of running the following command locally:
`make JOBS=8 && make -j4 JOBS=2 all 7z-dist zip-dist nsis-installer`
Copy link
Member

@siko1056 siko1056 left a comment

Choose a reason for hiding this comment

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

@mmuetzel This looks reasonable to me. Shall I apply this config to the live system?

Unless you want to replicate the full system for testing on your local system using Docker compose https://github.com/gnu-octave/octave-buildbot/tree/main/test, we can only test "in production".

The metric you want to compare is if the package build will be faster than with current sequential build of packages using multiple CPU threads, right?

Just let me know if we want to revert of make follow-up changes.

@siko1056 siko1056 self-assigned this May 11, 2025
@siko1056 siko1056 added the enhancement New feature or request label May 11, 2025
@mmuetzel
Copy link
Member Author

Yeah. Ever since @jwe gave the hint to building multiple packages after Octave has been built, I'm using that approach locally. And from what I can see, building with MXE Octave is faster with that.

Also, jwe's buildbots are using that approach. And @jwe builds the Windows installer like that.
If we'd still like to do cleanup steps on error (like uploading the build logs), we need some additional logic for the split steps though.

I tried to change the rules after reading the buildbot documentation. I hope I got the conditions (like for doStepIf) right.
If all goes wrong, we can still revert like you suggested. Let's see what will happen with this merged...

I'd appreciate if you could update the buildbot master with these changes after the merge.
Thanks!

@mmuetzel mmuetzel merged commit 2d61692 into gnu-octave:main May 11, 2025
@siko1056
Copy link
Member

Great, then I'll update the configuration later when I am back on the PC.

@siko1056
Copy link
Member

The changes should be active with the next build.

@mmuetzel
Copy link
Member Author

mmuetzel commented May 13, 2025

It looks like this triggered the following errors:

  • builtins.NameError: name 'SUCCESS' is not defined
  • builtins.NameError: name 'SKIPPED' is not defined

Maybe, we need to use the full namespace here? That would probably be buildbot.process.results.SUCCESS and buildbot.process.results.SKIPPED:
https://docs.buildbot.net/latest/developer/results.html
(That didn't appear in some examples given in the documentation. But maybe, they assumed some import statements?)

mmuetzel added a commit to mmuetzel/octave-buildbot that referenced this pull request May 13, 2025
The buildbots are failing after gnu-octave#35 with errors like the following:
* builtins.NameError: name 'SUCCESS' is not defined
* builtins.NameError: name 'SKIPPED' is not defined

That might be because these constants need to be fully qualified.
Add the full namespace where these constants are used.
siko1056 added a commit that referenced this pull request May 14, 2025
* Attempt to fix errors about undefined names.

The buildbots are failing after #35 with errors like the following:
* builtins.NameError: name 'SUCCESS' is not defined
* builtins.NameError: name 'SKIPPED' is not defined

That might be because these constants need to be fully qualified.
Add the full namespace where these constants are used.

* master.cfg import undefined symbols

---------

Co-authored-by: Kai Torben Ohlhus <[email protected]>
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.

2 participants