"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>
127 lines
7.4 KiB
HTML
127 lines
7.4 KiB
HTML
{{define "head"}}
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap">
|
||
<style>
|
||
:root{
|
||
--ground:#F6F7F9;--surface:#FFFFFF;--surface-2:#EFF2F6;
|
||
--ink:#16202B;--muted:#5C6B7A;--rule:#DCE2E9;
|
||
--accent:#B4622A;--accent-soft:#F4E7DC;
|
||
--ok:#2E7D5B;--ok-bg:#E4F1EA;--warn:#8F6316;--warn-bg:#F7EEDC;
|
||
--crit:#A33B32;--crit-bg:#F7E5E3;--code-bg:#F0F3F7;
|
||
--sans:"IBM Plex Sans",ui-sans-serif,system-ui,sans-serif;
|
||
--mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
|
||
}
|
||
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
|
||
--ground:#0F151C;--surface:#161E27;--surface-2:#1C262F;
|
||
--ink:#E3E9EF;--muted:#8A99A8;--rule:#26313D;
|
||
--accent:#D9884E;--accent-soft:#2A1E15;
|
||
--ok:#5FBF90;--ok-bg:#15271F;--warn:#D6A54B;--warn-bg:#2A2214;
|
||
--crit:#E0796E;--crit-bg:#2C1917;--code-bg:#111A22;
|
||
}}
|
||
*{box-sizing:border-box}
|
||
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
|
||
font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
|
||
header{background:var(--surface);border-bottom:1px solid var(--rule);padding:12px 22px;
|
||
display:flex;align-items:center;gap:20px;flex-wrap:wrap}
|
||
.brand{font-weight:700;font-size:15px;letter-spacing:-.01em}
|
||
.brand span{display:block;font-family:var(--mono);font-size:10px;text-transform:uppercase;
|
||
letter-spacing:.11em;color:var(--muted);font-weight:400}
|
||
nav{display:flex;gap:3px}
|
||
nav a{padding:5px 11px;border-radius:4px;text-decoration:none;color:var(--muted);font-size:13.5px}
|
||
nav a:hover{background:var(--surface-2);color:var(--ink)}
|
||
nav a.on{background:var(--accent-soft);color:var(--accent);font-weight:600}
|
||
.spacer{flex:1}
|
||
.age{font-family:var(--mono);font-size:11px;color:var(--muted)}
|
||
.logout{font-size:12.5px;color:var(--muted);text-decoration:none}
|
||
.logout:hover{color:var(--ink)}
|
||
main{max-width:1120px;margin:0 auto;padding:26px 22px 80px}
|
||
h1{font-size:22px;font-weight:600;letter-spacing:-.02em;margin:0 0 4px}
|
||
.deck{color:var(--muted);margin:0 0 22px;max-width:70ch}
|
||
h2{font-size:16px;font-weight:600;margin:28px 0 10px}
|
||
.card{background:var(--surface);border:1px solid var(--rule);border-radius:5px;margin-bottom:16px}
|
||
.card-h{padding:11px 16px;border-bottom:1px solid var(--rule);display:flex;align-items:center;gap:11px}
|
||
.card-t{font-weight:600}
|
||
.card-b{padding:14px 16px}
|
||
table{border-collapse:collapse;width:100%;font-size:13px}
|
||
th,td{text-align:left;padding:7px 12px;border-bottom:1px solid var(--rule);vertical-align:top}
|
||
th{font-family:var(--mono);font-size:10px;text-transform:uppercase;letter-spacing:.08em;
|
||
color:var(--muted);font-weight:500;background:var(--surface-2)}
|
||
tbody tr:last-child td{border-bottom:0}
|
||
.num{font-variant-numeric:tabular-nums}
|
||
code,.mono{font-family:var(--mono);font-size:12px}
|
||
.pill{font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.07em;
|
||
padding:2px 6px;border-radius:2px;border:1px solid currentColor;white-space:nowrap}
|
||
.pill.ok{color:var(--ok);background:var(--ok-bg)}
|
||
.pill.warn{color:var(--warn);background:var(--warn-bg)}
|
||
.pill.crit{color:var(--crit);background:var(--crit-bg)}
|
||
.pill.muted{color:var(--muted)}
|
||
.note{border-left:2px solid var(--accent);background:var(--accent-soft);padding:10px 14px;
|
||
border-radius:0 4px 4px 0;margin:0 0 16px;font-size:13px}
|
||
.note.crit{border-left-color:var(--crit);background:var(--crit-bg)}
|
||
.note p{margin:0}
|
||
textarea{width:100%;min-height:280px;font-family:var(--mono);font-size:12.5px;line-height:1.55;
|
||
background:var(--code-bg);color:var(--ink);border:1px solid var(--rule);border-radius:4px;
|
||
padding:12px;resize:vertical;tab-size:2}
|
||
button{background:var(--accent);color:#fff;border:1px solid var(--accent);border-radius:4px;
|
||
padding:8px 16px;font:inherit;font-weight:600;cursor:pointer;margin-top:11px}
|
||
button:hover{filter:brightness(1.08)}
|
||
pre{font-family:var(--mono);font-size:12px;background:var(--code-bg);border:1px solid var(--rule);
|
||
padding:11px 13px;border-radius:4px;overflow-x:auto;margin:0}
|
||
.reason{font-size:12.5px;color:var(--muted);margin:3px 0 0 0;padding-left:14px;position:relative}
|
||
.reason:before{content:"–";position:absolute;left:0}
|
||
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:0 0 18px}
|
||
.stat{background:var(--surface);border:1px solid var(--rule);border-radius:5px;padding:14px 16px}
|
||
.stat .k{font-family:var(--mono);font-size:26px;font-weight:600;letter-spacing:-.02em;
|
||
font-variant-numeric:tabular-nums;line-height:1.1}
|
||
.stat .l{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-top:3px}
|
||
form.inline{display:inline-flex;align-items:center;gap:4px;margin:0 6px 4px 0}
|
||
form.inline input[type=number]{width:52px;font-family:var(--mono);font-size:12px;padding:4px 6px;
|
||
border:1px solid var(--rule);border-radius:4px;background:var(--surface);color:var(--ink)}
|
||
button.small{margin-top:0;padding:4px 10px;font-size:12px;font-weight:500}
|
||
button.danger{background:transparent;color:var(--crit);border-color:var(--crit)}
|
||
button.danger:hover{background:var(--crit-bg);filter:none}
|
||
label.check{display:inline-flex;align-items:center;gap:6px;margin-right:16px;font-size:13px}
|
||
label.ratio{display:inline-flex;align-items:center;gap:4px;margin-right:12px;font-size:13px}
|
||
label.ratio input{width:72px;font-family:var(--mono);font-size:12px;padding:4px 6px;
|
||
border:1px solid var(--rule);border-radius:4px;background:var(--surface);color:var(--ink)}
|
||
a.portal{font-size:12px;color:var(--accent);text-decoration:none;font-weight:500}
|
||
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px}
|
||
label.f{display:flex;flex-direction:column;gap:4px;font-size:13px}
|
||
label.f>span{font-family:var(--mono);font-size:10px;text-transform:uppercase;
|
||
letter-spacing:.08em;color:var(--muted)}
|
||
label.f em{font-style:normal;font-size:11.5px;color:var(--muted)}
|
||
input[type=text],input[type=number],input:not([type]),select{font:inherit;font-size:13px;
|
||
padding:6px 8px;border:1px solid var(--rule);border-radius:4px;
|
||
background:var(--surface);color:var(--ink);width:100%}
|
||
select{font-size:12.5px;padding:5px 6px;width:auto}
|
||
td input[type=number],td input:not([type]){width:auto}
|
||
label.check.app{display:flex;align-items:flex-start;gap:8px;margin:0 0 9px;
|
||
font-size:13px;line-height:1.45}
|
||
label.check.app input{margin-top:3px}
|
||
a.portal:hover{text-decoration:underline}
|
||
:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
|
||
</style>
|
||
{{end}}
|
||
|
||
{{define "nav"}}
|
||
<header>
|
||
<div class="brand">HPC on Demand<span>control plane</span></div>
|
||
<nav>
|
||
<a href="/" class="{{if eq .Page "overview"}}on{{end}}">Overview</a>
|
||
<a href="/clusters" class="{{if eq .Page "clusters"}}on{{end}}">Clusters</a>
|
||
<a href="/clusters/new" class="{{if eq .Page "new"}}on{{end}}">New cluster</a>
|
||
<a href="/projects" class="{{if eq .Page "projects"}}on{{end}}">Projects</a>
|
||
<a href="/usage" class="{{if eq .Page "usage"}}on{{end}}">Usage</a>
|
||
<a href="/sites" class="{{if eq .Page "sites"}}on{{end}}">Sites</a>
|
||
<a href="/capmap" class="{{if eq .Page "capmap"}}on{{end}}">Device map</a>
|
||
{{if .IsAdmin}}<a href="/admin/accounts" class="{{if eq .Page "accounts"}}on{{end}}">Accounts</a>{{end}}
|
||
</nav>
|
||
<div class="spacer"></div>
|
||
<span class="age">inventory {{.Age}}</span>
|
||
<a class="logout" href="/logout">Sign out</a>
|
||
</header>
|
||
{{end}}
|