From 20185dc8b572c7408c1e6f9444d373aed43cdc32 Mon Sep 17 00:00:00 2001 From: Bruce Becker Date: Sat, 13 Jan 2024 10:44:27 +0100 Subject: [PATCH] feat(post): add new post for deep dive on terraform github runners Signed-off-by: Bruce Becker --- .../github-runners-cloudflare-diagram.html | 69 +++ _includes/footer.html | 9 - _includes/mermaid.html | 10 + _posts/2023-11-29-github-runners-on-demand.md | 2 +- _posts/2024-01-10-terraform-all-the-things.md | 563 ++++++++++++++++++ 5 files changed, 643 insertions(+), 10 deletions(-) create mode 100644 _includes/diagrams/github-runners-cloudflare-diagram.html create mode 100644 _posts/2024-01-10-terraform-all-the-things.md diff --git a/_includes/diagrams/github-runners-cloudflare-diagram.html b/_includes/diagrams/github-runners-cloudflare-diagram.html new file mode 100644 index 0000000..5948a72 --- /dev/null +++ b/_includes/diagrams/github-runners-cloudflare-diagram.html @@ -0,0 +1,69 @@ +
+---
+title: Github Runners on Demand Workflow, showing Github Actions, Repo triggers, Cloudflare and Nomad (in Hashi@Home)
+flowchartConfig:
+  width: 100%
+config:
+  theme: base
+  themeVariables:
+    background: "#d8dee9"
+    fontFamily: "Roboto Mono"
+    primaryColor: "#88c0d0"
+    secondaryColor: "#81a1c1"
+    tertiaryColor: "#ebcb8b"
+    primaryTextColor: "#2e3440"
+    secondaryTextColor: "#3b4252"
+    primaryBorderColor: "#7C0000"
+    lineColor: "#F8B229"
+    fontSize: "20px"
+---
+flowchart TB
+  commit(Commit)
+  repo(Git Repo)
+  webhook(Repo Webhook)
+  action_workflow(Github Action workflow)
+  action_job(Github Action job)
+  runner(Github Self-Hosted runner)
+  listener(Webhook receiver)
+  worker([Cloudflare Worker])
+  tunnel(Cloudflare tunnel)
+  cf_app(Cloudflare Application)
+  nomad_job(Nomad Parametrized job)
+  nomad(Nomad Dispatch API)
+
+  %% triggers %%
+  subgraph Triggers["fa:fa-github Triggers"]
+    direction LR
+    commit-- Push update to -->repo
+    commit-- Trigger -->action_workflow
+  end
+
+  %% webhook flow %%
+  subgraph Webhooks
+    direction TB
+    repo-- Emit -->webhook
+    subgraph Cloudflare["fab:fa-cloudflare"]
+      direction LR
+      webhook-- POST -->listener
+      listener-- Route -->cf_app
+      zta-- Protect -->cf_app
+      cf_app-- Invoke -->worker
+      worker-- POST -->tunnel
+    end
+
+    subgraph Nomad
+      direction LR
+      tunnel-- Expose -->nomad
+      nomad-- Schedule -->nomad_job
+      nomad_job-- Instantiates -->runner
+    end
+  end
+
+  %% actions flow %%
+  subgraph Actions["fa:fa-github Actions"]
+    action_workflow-- Schedules -->action_job
+    action_job-- Requests -->runner
+    runner-- Executes -->action_job
+    action_job-- Notifies Status -->commit
+  end
+
diff --git a/_includes/footer.html b/_includes/footer.html index 508a165..332f2b8 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -11,12 +11,3 @@ - diff --git a/_includes/mermaid.html b/_includes/mermaid.html index 8bae4e8..89df10b 100644 --- a/_includes/mermaid.html +++ b/_includes/mermaid.html @@ -1,9 +1,19 @@ +{% comment %} +{% endcomment %}