Merge ~chad.smith/cloud-init:analyze into cloud-init:master
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merge reported by: | Chad Smith | ||||
| Merged at revision: | 1de597f3d5341eddb4af7ec555e15897e7579e83 | ||||
| Proposed branch: | ~chad.smith/cloud-init:analyze | ||||
| Merge into: | cloud-init:master | ||||
| Diff against target: |
1141 lines (+995/-33) 10 files modified
Makefile (+1/-1) cloudinit/analyze/__init__.py (+0/-0) cloudinit/analyze/__main__.py (+155/-0) cloudinit/analyze/dump.py (+176/-0) cloudinit/analyze/show.py (+207/-0) cloudinit/analyze/tests/test_dump.py (+210/-0) cloudinit/cmd/main.py (+15/-29) doc/rtd/index.rst (+1/-0) doc/rtd/topics/debugging.rst (+146/-0) tests/unittests/test_cli.py (+84/-3) |
||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-08-21 | |
| Scott Moser | Approve on 2017-08-21 | ||
| Chad Smith | Approve on 2017-08-14 | ||
| Ryan Harper | 2017-08-10 | Needs Fixing on 2017-08-14 | |
|
Review via email:
|
|||
Description of the Change
tools: Add tooling for basic cloud-init performance analysis.
This branch adds cloudinit-analyze into cloud-init proper. It adds an "analyze" subcommand to the cloud-init command line utility for quick performance assessment of cloud-init stages and events.
On a cloud-init configured instance, running "cloud-init analyze blame" will now report which cloud-init events cost the most wall time. This allows for quick assessment of the most costly stages of cloud-init.
This functionality is pulled from Ryan Harper's analyze work.
The cloudinit-analyze main script itself has been refactored a bit for inclusion as a subcommand of cloud-init CLI. There will be a followup branch at some point which will optionally instrument detailed strace profiling, but that approach needs a bit more discussion first.
This branch also adds:
* additional debugging topic to the sphinx-generated docs describing cloud-init analyze, dump and show as well as cloud-init single usage.
* Updates the Makefile unittests target to include cloudinit directory because we now have unittests within that package.
LP: #1709761
- 83ea2f2... by Chad Smith on 2017-08-10
FAILED: Continuous integration, rev:cf8e6825a2d
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
| Ryan Harper (raharper) wrote : | # |
Thanks for getting this started.
- f915957... by Chad Smith on 2017-08-10
| Ryan Harper (raharper) wrote : | # |
Took the integrated version for a test-drive, here's the results
http://
tl;dr need to fix the dump_events() from raising exception on both sources; it's OK to accept both; the code prefers the rawdata over reading it from the input file handle.
Also noted the initial experience should have a quick summary like systemd-analyze does (one-line summary)
- d56f89e... by Chad Smith on 2017-08-14
- 04943ff... by Chad Smith on 2017-08-14
- b760d26... by Chad Smith on 2017-08-14
FAILED: Continuous integration, rev:19b08e84e2f
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:4c65f2c3003
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 2910c89... by Chad Smith on 2017-08-14
- 3e29581... by Chad Smith on 2017-08-14
- da36e95... by Chad Smith on 2017-08-14
- 100a79f... by Chad Smith on 2017-08-14
FAILED: Continuous integration, rev:4c60df58ed7
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:7228b6bdae0
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- e361cf6... by Chad Smith on 2017-08-14
FAILED: Continuous integration, rev:f5f7ebeb13c
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 377487a... by Chad Smith on 2017-08-14
- 6db7629... by Chad Smith on 2017-08-14
- e670828... by Chad Smith on 2017-08-14
- 3f4866d... by Chad Smith on 2017-08-14
- e79ae4b... by Chad Smith on 2017-08-14
FAILED: Continuous integration, rev:2fdfab74878
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 2c20cba... by Chad Smith on 2017-08-15
- 5613597... by Chad Smith on 2017-08-15
FAILED: Continuous integration, rev:fa27fddb663
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 9e5c844... by Chad Smith on 2017-08-15
FAILED: Continuous integration, rev:053bae69d83
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 9d21915... by Chad Smith on 2017-08-16
FAILED: Continuous integration, rev:869a360232b
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
FAILED: CentOS 6 & 7: Build & Test
Click here to trigger a rebuild:
https:/
- 69e5ab8... by Chad Smith on 2017-08-16
FAILED: Continuous integration, rev:202a1eacc67
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
FAILED: CentOS 6 & 7: Build & Test
Click here to trigger a rebuild:
https:/
- fd0782c... by Chad Smith on 2017-08-16
FAILED: Continuous integration, rev:4054cc8a282
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
FAILED: MAAS Compatability Testing
Click here to trigger a rebuild:
https:/
- f350fee... by Chad Smith on 2017-08-16
FAILED: Continuous integration, rev:f7504a2a684
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 1ca5f87... by Chad Smith on 2017-08-16
FAILED: Continuous integration, rev:f31e269c993
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
FAILED: Ubuntu LTS: Build
Click here to trigger a rebuild:
https:/
- 2a26527... by Chad Smith on 2017-08-17
PASSED: Continuous integration, rev:c810c18c63b
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Ryan Harper (raharper) wrote : | # |
couple more tweaks to docs
- fb45814... by Chad Smith on 2017-08-18
PASSED: Continuous integration, rev:ff8b5aabeda
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
please spell check and line-wrap your commit message.
some comments inline.
generally we really dont want to make the default cloud-init run on boot be *slower* because we're we want to profile it.
| Chad Smith (chad.smith) wrote : | # |
> please spell check and line-wrap your commit message.
> some comments inline.
Just reworded a bit of the description
>
> generally we really dont want to make the default cloud-init run on boot be
> *slower* because we're we want to profile it.
Thankfully we don't do any of that, this branch only adds a CLI tool we can call to parse cloud-init.log files.
- 3d35b62... by Chad Smith on 2017-08-18
- 1aaacf6... by Chad Smith on 2017-08-18
- 32a2217... by Chad Smith on 2017-08-18
PASSED: Continuous integration, rev:d4ae03007ae
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:6750733930b
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
some responses. thanks for the conditional loading.
I suggested we drop the doc on profiling sections as they're actually present in this merge proposal.
In the future if those come back, I'd like for the prompt to change between systems. I guess I wasn't clear before on your profiling sections show:
# IO tracing on the cloud-image disk and seed device
$ ssh -p 2222 ubuntu@localhost
$ cd /var/lib/
$ sudo zcat vda1.blktrace.* | blkparse -i - -s
I think that it is more clear as:
$ ssh -p 2222 ubuntu@localhost
% cd /var/lib ...
or even
$ ssh -p 2222 ubuntu@localhost
ubuntu@guest$ cd /var/lib/ ...
| Ryan Harper (raharper) wrote : | # |
On Fri, Aug 18, 2017 at 4:11 PM, Scott Moser <email address hidden> wrote:
> Review: Needs Information
>
> please spell check and line-wrap your commit message.
> some comments inline.
>
> generally we really dont want to make the default cloud-init run on boot
> be *slower* because we're we want to profile it.
>
>
> Diff comments:
>
> > diff --git a/Makefile b/Makefile
> > index f280911..9e7f4ee 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -48,7 +48,7 @@ pyflakes3:
> > @$(CWD)
> >
> > unittest: clean_pyc
> > - nosetests $(noseopts) tests/unittests
> > + nosetests $(noseopts) tests/unittests cloudinit
>
> mention that in your changelog message.
>
> >
> > unittest3: clean_pyc
> > nosetests3 $(noseopts) tests/unittests
> > diff --git a/cloudinit/
> > index 139e03b..a977f0d 100644
> > --- a/cloudinit/
> > +++ b/cloudinit/
> > @@ -22,6 +22,7 @@ import traceback
> > from cloudinit import patcher
> > patcher.patch() # noqa
> >
> > +from cloudinit.
>
> This import means the boot time run of cloud-init incurs the cost of
> loading those files off disk an generally parsing this.
>
> We had discussed at least at one point hiding this behind 'devel'
> argument. If that was the case, then we could look at the first argument
> and import devel things if necessary.
>
> Ie 'cloud-init init' would not ever import the analyze, but 'cloud-init
> devel' would. As well as ideally, 'cloud-init help' would.
>
While I agree in general with the concept, and I'm not objecting to the
conditional loading; analyze as a module does not
touch any new imports that cloudinit/
(except for the 3 files in analyze subdir)
If we're worried about import/stat/load, then we should attack the rather
large util.py which is imported in many places
and that's just one of the modules that main.py is importing. Adding
analyze will have no significant impact.
Here's main.py's imports[1]:
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
'cloudinit/
- d2bda9d... by Chad Smith on 2017-08-21
PASSED: Continuous integration, rev:6c5ff9b2ca5
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- f1ab028... by Chad Smith on 2017-08-21
| Scott Moser (smoser) wrote : | # |
my 2 comments/requests
a.) un-change your 'iff' change (if and only if).
b.) in your commit message drop the link to the rharper branch that
might not exist at some point in the future.
Instead just say "from Ryan Harper's work" or something.
- 1de597f... by Chad Smith on 2017-08-21
PASSED: Continuous integration, rev:f39496a87db
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:1de597f3d53
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/


FAILED: Continuous integration, rev:ff4396d6a45 791bf31b78cdfe7 457e90d00f02ed /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 132/
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 132/rebuild
https:/