tb3/build-scripts/dev-bibisect-build | 6 +++--- tb3/dist-packages/tb3/scheduler.py | 14 ++++++++------ tb3/replay-branch | 3 +-- tb3/tb3 | 5 ++++- tb3/tb3-local-client | 19 ++++++++++++------- 5 files changed, 28 insertions(+), 19 deletions(-)
New commits: commit 9b585153fef2fb9266ba325929f82a2f7c9ce4c3 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Thu Jul 25 00:03:38 2013 +0200 just force set the branch, no checkout needed diff --git a/tb3/replay-branch b/tb3/replay-branch index f891e11..79fdfcc 100755 --- a/tb3/replay-branch +++ b/tb3/replay-branch @@ -34,8 +34,7 @@ class Syncer: except IndexError: commit = commits[0] more_commits = False - self.git.checkout(self.to_branch) - self.git.pull(commit) + self.git.branch('-f', self.to_branch, commit) return more_commits def execute(self): if self.count > 0: commit f9df322bdd0b1762bb67325f5ff923facfc9007f Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Jul 24 23:56:49 2013 +0200 pragmatic solution to clean the binary diff --git a/tb3/build-scripts/dev-bibisect-build b/tb3/build-scripts/dev-bibisect-build index 1fc00fb..5722215 100755 --- a/tb3/build-scripts/dev-bibisect-build +++ b/tb3/build-scripts/dev-bibisect-build @@ -27,7 +27,7 @@ export BINREPO_BRANCH=builder-$BUILDER export BINREPO_TAG=source-hash-$COMMIT (cd $BINREPO && git branch $BINREPO_BRANCH initial) || true git clone $BINREPO $BUILDER_HOME/artifactdir --branch $BINREPO_BRANCH -(cd $BUILDER_HOME/artifactdir && git rm -r `git ls-tree --name-only HEAD`) +(cd $BUILDER_HOME/artifactdir && git rm -r * || true) git --git-dir=$REPO log -1 --pretty=format:"source-hash-%H%n%n" $COMMIT > $BUILDER_HOME/commitmsg git --git-dir=$REPO log -1 --pretty=fuller $COMMIT >> $BUILDER_HOME/commitmsg ccache -M$CCACHE_SIZE commit db696ff988f0cdc480ae29c6b9e91003d916a0a3 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Jul 24 23:18:28 2013 +0200 sync master before getting proposals diff --git a/tb3/tb3-local-client b/tb3/tb3-local-client index 0b1b23b..16a7b1f 100755 --- a/tb3/tb3-local-client +++ b/tb3/tb3-local-client @@ -30,6 +30,7 @@ class LocalClient: self.workdir = tempfile.mkdtemp() def get_proposal(self): data = '' + self.tb3(sync=True) for line in self.tb3(show_proposals=True): data+=line proposals = json.loads(data) commit f537329bba2c3f7a879264e5c3cc9536f35c8449 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Jul 24 23:17:53 2013 +0200 we are not storing a bibisect, its unsorted diff --git a/tb3/build-scripts/dev-bibisect-build b/tb3/build-scripts/dev-bibisect-build index e7d6c29..1fc00fb 100755 --- a/tb3/build-scripts/dev-bibisect-build +++ b/tb3/build-scripts/dev-bibisect-build @@ -58,7 +58,7 @@ ccache -s echo echo -echo "==== Storing bibisect ====" +echo "==== Storing binary ====" `grep DEVINSTALLDIR $BUILDER_HOME/builddir/config_host.mk` echo archiving installation at $DEVINSTALLDIR ... git --git-dir=$BUILDER_HOME/artifactdir/.git --work-tree=$DEVINSTALLDIR add -A commit 1fcbb9cf3433d06832325f1a8c5ada5b4d0d25d0 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Jul 24 22:48:16 2013 +0200 build-scripts/ we are not storing a bibisect, its unsorted diff --git a/tb3/build-scripts/dev-bibisect-build b/tb3/build-scripts/dev-bibisect-build index 8e7326f..e7d6c29 100755 --- a/tb3/build-scripts/dev-bibisect-build +++ b/tb3/build-scripts/dev-bibisect-build @@ -64,7 +64,7 @@ echo archiving installation at $DEVINSTALLDIR ... git --git-dir=$BUILDER_HOME/artifactdir/.git --work-tree=$DEVINSTALLDIR add -A git --git-dir=$BUILDER_HOME/artifactdir/.git --work-tree=$DEVINSTALLDIR commit -F $BUILDER_HOME/commitmsg git --git-dir=$BUILDER_HOME/artifactdir/.git tag $BINREPO_TAG || true -git --git-dir=$BUILDER_HOME/artifactdir/.git push origin $BINREPO_TAG:$BINREPO_TAG $BINREPO_BRANCH:$BINREPO_BRANCH +git --git-dir=$BUILDER_HOME/artifactdir/.git push origin $BINREPO_TAG:$BINREPO_TAG $BINREPO_BRANCH:$BINREPO_BRANCH || true echo done. echo echo commit a4c57aefd1ed8cfe4e46d6ffe808d49150bd8a00 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Jul 24 22:46:21 2013 +0200 introduce a minimum score limit before building, subst interval to poll-time diff --git a/tb3/tb3-local-client b/tb3/tb3-local-client index 9babafe..0b1b23b 100755 --- a/tb3/tb3-local-client +++ b/tb3/tb3-local-client @@ -61,12 +61,15 @@ class LocalClient: def report_result(self, proposal, result): self.tb3(set_commit_finished=proposal['commit'], result=result[0], result_reference=result[1]) def __one_run(self): - time.sleep(self.args['interval']) - proposal = self.get_proposal() - if proposal: - self.report_start(proposal) - result = self.run_build(proposal) - self.report_result(proposal, result) + proposal = None + while not proposal: + proposal = self.get_proposal() + print proposal + if not proposal or float(proposal['score']) < self.args['min_score']: + time.sleep(self.args['poll_idle_time']) + self.report_start(proposal) + result = self.run_build(proposal) + self.report_result(proposal, result) def execute(self): if self.args['count']: for x in range(self.args['count']): @@ -85,8 +88,9 @@ if __name__ == '__main__': parser.add_argument('--script', help='path to the build script', required=True) parser.add_argument('--logdir', help='path to the to store the logs', default=None) parser.add_argument('--estimated-duration', help='the estimated time to complete in minutes (default: 120)', type=float, default=120.0) - parser.add_argument('--interval', help='the time to sleep between builds/polls in seconds (default: 1)', type=float, default=1.0) parser.add_argument('--count', help='the number of builds to try, 0 for unlimited builds (default: unlimited)', type=int, default=0) + parser.add_argument('--poll-idle-time', help='the number seconds to wait before a retry when not getting a good proposal (default: 60)', type=float, default=60.0) + parser.add_argument('--min-score', help='the minimum score of a proposal to be tried (default: 0)', type=float, default=1.0) args = vars(parser.parse_args()) LocalClient(args).execute() commit 06f097bd4c2fb1ce85159bb156d4f87756f27cac Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Jul 24 22:12:40 2013 +0200 builder arg is only needed for set-commit-finished and set-commit-running diff --git a/tb3/tb3 b/tb3/tb3 index b05521b..52df868 100755 --- a/tb3/tb3 +++ b/tb3/tb3 @@ -107,7 +107,7 @@ if __name__ == '__main__': parser.add_argument('--repo', help='location of the LibreOffice core git repository', required=True) parser.add_argument('--platform', help='platform for which coordination is requested', required=True) parser.add_argument('--branch', help='branch for which coordination is requested', required=True) - parser.add_argument('--builder', help='name of the build machine interacting with the coordinator', required=True) + parser.add_argument('--builder', help='name of the build machine interacting with the coordinator (required for --set-commit-finished and --set-commit-running)') if fullcommand: parser.add_argument('--sync', help='syncs the repository from its origin', action='store_true') parser.add_argument('--set-commit-finished', help='set the result for this commit') @@ -128,6 +128,9 @@ if __name__ == '__main__': if fullcommand or commandname == 'tb3-show-proposals' or commandname == 'tb3-show-history': parser.add_argument('--format', help='set format for proposals and history (default: text)', choices=['text', 'json'], default='text') args = vars(parser.parse_args()) + if not args.has_key('builder') and (args.has_key('set_commit_running') or args.has_key('set_commit_finished')): + parser.print_help() + sys.exit(1) if not fullcommand: args['sync'] = commandname == 'tb3-sync' args['show_proposals'] = commandname == 'tb3-show-proposals' commit 3ba8d1ed6aa79680e2425674940b6d40334418a6 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Tue Jul 23 19:29:38 2013 +0200 actually better to wrap the proposal generation diff --git a/tb3/dist-packages/tb3/scheduler.py b/tb3/dist-packages/tb3/scheduler.py index c6847a8..474eecd 100644 --- a/tb3/dist-packages/tb3/scheduler.py +++ b/tb3/dist-packages/tb3/scheduler.py @@ -29,6 +29,8 @@ class Scheduler: self.repostate = tb3.repostate.RepoState(self.platform, self.branch, self.repo) self.repohistory = tb3.repostate.RepoHistory(self.platform, self.repo) self.git = sh.git.bake(_cwd=repo) + def make_proposal(self, score, commit): + return Proposal(score, commit, self.__class__.__name__, self.platform, self.branch) def count_commits(self, start, to): return int(self.git('rev-list', '%s..%s' % (start, to), count=True)) def get_commits(self, begin, end): @@ -63,10 +65,10 @@ class HeadScheduler(Scheduler): if not last_build is None: commits = self.get_commits(last_build, head) for commit in commits: - proposals.append(Proposal(1-1/((len(commits)-float(commit[0]))**2+1), commit[1], self.__class__.__name__, self.platform, self.branch)) + proposals.append(self.make_proposal(1-1/((len(commits)-float(commit[0]))**2+1), commit[1])) self.dampen_running_commits(commits, proposals, time) else: - proposals.append(Proposal(float(1), head, self.__class__.__name__, self.platform, self.branch)) + proposals.append(self.make_proposal(float(1), head)) self.norm_results(proposals) return proposals @@ -81,7 +83,7 @@ class BisectScheduler(Scheduler): commits = self.get_commits(last_good, '%s^' % first_bad) proposals = [] for commit in commits: - proposals.append(Proposal(1.0, commit[1], self.__class__.__name__, self.platform, self.branch)) + proposals.append(self.make_proposal(1.0, commit[1])) for idx in range(len(proposals)): proposals[idx].score *= (1-1/(float(idx)**2+1)) * (1-1/((float(idx-len(proposals)))**2+1)) self.dampen_running_commits(commits, proposals, time) commit 7a63055c8f9882b80e4770d6a061c5b2208c3789 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Tue Jul 23 19:19:51 2013 +0200 add platform and branch to each proposal in master diff --git a/tb3/dist-packages/tb3/scheduler.py b/tb3/dist-packages/tb3/scheduler.py index e3accab..c6847a8 100644 --- a/tb3/dist-packages/tb3/scheduler.py +++ b/tb3/dist-packages/tb3/scheduler.py @@ -14,10 +14,10 @@ import functools import datetime class Proposal: - def __init__(self, score, commit, scheduler): - (self.score, self.commit, self.scheduler) = (score, commit, scheduler) + def __init__(self, score, commit, scheduler, platform, branch): + (self.score, self.commit, self.scheduler, self.platform, self.branch) = (score, commit, scheduler, platform, branch) def __repr__(self): - return 'Proposal(%f, %s, %s)' % (self.score, self.commit, self.scheduler) + return 'Proposal(%f, %s, %s, %s, %s)' % (self.score, self.commit, self.scheduler, self.platform, self.branch) def __cmp__(self, other): return other.score - self.score @@ -63,10 +63,10 @@ class HeadScheduler(Scheduler): if not last_build is None: commits = self.get_commits(last_build, head) for commit in commits: - proposals.append(Proposal(1-1/((len(commits)-float(commit[0]))**2+1), commit[1], self.__class__.__name__)) + proposals.append(Proposal(1-1/((len(commits)-float(commit[0]))**2+1), commit[1], self.__class__.__name__, self.platform, self.branch)) self.dampen_running_commits(commits, proposals, time) else: - proposals.append(Proposal(float(1), head, self.__class__.__name__)) + proposals.append(Proposal(float(1), head, self.__class__.__name__, self.platform, self.branch)) self.norm_results(proposals) return proposals @@ -81,7 +81,7 @@ class BisectScheduler(Scheduler): commits = self.get_commits(last_good, '%s^' % first_bad) proposals = [] for commit in commits: - proposals.append(Proposal(1.0, commit[1], self.__class__.__name__)) + proposals.append(Proposal(1.0, commit[1], self.__class__.__name__, self.platform, self.branch)) for idx in range(len(proposals)): proposals[idx].score *= (1-1/(float(idx)**2+1)) * (1-1/((float(idx-len(proposals)))**2+1)) self.dampen_running_commits(commits, proposals, time) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits