Bug 912205 - RFE: A way to sync tasks between two Beaker instances
Summary: RFE: A way to sync tasks between two Beaker instances
Alias: None
Product: Beaker
Classification: Community
Component: command line
Version: 0.11
Hardware: Unspecified
OS: Unspecified
low vote
Target Milestone: 0.12
Assignee: Amit Saha
QA Contact: Dan Callaghan
Whiteboard: TaskLibrary
Keywords: FutureFeature
Depends On: 915549
TreeView+ depends on / blocked
Reported: 2013-02-18 06:11 UTC by Amit Saha
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Clone Of:
Last Closed: 2013-04-11 04:56:20 UTC

Attachments (Terms of Use)

Description Amit Saha 2013-02-18 06:11:51 UTC
Description of problem:

A tool to sync task RPMs (the base for running Beaker tests) between two Beaker instances would be good to have.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

$ beaker-tasks-sync <server1> <server2> 

will sync tasks between server 1 and server2 

Additional info:

Comment 1 Amit Saha 2013-02-18 06:12:31 UTC
On Gerrit: http://gerrit.beaker-project.org/#/c/1727/

Comment 2 Amit Saha 2013-02-27 00:53:54 UTC
I added the dependency on https://bugzilla.redhat.com/show_bug.cgi?id=912205 since, the script will break if the that bug is not fixed.

Comment 3 Dan Callaghan 2013-03-26 03:43:11 UTC
This needed two small patches to get it going:


but even then, I couldn't get it to successfully sync from production Beaker to beaker-devel. It spends a *really* long time grabbing all the task info from the source, and if something goes wrong like this (I assume a network glitch):

Getting the list of tasks from source and destination..
Finding tasks to upload to destination..
XML-RPC connection to beaker.engineering.redhat.com failed: Connection reset by peer, 5 retries left
Traceback (most recent call last):
  File "/usr/bin/beaker-sync-tasks", line 9, in <module>
    load_entry_point('bkr.server==0.11.3', 'console_scripts', 'beaker-sync-tasks')()
  File "/usr/lib/python2.6/site-packages/bkr/server/tools/sync_tasks.py", line 303, in main
    task_urls = task_sync.tasks_diff(new_tasks, old_tasks)
  File "/usr/lib/python2.6/site-packages/bkr/server/tools/sync_tasks.py", line 152, in tasks_diff
    task_xml = pool.map(self._get_task_xml, new_tasks)
  File "/usr/lib64/python2.6/multiprocessing/pool.py", line 148, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib64/python2.6/multiprocessing/pool.py", line 422, in get
    raise self._value
xmlrpclib.ProtocolError: <ProtocolError for XXX: -1 >

then the whole process fails.

I think it needs to do each task incrementally instead. Something along these lines:

* get list of all tasks in source
* for each task in source:
    * print which task it is doing
    * get task info from source
    * get task info from destination
    * if versions don't match, upload from source to destination

Comment 4 Amit Saha 2013-03-26 05:47:39 UTC
On Gerrit: http://gerrit.beaker-project.org/#/c/1828/

Comment 8 Dan Callaghan 2013-04-11 04:56:20 UTC
Beaker 0.12 has been released.

Note You need to log in before you can comment on or make changes to this bug.