mod batch

module batch

Group new software-layer roots into pull requests whose builds do not overlap.

A root’s new-module set is what pr-overlap computes for one easystack line: the root’s closure over the robot path, every pinned version kept, minus what the stack already installs. Two roots whose sets meet must ship together, or two pull requests would build the same module, which EESSI reviewers reject. A root whose set meets an open pull request’s set waits for that pull request, as conda-forge’s migrator waits for a predecessor that is not built yet.

The roots are the vertices of a conflict graph with an edge wherever two sets intersect; each connected component must be one pull request or part of one. Components are packed into batches of at most size roots by first-fit in decreasing size with ties broken by name, so the same inputs give the same batches. A component larger than size is one batch of its own. Batches have no build edges between them: a module two batches both needed would have put their roots in one component.

Functions

fn batch_slug(batch: &Batch) -> String

A short file-system name for a batch: its index and first root’s name.

fn plan(roots: &[RootSet], open: &[OpenSet], size: usize) -> BatchPlan

Plan batches of at most size roots. size 0 is read as 1.

Structs and Unions

struct Batch

One planned pull request.

index: usize

1-based position in the plan.

roots: Vec<String>

Root easyconfigs, sorted.

modules: Vec<String>

Every module the batch builds, sorted.

struct BatchPlan

The whole plan.

batches: Vec<Batch>

The pull requests to open, in order.

waits: Vec<Wait>

Roots that wait for open pull requests.

unresolved: BTreeMap<String, Vec<String>>

Roots with requirements nothing on the robot path provides.

deployed: Vec<String>

Roots the stack already installs.

struct OpenSet

An open pull request and what it would build.

number: u64

Pull request number.

to_build: BTreeSet<String>

Modules it would build.

struct RootSet

One candidate root and what it would build.

root: String

Easyconfig file name of the root.

to_build: BTreeSet<String>

Modules the root’s easystack line would build, the root’s own included.

unresolved: Vec<String>

Requirements no easyconfig on the robot path satisfies.

struct Wait

A root that waits for open pull requests.

root: String

Root easyconfig.

prs: Vec<u64>

Open pull requests that build part of the root’s set.

shared: Vec<String>

The modules shared with them.