|
| | __init__ (self, Path repo_root, str branch=DEFAULT_BRANCH, Path sync_dir=SYNC_DIR, str remote="origin", bool offline=False) |
| |
| | ensure (self) |
| |
| | refresh (self) |
| |
| dict | claims (self) |
| |
| bool | claim (self, str run_id, dict meta=None) |
| |
| str|None | next_unclaimed (self, list[str] run_ids) |
| |
| bool | publish (self, str run_id, dict summary, dict artifacts=None) |
| |
| bool | release (self, str run_id) |
| |
Git-backed claim board for one campaign branch.
Definition at line 112 of file gitsync.py.
◆ __init__()
| gitsync.CampaignSync.__init__ |
( |
|
self, |
|
|
Path |
repo_root, |
|
|
str |
branch = DEFAULT_BRANCH, |
|
|
Path |
sync_dir = SYNC_DIR, |
|
|
str |
remote = "origin", |
|
|
bool |
offline = False |
|
) |
| |
◆ _commit()
| gitsync.CampaignSync._commit |
( |
|
self, |
|
|
|
msg, |
|
|
|
paths |
|
) |
| |
|
protected |
◆ _create_worktree()
| gitsync.CampaignSync._create_worktree |
( |
|
self | ) |
|
|
protected |
◆ _head_sha()
| gitsync.CampaignSync._head_sha |
( |
|
self | ) |
|
|
protected |
◆ _lock()
| gitsync.CampaignSync._lock |
( |
|
self, |
|
|
|
timeout_s = 300 |
|
) |
| |
|
protected |
◆ _publish_locked()
| gitsync.CampaignSync._publish_locked |
( |
|
self, |
|
|
|
run_id, |
|
|
|
summary, |
|
|
|
artifacts |
|
) |
| |
|
protected |
◆ _push()
| bool gitsync.CampaignSync._push |
( |
|
self | ) |
|
|
protected |
◆ _release_locked()
| gitsync.CampaignSync._release_locked |
( |
|
self, |
|
|
|
run_id |
|
) |
| |
|
protected |
◆ _write_claim()
| gitsync.CampaignSync._write_claim |
( |
|
self, |
|
|
|
rec |
|
) |
| |
|
protected |
◆ claim()
| bool gitsync.CampaignSync.claim |
( |
|
self, |
|
|
str |
run_id, |
|
|
dict |
meta = None |
|
) |
| |
Try to take `run_id`. True if we own it, False if someone else does.
The remote decides. We write the claim, commit and push; if the push is
rejected we refresh and look again -- if the run is now claimed by
another machine we lose it cleanly, and if it is still free we retry.
Definition at line 238 of file gitsync.py.
◆ claims()
| dict gitsync.CampaignSync.claims |
( |
|
self | ) |
|
Every claim currently on the board, by run_id.
Definition at line 225 of file gitsync.py.
◆ ensure()
| gitsync.CampaignSync.ensure |
( |
|
self | ) |
|
Create the worktree and branch if absent; make it current.
Definition at line 154 of file gitsync.py.
◆ next_unclaimed()
| str | None gitsync.CampaignSync.next_unclaimed |
( |
|
self, |
|
|
list[str] |
run_ids |
|
) |
| |
◆ publish()
| bool gitsync.CampaignSync.publish |
( |
|
self, |
|
|
str |
run_id, |
|
|
dict |
summary, |
|
|
dict |
artifacts = None |
|
) |
| |
Record a finished run and push it. Called after EVERY run.
Definition at line 302 of file gitsync.py.
◆ refresh()
| gitsync.CampaignSync.refresh |
( |
|
self | ) |
|
Bring the worktree to the remote's state, discarding nothing of ours.
Our own commits are preserved by rebasing them on top; the worktree
holds only campaign bookkeeping, so there is never local work here that
did not come from this module.
Definition at line 207 of file gitsync.py.
◆ release()
| bool gitsync.CampaignSync.release |
( |
|
self, |
|
|
str |
run_id |
|
) |
| |
Drop a claim so another machine can take the run.
Definition at line 334 of file gitsync.py.
◆ branch
| gitsync.CampaignSync.branch |
◆ dir
◆ machine
| gitsync.CampaignSync.machine |
◆ offline
| gitsync.CampaignSync.offline |
◆ remote
| gitsync.CampaignSync.remote |
◆ repo
| gitsync.CampaignSync.repo |
The documentation for this class was generated from the following file:
- radcluster_code/digital_twin/verification/gitsync.py