From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com ([143.182.124.21]) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1Sc5Zm-0007ZL-Bp for bitbake-devel@lists.openembedded.org; Wed, 06 Jun 2012 04:02:22 +0200 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 05 Jun 2012 18:50:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="152125533" Received: from lxt.sh.intel.com ([10.239.47.147]) by azsmga001.ch.intel.com with ESMTP; 05 Jun 2012 18:50:49 -0700 From: Xiaotong lv To: bitbake-devel@lists.openembedded.org Date: Wed, 6 Jun 2012 21:51:07 -0400 Message-Id: X-Mailer: git-send-email 1.7.4.4 Subject: [PATCH 0/1] Webhob: helper based on webservice X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 02:02:22 -0000 This helper is a bitbake ui, based on soaplib 1.0 lib to implement a webservice interface. Using 'bitbake -u webhob_webserivce ip:port' to startup this help. I defined 2 webservice methods, they are runCommand(param) and getEvent(). Different languages can remotely call the 2 methods to communicate with bitbake. such as php, java, js, python and so on. 1. runCommand(param) method is responsible for sending commands to bitbake server. the param format is: { 'function' : string (required, function name) 'param_type': array(string) (optional, params types, values only are 'string', 'list' or 'bool') 'params' : array(string) (optional, string param corresponds to itself, list type corresponds to 'str1 str2 str3 ....', bool type corresponds to 'true' or 'false' ) } some examples: 1). to call bitbake server.runCommand(["initCooker"]) param style is: { 'function': 'initCokker' } 2). to call bitbake server.runCommand(["getVariable", "BBLAYERS"]) param style is: { 'function' : 'getVariable' 'param_type' : ['string'] 'params' : ['BBLASYERS'] } 3). to call bitbake server.runCommand(["buildTargets", list(recipe_queue), 'build']) param style is: { 'function' : 'buildTargets' 'param_type' : ['list','string'] 'params' : ['recipe1 recipe2 recipe2 recipe4 ....', 'build'] } 2. getEvent() is respinsible for getting the event results generated by bitbake event objects, it returns a standard json format data. some examples: 1) to get some async configurations: [{'event': 'ConfigFilesFound', 'values': 'poky-bleeding poky-lsb poky poky-tiny defaultsetup', 'variable': 'distro'}, {'event': 'CommandCompleted'} ] [{'event': 'ConfigFilesFound', 'values': 'atom-pc routerstationpro mpc8315e-rdb beagleboard qemumips qemuarm qemux86-64 qemux86 qemuppc', 'variable': 'machine'}, {'event': 'CommandCompleted'} 'values': 'i586 x86_64 i686', 'variable': 'machine-sdk'}, {'event': 'CommandCompleted'} ] [{'event': 'FilesMatchingFound', 'matches': 'rootfs_rpm.bbclass rootfs_deb.bbclass rootfs_ipk.bbclass', 'pattern': 'rootfs_'}, {'event': 'CommandCompleted'} ] 2) some recipe progress values [{'current': 24, 'event': 'TreeDataPreparationProgress', 'msg': 'Preparing tree data: 24/1105', 'total': 1105}, {'current': 25, 'event': 'TreeDataPreparationProgress', 'msg': 'Preparing tree data: 25/1105', 'total': 1105}, {'current': 26, 'event': 'TreeDataPreparationProgress', 'msg': 'Preparing tree data: 26/1105', 'total': 1105}, {'current': 27, 'event': 'TreeDataPreparationProgress', 'msg': 'Preparing tree data: 27/1105', 'total': 1105}, {'current': 28, 'event': 'TreeDataPreparationProgress', 'msg': 'Preparing tree data: 28/1105', 'total': 1105}, {'current': 29, 'event': 'TreeDataPreparationProgress', 'msg': 'Preparing tree data: 29/1105', 'total': 1105}] 3) some task building values [{'event': 'TaskSucceeded', 'message': 'package libpcre-native-8.21-r1: task do_populate_sysroot: Succeeded', 'package': 'libpcre-native-8.21-r1', 'pid': 30382, 'task': 'do_populate_sysroot'}, {'event': 'runQueueTaskCompleted', 'pid': 0, 'taskid': 753, 'taskstring': 'virtual:native:/home/xiaotong/workspace/python/poky-contrib/meta/recipes-support/libpcre/libpcre_8.21.bb, do_populate_sysroot'}, {'event': 'runQueueTaskStarted', 'noexec': False, 'pid': 0, 'stats': {'active': 0, 'completed': 324, 'failed': 0}, 'taskid': 709, 'taskstring': 'virtual:native:/home/xiaotong/workspace/python/poky-contrib/meta/recipes-support/db/db_5.1.19.bb, do_populate_sysroot'}, {'event': 'TaskStarted', 'message': 'package db-native-5.1.19-r4: task do_populate_sysroot: Started', 'package': 'db-native-5.1.19-r4', 'pid': 30447, The following changes since commit 3bf8069100e54153d13319dc32ca089327b6a139: documentation/yocto-project-qs/yocto-project-qs.xml: added quotes (2012-05-01 21:00:36 +0100) are available in the git repository at: git://git.yoctoproject.org/poky-contrib xtlv/webhob-webservice http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=xtlv/webhob-webservice Xiaotong lv (1): Webhob: a general helper interface based on webservice bitbake/lib/bb/ui/crumbs/webserviceeventhandler.py | 190 ++++++++++++++++++++ bitbake/lib/bb/ui/webhob_webservice.py | 141 +++++++++++++++ 2 files changed, 331 insertions(+), 0 deletions(-) create mode 100644 bitbake/lib/bb/ui/crumbs/webserviceeventhandler.py create mode 100755 bitbake/lib/bb/ui/webhob_webservice.py -- 1.7.4.4