Gunnar

nordisk/gunnar

assets/gunnar-setup-3.svg

<svg xmlns="http://www.w3.org/2000/svg" width="836" height="400" viewBox="0 0 836 400" font-family="monospace" font-size="13">
  <!-- GENERATED by `cargo xtask svg` from xtask/src/setup_svg.rs. Do not hand-edit:
       every arrow starts on the box the verb is typed against, and moving a line
       instead of the model is how a diagram starts telling an operator to run
       `promote` on the wrong machine. -->
  <style>
    .box{rx:6;ry:6;stroke-width:1.5}
    .dim{fill:#9a948a}
    .hdr{fill:#e8e4da;font-size:15px;font-weight:bold}
    .kick{fill:#9a948a;font-size:11px}
    .name{fill:#e8e4da;font-size:14px;font-weight:bold}
    .verb{font-size:12px;font-weight:bold}
    .note{fill:#9a948a;font-size:11px}
    .flow{stroke:#6fd3f5;stroke-width:1.6;fill:none;marker-end:url(#flow)}
    .flip{stroke:#4fae76;stroke-width:1.6;fill:none;marker-end:url(#flip);stroke-dasharray:4 3}
  </style>
  <defs>
    <marker id="flow" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto"><path d="M0,0 L7,3 L0,6 Z" fill="#6fd3f5"/></marker>
    <marker id="flip" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto"><path d="M0,0 L7,3 L0,6 Z" fill="#4fae76"/></marker>
  </defs>
  <rect width="836" height="400" fill="#14110d"/>
  <text x="16" y="28" class="hdr">§3 · a twin, and the two flips</text>
  <text x="16" y="50" class="dim">configure, backfill, and — one day — flip: the green arrows change which box is writable</text>
  <g transform="translate(-176.99 -130)">
  <text x="300" y="206" class="kick">the main device</text>
  <rect class="box" x="300" y="214" width="280" height="120" fill="#123448" stroke="#4f9ec0"/>
  <text x="312" y="238" class="name">primary appliance</text>
  <text x="312" y="258" class="dim">writable — clients push here</text>
  <text x="312" y="275" class="dim">git-ssh :2222 · control :50051</text>
  <text x="312" y="292" class="dim">/data survives a reinstall</text>
  <text x="740" y="206" class="kick">the second speaker</text>
  <rect class="box" x="740" y="214" width="256" height="120" fill="#233a2b" stroke="#4fae76"/>
  <text x="752" y="238" class="name">twin (standby)</text>
  <text x="752" y="258" class="dim">a full gunnar, read-only</text>
  <text x="752" y="275" class="dim">takes the main's pushes</text>
  <text x="752" y="292" class="dim">can be promoted</text>
  <text x="740" y="398" class="kick">the rear speaker</text>
  <rect class="box" x="740" y="406" width="256" height="86" fill="#3a3323" stroke="#c0a24f"/>
  <text x="752" y="430" class="name">browse replica</text>
  <text x="752" y="450" class="dim">public repositories only</text>
  <text x="752" y="467" class="dim">never promoted</text>
  <path class="flow" d="M586,244 L734,244"/>
  <text x="660" y="237" text-anchor="middle" class="verb" fill="#6fd3f5">replication add</text>
  <text x="660" y="259" text-anchor="middle" class="note">&lt;name&gt; ssh://…:2222</text>
  <path class="flow" d="M586,292 L734,292"/>
  <text x="660" y="285" text-anchor="middle" class="verb" fill="#6fd3f5">resync</text>
  <text x="660" y="307" text-anchor="middle" class="note">backfill</text>
  <path class="flip" d="M734,330 L586,330"/>
  <text x="660" y="323" text-anchor="middle" class="verb" fill="#4fae76">promote</text>
  <text x="660" y="345" text-anchor="middle" class="note">on the twin</text>
  <path class="flow" d="M470,340 L470,449 L734,449"/>
  <text x="730" y="425" text-anchor="end" class="verb" fill="#6fd3f5">replication add --scope public-only</text>
  <text x="730" y="440" text-anchor="end" class="note">--control &lt;replica&gt;:50051</text>
  <path class="flip" d="M330,340 C330,390 390,390 390,340"/>
  <text x="316" y="382" text-anchor="end" class="verb" fill="#4fae76">abdicate / demote</text>
  <text x="316" y="397" text-anchor="end" class="note">on the old main</text>
  </g>
  <text x="16" y="386" class="dim">`promote` on the twin, `abdicate`/`demote` on the old main — never both on one box</text>
</svg>