All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaotong lv <xiaotongx.lv@intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 0/1] Webhob: helper based on webservice
Date: Wed,  6 Jun 2012 05:58:19 -0400	[thread overview]
Message-ID: <cover.1338969711.git.xiaotongx.lv@intel.com> (raw)

This helper is a bitbake ui, based on soaplib 1.0 lib to implement a webservice interface.
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 11eab3487db83bd1f4ca65de2767afbdc9958af0:

  Webhob: a general helper interface based on webservice (2012-06-02 06:00:10 -0400)

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: Clean up the code and	 modify some errors

 bitbake/lib/bb/ui/crumbs/webserviceeventhandler.py |   20 ++++---
 bitbake/lib/bb/ui/webhob_webservice.py             |   53 ++++++++-----------
 2 files changed, 33 insertions(+), 40 deletions(-)

-- 
1.7.4.4




             reply	other threads:[~2012-06-05 10:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  9:58 Xiaotong lv [this message]
2012-06-05 12:42 ` [PATCH 0/1] Webhob: helper based on webservice Wang, Shane
2012-06-06  9:58 ` [PATCH 1/1] Webhob: Clean up the code and modify some errors Xiaotong lv
2012-06-05 12:43   ` Wang, Shane
  -- strict thread matches above, loose matches on Subject: below --
2012-06-07  1:51 [PATCH 0/1] Webhob: helper based on webservice Xiaotong lv
2012-06-13  5:56 ` Wang, Shane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1338969711.git.xiaotongx.lv@intel.com \
    --to=xiaotongx.lv@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.