From patchwork Tue Sep 17 21:23:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fu Wei Fu X-Patchwork-Id: 20378 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BCA9A203C2 for ; Tue, 17 Sep 2013 21:23:26 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf6274078vcb.3 for ; Tue, 17 Sep 2013 14:23:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:to:from:subject :message-id:date:reply-to:sender:errors-to:precedence :x-original-sender:x-original-authentication-results:mailing-list :list-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=7xd1JLb/THMCYKgy3nNzZ0xBY2kycdmk/fQmer6DFgI=; b=cwklKhOL5LpjA5iqsQ/u3cmYRlPmfdLnX76/W4s81N2ib/Um1VIXtEWZt7C+YETH+M QPLj8Xm8iP3TLRKhth1TE1sqN1K82Q02cib8xh1ESoQITVbTJ46ChOMJDALbA3cxEvw4 /bbIcs61Fd6Q9CemSjtTBZ9dO3hV6AZVlCMUJZvXmG/VguGHmnchUGjNizciD/I6SJU4 UhRIcuPjVBBFUp8LGst/fnLZ4bainXqulAGYy5bKgx9lDeJBAC25hvrFUHlckzFLLRbX LxuA8bq0w4/sZkLX9m1+CcAuRyltPnSUSVqXsW/6uS015XWRlxcdlN15b+E+n4BDdx2d WKqg== X-Gm-Message-State: ALoCoQkyFEsCzPhbl2SvPDDfZPlGZmGAIbkT7HXMNYxxgIUuM74f41ODwMKU2cFH3HaDnMoVyqs6 X-Received: by 10.236.94.39 with SMTP id m27mr1530463yhf.54.1379453006511; Tue, 17 Sep 2013 14:23:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.108.230 with SMTP id hn6ls3093270qeb.81.gmail; Tue, 17 Sep 2013 14:23:26 -0700 (PDT) X-Received: by 10.52.34.109 with SMTP id y13mr29419912vdi.8.1379453006419; Tue, 17 Sep 2013 14:23:26 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id sc5si9288207vdc.113.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Sep 2013 14:23:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so4810206veb.16 for ; Tue, 17 Sep 2013 14:23:26 -0700 (PDT) X-Received: by 10.52.98.131 with SMTP id ei3mr28707204vdb.4.1379453006323; Tue, 17 Sep 2013 14:23:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp182053vcz; Tue, 17 Sep 2013 14:23:25 -0700 (PDT) X-Received: by 10.180.206.42 with SMTP id ll10mr4203800wic.50.1379453004823; Tue, 17 Sep 2013 14:23:24 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id v4si14866532wja.101.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Sep 2013 14:23:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1VM2k0-0001RS-C9 for ; Tue, 17 Sep 2013 21:23:24 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 4F59CF6747 for ; Tue, 17 Sep 2013 21:23:24 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 261 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 261: Add LMP modules init value support Message-Id: <20130917212324.28197.95666.launchpad@ackee.canonical.com> Date: Tue, 17 Sep 2013 21:23:24 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16765"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 3beb26c6233c2f21e0ce5d17599b411a09ca41d3 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ------------------------------------------------------------ revno: 261 committer: Fu Wei branch nick: lmp timestamp: Tue 2013-09-10 21:20:02 +0800 message: Add LMP modules init value support modified: lava_scheduler_app/utils.py --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === modified file 'lava_scheduler_app/utils.py' --- lava_scheduler_app/utils.py 2013-09-02 16:22:57 +0000 +++ lava_scheduler_app/utils.py 2013-09-10 13:20:02 +0000 @@ -45,6 +45,7 @@ node_json = {} all_nodes = {} node_actions = {} + node_lmp = {} # Check if we are operating on multinode job data. Else return the job # data as it is. @@ -56,6 +57,7 @@ # get all the roles and create node action list for each role. for group in json_jobdata["device_group"]: node_actions[group["role"]] = [] + node_lmp[group["role"]] = [] # Take each action and assign it to proper roles. If roles are not # specified for a specific action, then assign it to all the roles. @@ -71,6 +73,19 @@ else: node_actions[role].append(new_action) + # For LMP init in multinode case + all_lmp_modules = json_jobdata["lmp_module"] + for role in node_lmp.keys(): + for lmp in all_lmp_modules: + new_lmp = copy.deepcopy(lmp) + if 'parameters' in new_lmp \ + and 'role' in new_lmp["parameters"]: + if new_lmp["parameters"]["role"] == role: + new_lmp["parameters"].pop('role', None) + node_lmp[role].append(new_lmp) + else: + node_lmp[role].append(new_lmp) + group_count = 0 for clients in json_jobdata["device_group"]: group_count += int(clients["count"]) @@ -86,6 +101,7 @@ node_json[role][c]["group_size"] = group_count node_json[role][c]["target_group"] = target_group node_json[role][c]["actions"] = node_actions[role] + node_json[role][c]["lmp_module"] = node_lmp[role] node_json[role][c]["role"] = role # multinode node stage 2