Merge lp:lava-dashboard/multinode into lp:lava-dashboard
Proposed by
Neil Williams
Status: | Merged |
---|---|
Approved by: | Neil Williams |
Approved revision: | 411 |
Merged at revision: | 415 |
Proposed branch: | lp:lava-dashboard/multinode |
Merge into: | lp:lava-dashboard |
Diff against target: |
246 lines (+192/-4) 2 files modified
dashboard_app/templates/dashboard_app/_test_run_list_table.html (+6/-0) dashboard_app/xmlrpc.py (+186/-4) |
To merge this branch: | bzr merge lp:lava-dashboard/multinode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil Williams | Approve | ||
Review via email: mp+181101@code.launchpad.net |
Description of the change
Landing MultiNode.
Handles the aggregation of MultiNode result bundles after the XMLRPC calls which are coordinated by LAVA Coordinator.
This branch applies without conflicts.
lava-dashboard will be the first shared MultiNode branch to be merged as these changes are not dependent on changes in the other shared branches.
To post a comment you must log in.
> === modified file 'dashboard_ app/xmlrpc. py' app/xmlrpc. py 2013-05-02 10:35:29 +0000 app/xmlrpc. py 2013-08-20 16:56:49 +0000 contrib. auth.models import User, Group core.urlresolve rs import reverse app.views. redirect_ to_bundle' , {'content_ sha1':bundle. content_ sha1})) content) write(" %s\n" % content) debug(" Dashboard pending submission caused an exception: %s" % e)
> --- dashboard_
> +++ dashboard_
> @@ -2,7 +2,7 @@
> #
> # Author: Zygmunt Krynicki <email address hidden>
> #
> -# This file is part of Launch Control.
> +# This file is part of LAVA Dashboard
> #
> # Launch Control is free software: you can redistribute it and/or modify
> # it under the terms of the GNU Affero General Public License version 3
> @@ -25,7 +25,9 @@
> import logging
> import re
> import xmlrpclib
> -
> +import hashlib
> +import json
> +import os
> from django.
> from django.
> from django.db import IntegrityError, DatabaseError
> @@ -243,6 +245,152 @@
> 'dashboard_
> kwargs=
>
> + def put_pending(self, content, group_name):
> + """
[...]
> + """
> + try:
> + # add this to a list which put_group can use.
> + sha1 = hashlib.sha1()
> + sha1.update(
> + hexdigest = sha1.hexdigest()
> + groupfile = "/tmp/%s" % group_name
> + with open(groupfile, "a+") as grp_file:
> + grp_file.
> + return hexdigest
> + except Exception as e:
> + logging.
Is there a race condition here? It's fine for two or more processes to append
to the same file, but it's possible that depending on the size of the bundles
and on line buffering issues the contents of different bundles might get
intermingled. Maybe we should write each bundle to its own separate file, then
read them all on put_group.
Also, I miss some sort of authentication to avoid the risk of having attackers
submitting random crap into bundle streams for multinode groups. I guess
put_group already handles authentication because it uses the underlying bundle
stream access control?