Merge lp://staging/~canonical-platform-qa/qakit/app_startup_poc into lp://staging/qakit

Proposed by Sergio Cazzolato
Status: Merged
Approved by: Allan LeSage
Approved revision: 64
Merged at revision: 49
Proposed branch: lp://staging/~canonical-platform-qa/qakit/app_startup_poc
Merge into: lp://staging/qakit
Diff against target: 782 lines (+691/-2)
14 files modified
README (+48/-0)
debian/control (+2/-0)
qakit/appstartup/__init__.py (+33/-0)
qakit/appstartup/dao.py (+102/-0)
qakit/appstartup/data_processor.py (+74/-0)
qakit/appstartup/eve/__init__.py (+16/-0)
qakit/appstartup/eve/run.py (+22/-0)
qakit/appstartup/eve/settings.py (+89/-0)
qakit/appstartup/orchestrator.py (+99/-0)
qakit/appstartup/parser.py (+65/-0)
qakit/appstartup/plotter.py (+63/-0)
qakit/appstartup/report.py (+72/-0)
qakit/config.py (+4/-2)
setup.py (+2/-0)
To merge this branch: bzr merge lp://staging/~canonical-platform-qa/qakit/app_startup_poc
Reviewer Review Type Date Requested Status
Allan LeSage (community) Approve
Richard Huddie (community) Needs Fixing
Review via email: mp+283698@code.staging.launchpad.net

Commit message

Process to parse logs, upload data to mongo db and plot the app startup times for the last builds.

Dependencies:
Install pip by doing: "sudo apt-get install python-pip python-dev build-essential"

Download and Install eve (http://python-eve.org/install.html)
Run eve by doing python qakit/appstartup/eve/run.py (you can define the env variables, see in file settings.py)

Download and install mongodb (https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/)
Create a user for mongo and remember to update the eve settings file
To create the mongo user type: "mongo" and then
db.createUser(
   {
     user: "ubuntuUser",
     pwd: "ubuntuPassword",
     roles: [ { role: "readWrite", db: "test" } ]
   }
)
Note: eve code is ready to run with python 2.7 and 3.X

Network configuration when the eve machine is hosted in canonistack:

  1- Allow ip routing by doing:
  sysctl -w net.ipv4.ip_forward=1

  2- Make sure the os allow to route to localnet by doing:
  sudo sysctl -w net.ipv4.conf.eth0.route_localnet=1

  3- configure iptables by doing:
  sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 5000 -j DNAT
  --to-destination 127.0.0.1:5000

To run the import and plotting process it is needed to run the following tests with the command "./run-system-tests ubuntu_system_tests.tests.app_startup.test_application_startup" for the branch lp:~canonical-platform-qa/ubuntu-system-tests/app_startup_poc.

Then, having a test-results.subunit file, run as following: python3 qakit/appstartup/orchestrator.py ~/Desktop/app_startup/test-results.subunit

The html report will be generated in ~/Desktop/app_startup/app_startup_report.html

Description of the change

The eve service is currently available on:

  http://10.55.61.109:5000/appstartup

Jenkins job available on:

  https://platform-qa-jenkins.ubuntu.com/job/cachio-appstarup

To post a comment you must log in.
48. By Sergio Cazzolato

Merge with trunk and conflicts resolved

Revision history for this message
Richard Huddie (rhuddie) wrote :

Could you add a README with all the setup steps listed similar to above description? Or update existing one?

I found it a little confusing as the existing qakit README mentions only python 2 support:
http://bazaar.launchpad.net/~canonical-platform-qa/qakit/trunk/view/head:/README

review: Needs Fixing
49. By Sergio Cazzolato

Supporting the run type

50. By Sergio Cazzolato

Adding env variable for qakit config file

51. By Sergio Cazzolato

Making configurable the ip and port used by eve

52. By Sergio Cazzolato

Change to access from external ip to the local service

53. By Sergio Cazzolato

Adding missing file to create a html report

54. By Sergio Cazzolato

Making url path configurable

55. By Sergio Cazzolato

Changing graphics colors

56. By Sergio Cazzolato

Adding some styles to the report

57. By Sergio Cazzolato

Minor changes in the report

58. By Sergio Cazzolato

Adding json report

59. By Sergio Cazzolato

Improving how reports are managed

60. By Sergio Cazzolato

Adding docs to the README

61. By Sergio Cazzolato

Adding missing docs to the README

62. By Sergio Cazzolato

Adding configs for reports and adding more info json report

63. By Sergio Cazzolato

updating json report

Revision history for this message
Allan LeSage (allanlesage) wrote :

I have yet to get this working all the way but some comments to deal with meanwhile:

When you're using requests.get or .post, just pass the data as a named keyword argument *params* with a dict of data, it's much clearer than formatting the URL yourself IMO.

For the HTML rendering, it'd be cleaner to use a jinja2 template, instead of concatenating the HTML together piecemeal. Happy to help get that going, or you could just drag the metrics stuff into a shared location? Would you have a look at qakit/metrics/reports/__init__.py:render_html ?

What does dao mean?

More comments tomorrow, just wanted to get started ;) .

review: Needs Fixing
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Going to use params to format the url.

The html report is going to disappear once we have it in trunk as we are going to use the dashboard. SO I don't see the need to change this implementation, don't you?

64. By Sergio Cazzolato

Adding paramter to filter number of builds to consider and using params to format the urls

Revision history for this message
Allan LeSage (allanlesage) wrote :

Thanks for that change, propose to merge this--it's just a proof of concept after all ;) --and it doesn't affect any existing code.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: