Files
ubicloud/views/github/runner.erb
Enes Cakir 39e93c87b5 Add a runner force terminate button to the UI
We destroy the runner when GitHub sends the workflow job completed
webhook event.

Recently, the runner script has gotten stuck a few times due to zombie
processes.

This might be related to GitHub incidents, but we don't have enough
information to confirm it.

https://github.com/actions/runner/issues/3737

Since GitHub servers think the script is still running, they don't stop
it.

Customers can force terminate the runner by clicking the button. This
destroys the underlying virtual machine, causing GitHub servers to lose
connection to the runner and mark the job as failed.
2025-03-19 16:36:47 +03:00

70 lines
2.9 KiB
Plaintext

<% @page_title = "Active Runners" %>
<div class="auto-refresh hidden" data-interval="10"></div>
<%== render("github/tabbar") %>
<div class="grid gap-6">
<%== part(
"components/table_card",
headers: ["Runner", "Repository", "Label", "State", "Branch", "Workflow Job", ""],
rows:
@runners.map do |runner|
destroy_url = "#{@project_data[:path]}/github/runner/#{runner[:ubid]}"
[
[
[runner[:ubid], { link: runner[:runner_url] }],
runner[:repository_name],
runner[:label],
["vm_state_label", { component: { state: runner[:state] } }],
runner.dig(:workflow_job, :head_branch),
if (workflow_job = runner[:workflow_job])
[<<~CONTENT, {escape: false}]
<a href="#{workflow_job[:run_url]}" class="text-orange-600 hover:text-orange-700" target="_blank">#{workflow_job[:workflow_name]}</a>
-
<a href="#{workflow_job[:job_url]}" class="text-orange-600 hover:text-orange-700" target="_blank">#{workflow_job[:job_name]}</a>
CONTENT
else
"Runner doesn't have a job yet"
end,
[
"button",
{
component: {
text: nil,
icon: "hero-x-circle",
extra_class: "delete-btn",
type: "danger",
attributes: {
"title" => "Terminate",
"data-url" => destroy_url,
"data-csrf" => csrf_token(destroy_url, "DELETE"),
"data-confirmation-message" => "Are you sure to terminate this runner?\nThis will cancel its current job and permanently delete all its data.",
"data-redirect" => request.path,
"data-method" => "DELETE"
}
},
extra_class: "text-right"
}
]
],
{ id: "runner-#{runner[:id]}" }
]
end,
empty_state: <<~EMPTY
<h3 class="text-xl leading-10 font-medium mb-2">No active runners</h3>
<p class="leading-6">
To use Ubicloud runners, you need to change
<span class="text-rose-500 text-sm font-medium bg-slate-100 py-0.5 px-2 rounded font-mono whitespace-nowrap">runs-on: ...</span>
line to one of our labels such as
<span class="text-rose-500 text-sm font-medium bg-slate-100 py-0.5 px-2 rounded font-mono whitespace-nowrap">runs-on: ubicloud-standard-2</span>
in your workflow file. Then, trigger your workflow to start a runner.
<br>
Check out
<a href="https://www.ubicloud.com/docs/github-actions-integration/quickstart" class="text-orange-500 font-medium">our documentation</a>
for using larger runners, using arm64, enabling GPU.
</p>
EMPTY
) %>
</div>