Files
ilkerandClaude Opus 5 d67af5d6c3 hpcod: projects, and what a cluster cost
"How much did the protein run use" is a question about a piece of
work, not about c003-15. A tenant asks for clusters over months;
individually each one is an address, some hardware and a lease, and
nothing joined them up.

A project groups them, and is optional throughout. Somebody who wants
one cluster for an afternoon should not have to invent a project to
get it, and requiring one would mean every tenant carrying a
"default" that means nothing. The form does not even ask when there
are none: a field whose only option is "none" is a question with one
answer.

The cost side needed no new columns. The cluster record already said
when it was created and destroyed, and cluster_vm said how many cores
and how much memory it held; what was missing was anything that read
them. cluster_usage is that, and it is a view rather than a table
because a derived number stored is a number that can disagree with
what it was derived from. It works retroactively - every cluster this
estate has ever built now has a line.

Core-hours are reserved, not executed, and the view says so. That is
the honest unit for an on-demand cluster: the hardware was yours and
nobody else could have it, whether or not a job ran. What was
actually executed is a Slurm accounting question and there is no
slurmdbd.

The project is attached inside the allocating transaction, for the
same reason the placement and the applications are, and it is checked
there to be the tenant's own and still open - a cluster filed against
somebody else's project leaks what they are working on. Closing keeps
history and stops it being offered. There is no delete: the reference
from cluster is RESTRICT, because a project removed from under its
clusters leaves their cost attributed to nothing, and afterwards is
when the question gets asked.

A release now writes manifest.json beside home.tgz: the nodes, the
wall time, the core-hours. The database knows all of it and outlives
the cluster, but the tarball can be moved off this host and the
description travels with it. Not fatal if it fails - the data is
already safe by then, and holding hardware because a note could not
be written is the wrong trade.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 13:05:35 +02:00

182 lines
8.2 KiB
HTML

<!doctype html><html lang="en"><head><title>New cluster · HPC on Demand</title>{{template "head" .}}</head>
<body>{{template "nav" .}}
<main>
<h1>New cluster</h1>
<p class="deck">Describe what you need. The portal works out which site can supply it and shows you
where it would go, and why not elsewhere, before anything is built — planning reaches no cloud
and changes nothing.</p>
{{if .Err}}<div class="note crit"><p class="mono">{{.Err}}</p></div>{{end}}
<form method="POST" id="req">
<div class="card">
<div class="card-h"><span class="card-t">The cluster</span></div>
<div class="card-b">
<div class="fields">
<label class="f"><span>Name</span>
<input name="name" value="{{index .Form "name"}}" required
placeholder="genomics-week12" autocomplete="off"></label>
{{if .CanPickTenant}}
<label class="f"><span>Tenant</span>
<input name="tenant" value="{{index .Form "tenant"}}" autocomplete="off"
placeholder="yourself"><em>Leave empty to hold it yourself.</em></label>
{{end}}
{{if .Projects}}
<label class="f"><span>Project</span>
<select name="project">
<option value="">— none —</option>
{{range .Projects}}<option value="{{.ID}}">{{.Name}}</option>{{end}}
</select><em>Optional. Groups this cluster's cost with the rest of that work.</em></label>
{{end}}
<label class="f"><span>Lease</span>
<input name="lease" value="{{index .Form "lease"}}" placeholder="14d"
autocomplete="off"><em>Empty means no expiry.</em></label>
</div>
</div>
</div>
<div class="card">
<div class="card-h"><span class="card-t">Machines</span>
<span class="age">{{.MemNote}}</span></div>
<div class="card-b">
<div class="fields">
<label class="f"><span>Head cores</span>
<input name="head_cores" type="number" min="1" value="{{index .Form "head_cores"}}"></label>
<label class="f"><span>Head memory (GiB)</span>
<input name="head_memory" type="number" min="1" value="{{index .Form "head_memory"}}"></label>
<label class="f"><span>Head disk (GiB)</span>
<input name="head_disk" type="number" min="1" value="{{index .Form "head_disk"}}"></label>
<label class="f"><span>Compute nodes</span>
<input name="compute_count" type="number" min="1" value="{{index .Form "compute_count"}}"></label>
<label class="f"><span>Cores each</span>
<input name="compute_cores" type="number" min="1" value="{{index .Form "compute_cores"}}"></label>
<label class="f"><span>Memory each (GiB)</span>
<input name="compute_memory" type="number" min="1" value="{{index .Form "compute_memory"}}"></label>
</div>
</div>
</div>
<div class="card">
<div class="card-h"><span class="card-t">Hardware</span>
<span class="age">Per compute node. Leave at zero for what you do not need.</span></div>
<div class="card-b">
<table>
<thead><tr><th>Capability</th><th>How many</th><th>Required</th><th>Detail</th></tr></thead>
<tbody>
{{range .Caps}}
<tr>
<td><strong>{{.Label}}</strong><br><span class="age">{{.Help}}</span></td>
<td><input name="{{.Key}}_count" type="number" min="0" style="width:64px"
value="{{.Count}}" placeholder="0"></td>
<td>
<select name="{{.Key}}_how">
<option value="require" {{if not .Prefer}}selected{{end}}>required</option>
<option value="prefer" {{if .Prefer}}selected{{end}}>preferred</option>
</select>
</td>
<td>
{{if .AsksVendor}}<input name="{{.Key}}_vendor" value="{{.Vendor}}"
placeholder="any vendor" style="width:130px">{{end}}
{{if .AsksSpeed}}<input name="{{.Key}}_speed" type="number" min="0" value="{{.Speed}}"
placeholder="Gb/s" style="width:90px">{{end}}
{{if and (not .AsksVendor) (not .AsksSpeed)}}<span class="age">—</span>{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
<p class="age" style="margin:10px 0 0">A <strong>required</strong> capability the estate
cannot supply means the request is refused; a <strong>preferred</strong> one is used
where it exists and skipped where it does not.</p>
</div>
</div>
{{if .AppList}}
<div class="card">
<div class="card-h"><span class="card-t">Applications</span>
<span class="age">Naming software is how you avoid restating the hardware it needs.</span></div>
<div class="card-b">
{{range .AppList}}
<label class="check app">
<input type="checkbox" name="apps" value="{{.Ref}}" {{if .Checked}}checked{{end}}>
<span><code>{{.Ref}}</code>{{if .Deprecated}} <span class="age">(deprecated)</span>{{end}}{{if .Description}} — {{.Description}}{{end}}
{{if .Requires}}<br><span class="age">needs {{.Requires}}</span>{{end}}
{{if .Note}}<br><span class="age">{{.Note}}</span>{{end}}</span>
</label>
{{end}}
</div>
</div>
{{end}}
<button type="submit">Plan</button>
</form>
{{with .Decision}}
{{if .Feasible}}
<div class="card" style="margin-top:22px">
<div class="card-h">
<span class="pill ok">placed</span>
<span class="card-t">{{.Chosen.SiteID}}</span>
<span class="age">score {{printf "%.2f" .Chosen.Score}} · {{.Chosen.HostsUsed}} host(s)</span>
</div>
<div class="card-b">
<table>
<thead><tr><th>Role</th><th>Host</th><th>Cores</th><th>Memory</th><th>Devices</th></tr></thead>
<tbody>
{{range .Chosen.Placement}}
<tr>
<td><strong>{{.Role}}{{if eq .Role "compute"}}{{.Index}}{{end}}</strong></td>
<td>{{.HostNode}}</td>
<td class="num">{{.Cores}}</td>
<td class="num">{{.MemoryGB}} GiB</td>
<td>{{range .Devices}}<code>{{.NativeID}}</code> {{else}}<span class="age">—</span>{{end}}</td>
</tr>
{{end}}
</tbody>
</table>
<h2>Why this site</h2>
{{range .Chosen.Breakdown}}<p class="reason">{{.}}</p>{{end}}
</div>
</div>
{{else}}
<div class="note crit" style="margin-top:22px"><p><strong>Not placed.</strong> {{.Summary}}</p></div>
{{end}}
<h2>All candidates</h2>
<div class="card"><div class="card-b">
<table>
<thead><tr><th>Site</th><th>Verdict</th><th>Detail</th></tr></thead>
<tbody>
{{range .Candidates}}
<tr>
<td><strong>{{.SiteID}}</strong></td>
<td>{{if .Feasible}}<span class="pill ok">feasible</span>{{else}}<span class="pill crit">rejected</span>{{end}}</td>
<td>
{{if .Feasible}}<span class="age">score {{printf "%.2f" .Score}}</span>
{{else}}{{range .Reasons}}<p class="reason">{{.}}</p>{{end}}{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</div></div>
{{end}}
{{if .Decision}}{{if .Decision.Feasible}}
{{if .CanCreate}}
<form method="POST" style="margin-top:4px"
onsubmit="return confirm('Build this cluster? It reserves an address and any hardware named above, and creates the machines.')">
<input type="hidden" name="request" value="{{.Request}}">
<input type="hidden" name="project" value="{{index .Form "project"}}">
<input type="hidden" name="do" value="create">
<button type="submit">Build this cluster</button>
</form>
<p class="age" style="margin-top:8px">This reserves the address and the hardware,
records where it goes, and starts building. It takes a few minutes; the log opens
next and follows along.</p>
{{else}}
<p class="age" style="margin-top:14px">Sign in to create this cluster.</p>
{{end}}
{{end}}{{end}}
</main></body></html>