OXYGENHUB
# df15b74774ca oxygenhub / templates / admin_runners.html
3.9 KiB · HTML · last changed Runners: registration, Admin -> Runners, history, drain/disable/remove 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% block title %}Runners · Administration{% endblock %}
3
{% block mainclass %} class="wide"{% endblock %}
4
{% block content %}
5
<div class="head"><h1>Runners <small>{{ runners.len()|plural("runner", "runners") }} · <a href="/admin">Administration</a></small></h1></div>
6
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
7
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
8
{% if let Some(t) = new_token %}
9
<section class="panel strip ok">
10
  <h2>Registration token</h2>
11
  <p>Use it once, within a day, on the machine that will run jobs. It is shown only now.</p>
12
  <pre class="snippet">flow runner register {{ hub }} --token {{ t }} --name NAME [--ca hub-ca.pem] [--label LABEL]
13
flow runner</pre>
14
  <p class="small mute">The runner sends its signing identity when it registers; this hub accepts receipts from it signed by that key only.</p>
15
</section>
16
{% endif %}
17
<section class="panel">
18
  {% if runners.is_empty() %}<p class="mute">No runners yet. Create a registration token below and run <code>flow runner register</code> on the runner.</p>{% else %}
19
  <div class="table"><table>
20
  <tr><th>Runner</th><th>Status</th><th>Signing key</th><th>Machine</th><th>Labels</th><th>Capacity</th><th>Running</th><th>Last seen</th><th></th></tr>
21
  {% for row in runners %}{% let r = row.r %}
22
  <tr>
23
    <td><a href="/admin/runners/{{ r.id }}"><strong>{{ r.name }}</strong></a>{% if r.source == "config" %} <span class="tag" title="Configured with a hub.toml token">hub.toml</span>{% endif %}</td>
24
    <td><span class="runner-status st-{{ r.status() }}">{{ r.status() }}</span></td>
25
    <td>{% if r.key.is_empty() %}<span class="mute" title="Bound on its first signed receipt">not yet</span>{% else %}<code title="{{ r.key }} · {{ r.key_name }}">{{ r.key|short }}</code>{% endif %}</td>
26
    <td class="small">{% if r.arch.is_empty() %}<span class="mute">unknown</span>{% else %}{{ r.arch }} · {{ r.os }} · flow {{ r.version }}{% endif %}</td>
27
    <td class="small">{% for l in r.label_list() %}<span class="lbl">{{ l }}</span> {% endfor %}</td>
28
    <td class="small">{{ r.max_jobs|plural("job", "jobs") }}{% if let Some(m) = r.memory_mib %} · {{ m }} MiB{% endif %}{% if let Some(c) = r.cpus %} · {{ c }} vCPU{% endif %}</td>
29
    <td>{{ row.running }}</td>
30
    <td class="small">{% if let Some(t) = r.last_seen_ms %}<time title="{{ t|when_i }}">{{ t|ago_i }}</time>{% else %}<span class="mute">never</span>{% endif %}</td>
31
    <td><form class="tiny" method="post" action="/admin/runners/{{ r.id }}/state"><input type="hidden" name="_csrf" value="{{ shell.csrf }}">
32
      {% if r.state == "active" %}<button name="state" value="draining" title="Finish current jobs, take no new ones">drain</button> <button name="state" value="disabled" title="Refuse its requests at once">disable</button>{% else %}<button name="state" value="active">resume</button>{% endif %}</form>
33
      <form class="tiny" method="post" action="/admin/runners/{{ r.id }}/remove" onsubmit="return confirm('Remove {{ r.name }}? Its credential stops working; its jobs keep its name.')"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button class="danger-btn">remove</button></form></td>
34
  </tr>
35
  {% endfor %}
36
  </table></div>
37
  {% endif %}
38
</section>
39
<section class="panel">
40
  <h2>Add a runner</h2>
41
  <p class="small">A runner registers with a one-time token: it sends its signing identity, architecture and labels, and gets its own credential, kept in <code>runner.toml</code> beside its <code>flow.toml</code>.</p>
42
  <form method="post" action="/admin/runners/token"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit" class="primary-btn">Create a registration token</button></form>
43
  {% if !pending.is_empty() %}<p class="small mute">Unused tokens: {% for (by, made, expires) in pending %}by {{ by }} {{ made|ago_i }}, expires {{ expires|when_i }}{% if !loop.last %}; {% endif %}{% endfor %}</p>{% endif %}
44
</section>
45
{% endblock %}