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

catkin_make_isolated should provide rosbuild parallelity #330

Closed
wants to merge 59 commits into from

Conversation

wjwwood
Copy link
Member

@wjwwood wjwwood commented Dec 3, 2013

I see no reason to not parallelize project builds of projects without dependencies between them. Code can be reused from rosmake or from rosinstall.

This might require changing the catkin_pkg API not just to return a topologically ordered list of packages, but a dependency graph (maybe without transitive dependencies)

@dirk-thomas
Copy link
Member

This is not schedule to be implemented (assinged to milestone "untargeted"). Anyway patches implementing this feature are welcome.

@dirk-thomas
Copy link
Member

Pass to @wjwwood.

@wjwwood
Copy link
Member

wjwwood commented Dec 3, 2013

Upgraded to a pull request.

@wjwwood
Copy link
Member

wjwwood commented Dec 3, 2013

This pull request is still a work in progress, I have chosen to rewrite the command from scratch, not reusing (by importing) anything used in the current catkin_make_isolated and catkin_make commands because of the significant restructuring of the flow control and logic. Much of the code is obviously based on or copied from the old implementations.

Some high level concepts I have been using:

  • Command: single action to execute as part of a group of commands which can build a package
  • Job: contains a list of Commands and meta data about how to build a package
    • extended to typed jobs (CatkinJob and CMakeJob)
  • Executor: multiprocessing process which consumes Job's and executes each of the Job's Commands in order

Some things I had to address:

  • Synchronization of I/O: Each executor generates events, which the main thread of execution process
  • Capturing Color: The executors capture colored output from the subprocesses (on unix only for now)
  • Interleaved I/O: The output has to remain readable with proper handling for multi line and carriage return output from multiple commands simultaneously
  • Locking of Spaces: There is a system for commands to indicate which spaces (devel/install) it uses, so that they can be locked to prevent multiple jobs from writing the same file at the same time.
    • Currently only for the install space
    • May not be necessary

Currently I can build almost the entire hydro-desktop-full workspace on my mac, and the remaining build errors do not appear to be related to this command (they fail in catkin_make_isolated as well right now). I already found three instances of missing calls to include_directories in various packages using this command. I have mostly been doing unmerged devel space and no install.

This is what remains to be done from my point of view:

  • Test install
  • Test merged devel space
  • Test isolated install space
  • Add support for printing output of commands as contiguous blocks
  • Fixup verbose/quiet behavior
  • Test with DESTDIR
  • Code review
  • Finish API Documentation
  • Refactor CLI interface
  • Tutorials
  • Colorize output and optimize whitespace for visibility

These are some additional TODO's, which would be nice to have, but not strictly necessary:

  • Add checks for reusing build/devel spaces with different command options, i.e. warn when using the same devel space for merged and nonmerged devel on seprarte runs of the command
  • Automated tests for all of the corner cases

@wjwwood
Copy link
Member

wjwwood commented Dec 20, 2013

@jonbinney d7b2b26

@wjwwood
Copy link
Member

wjwwood commented Dec 26, 2013

Ok, 86a89b2 seems to work for me too.

@wjwwood
Copy link
Member

wjwwood commented Dec 27, 2013

@dirk-thomas can you look at this commit 0548d50?

Does that make sense as a better default?

@dirk-thomas
Copy link
Member

Yeah, that looks much more straight forward.

@wjwwood
Copy link
Member

wjwwood commented Dec 27, 2013

Ok, I address the comments and I removed the last os.remove as the file should not exist after os.rename anyways.

this single implementation in the
catkin.cmi.common module also can cache the result
because calculating it is expensive and done
each time a job finishes
you can now:
- build explicit packages in the workspace
- choose to not build deps with --no-deps
- passing arbitrary cmake/make args now works
- only list the packages to be built, do not build

These options were add but are not implemented:
- skip packages up to a certain pkg, --start-with
- order the output of commands into blocks
pcmi now outputs delayed, ordered output by
default, and you can instruct it to output
interleaved data without a delay. It will also
printout data without delay when only one
executor is being used.
@wjwwood
Copy link
Member

wjwwood commented Mar 12, 2014

I am going to close this pull request in favor of the implementation in the new catkin_tools package as catkin build:

https://github.com/catkin/catkin_tools

I'll leave the branch around for people who might be using it.

@wjwwood wjwwood closed this Mar 12, 2014
@jbohren
Copy link
Member

jbohren commented Mar 12, 2014

Thanks for the update, Will. First glance at the docs and this is looking pretty awesome!

@wjwwood
Copy link
Member

wjwwood commented Mar 12, 2014

Sure, I'm hoping to get this into a good state for Indigo.

@jbohren
Copy link
Member

jbohren commented Mar 12, 2014

I just downloaded and installed it from source. I ran catkin build and said "woah" out loud.

@wjwwood
Copy link
Member

wjwwood commented Mar 12, 2014

Colors man, colors.

@tkruse
Copy link
Member Author

tkruse commented Mar 12, 2014

well done

@dirk-thomas dirk-thomas deleted the parallel_cmi branch November 11, 2019 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants