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

feat(colcon-build): use nice command to not overuse resources #308

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Aug 19, 2024

Description

nice is part of GNU coreutils, let's you run a program with modified scheduling priority.

Comes bundled in the our Ubuntu containers.

This PR aims to utilize it to prevent colcon build from overusing the runner resources.

man page

Run COMMAND with an adjusted niceness, which affects process scheduling. With no COMMAND,
print the current niceness. Niceness values range from -20 (most favorable to the
process) to 19 (least favorable to the process).

I set the default to be 19 in this PR.

Original default was 10.

Related PR:

Failure example for a runner due to over-usage of a machine during colcon build:

Tests performed

Effects on system behavior

Not applicable.

Interface changes

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@xmfcx xmfcx requested a review from mitsudome-r August 19, 2024 12:39
@xmfcx xmfcx self-assigned this Aug 19, 2024
@xmfcx xmfcx marked this pull request as draft August 19, 2024 12:46
@xmfcx
Copy link
Contributor Author

xmfcx commented Aug 19, 2024

@xmfcx xmfcx marked this pull request as ready for review August 19, 2024 13:23
@xmfcx
Copy link
Contributor Author

xmfcx commented Aug 19, 2024

Even with the nice command,
https://github.com/autowarefoundation/autoware.universe/actions/runs/10454375310/job/28946832098?pr=8498

this one has lost connection due to resource overuse.

Machine had 15GB RAM and 8vCPU and 0 swap.

Added a specs step for these: https://github.com/autowarefoundation/autoware.universe/actions/runs/10454375310/job/28946832098?pr=8498#step:5:1

@xmfcx
Copy link
Contributor Author

xmfcx commented Aug 19, 2024

We can still merge this but I will create another PR that enables user to set parallel workers or makeflags

@xmfcx xmfcx merged commit 89245b3 into main Aug 20, 2024
12 of 13 checks passed
@xmfcx xmfcx deleted the feat/colcon-build-nice branch August 20, 2024 08:04
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.

2 participants