Skip to content

tools: Refactor notification API #6781

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 20 commits into from
May 7, 2018
Merged

Conversation

theotherjimmy
Copy link
Contributor

Description

Historically, the notification API is coupled to an mbedToolchain instance.
This is problematic for things that could use notification without a toolchain
object, such a export zipping, or post build merge scripts, and this is a poor
coupling of the API that requires passing many, many parameters through to the
toolchain, such as verbose and silent.

This PR decouples the notification API from the toolchain object, and delegates
implementaion of this Notifier API to a single implementation:
TerminalNotifier. In testing this PR I prototyped another implementation as
part of the Online Compiler's build back end.

This new API allowed me to decouple the verbosity parameter handling, -v and
--silent, from the build API entirely. They are now completely oblivious to
these parameters, instead calling methods on the Notifier object that they
are passed.

Pull request type

[ ] Fix
[x] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@theotherjimmy
Copy link
Contributor Author

TODO for tomorrow theotherjimmy: Fix those dang tools tests.

@theotherjimmy
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 2, 2018

Build : ABORTED

Build number : 1884
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6781/

@0xc0170
Copy link
Contributor

0xc0170 commented May 2, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented May 2, 2018

Build : ABORTED

Build number : 1891
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6781/

@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

Aborted again, but not by us, tests are failing and then results in timeout? Please review

@0xc0170 0xc0170 removed the needs: CI label May 3, 2018
@theotherjimmy
Copy link
Contributor Author

theotherjimmy commented May 3, 2018

@0xc0170 Yeah, it looks like IAR everything is failing for some targets.

That way we separate the collection of notifications from everything else
@theotherjimmy
Copy link
Contributor Author

@0xc0170 I got the bug, I think. The test builds were sharing a notifier, which basically squared the amount of output we got.

@theotherjimmy
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 3, 2018

Build : ABORTED

Build number : 1910
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6781/

@theotherjimmy
Copy link
Contributor Author

/morph build

@theotherjimmy
Copy link
Contributor Author

theotherjimmy commented May 3, 2018

So the prior abort was caused by a combination of a few things leading up to the test builder consuming an unbounded (and very, very large) amount of RAM. That commit seems to keep it capped at a little less than 400MB on my machine. At particularly bad spots, the prior commit could consume >2GB RAM on my machine.

29% speedup (old: 45sec, new: 35sec) on my machine
@theotherjimmy
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 3, 2018

Build : SUCCESS

Build number : 1918
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6781/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented May 4, 2018

@theotherjimmy Can you review the jenkins CI failure, there's a build error

@theotherjimmy
Copy link
Contributor Author

@0xc0170 Jenkins passed.

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

@theotherjimmy
Copy link
Contributor Author

/morph test

@mbed-ci
Copy link

mbed-ci commented May 5, 2018

@0xc0170 0xc0170 requested a review from screamerbg May 7, 2018 08:01
Copy link
Contributor

@screamerbg screamerbg left a comment

Choose a reason for hiding this comment

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

Quite a large change set, but for all the important things. Thanks, @theotherjimmy!

@cmonr cmonr merged commit 53d3c43 into ARMmbed:master May 7, 2018
@cmonr cmonr removed the needs: CI label May 7, 2018
@jeromecoutant
Copy link
Collaborator

Hi @theotherjimmy

Since this PR merge, build python script is not working any more :-(

$ python tools/build.py -m NUCLEO_F030R8 -t ARM
name 'TerminalNotifer' is not defined

@0xc0170
Copy link
Contributor

0xc0170 commented May 15, 2018

@jeromecoutant Thanks for reporting. we will look at this

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.

6 participants