feat(github-runners): add ephemeral self-hosted runners on build servers (#12054)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-09-30 12:13:11 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 03a056709d
commit fd85b740f5
40 changed files with 3605 additions and 20 deletions
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Stores the GitHub Actions runner permissions, webhook events, and runner group of a GitHub App.
*/
public function up(): void
{
Schema::table('github_apps', function (Blueprint $table) {
$table->string('organization_self_hosted_runners')->nullable()->after('administration');
$table->string('actions')->nullable()->after('organization_self_hosted_runners');
$table->json('webhook_events')->nullable()->after('actions');
$table->unsignedBigInteger('runner_group_id')->nullable()->after('webhook_events');
});
}
public function down(): void
{
Schema::table('github_apps', function (Blueprint $table) {
$table->dropColumn(['organization_self_hosted_runners', 'actions', 'webhook_events', 'runner_group_id']);
});
}
};
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* One GitHub Actions runner configuration per build server.
*/
public function up(): void
{
Schema::create('github_runner_configs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->foreignId('server_id')->unique()->constrained()->cascadeOnDelete();
$table->foreignId('github_app_id')->constrained()->cascadeOnDelete();
$table->json('labels');
$table->boolean('is_enabled')->default(true);
$table->boolean('is_dedicated')->default(false);
$table->unsignedSmallInteger('max_runners')->default(2);
$table->string('docker_mode')->default('none');
$table->string('runner_image')->nullable();
$table->string('cpu_limit')->nullable();
$table->string('memory_limit')->nullable();
$table->unsignedInteger('capacity_wait_timeout')->default(60);
$table->unsignedInteger('idle_timeout')->default(10);
$table->unsignedInteger('job_timeout')->default(360);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('github_runner_configs');
}
};
@@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* One row per ephemeral runner. The unique trigger job id stops duplicate webhook
* deliveries from starting a second runner.
*/
public function up(): void
{
Schema::create('github_runner_executions', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->foreignId('github_app_id')->constrained()->cascadeOnDelete();
$table->foreignId('github_runner_config_id')->nullable()->constrained()->nullOnDelete();
$table->foreignId('server_id')->nullable()->constrained()->nullOnDelete();
$table->string('status')->default('queued');
$table->unsignedBigInteger('trigger_workflow_job_id');
$table->unsignedBigInteger('workflow_job_id')->nullable();
$table->string('workflow_job_html_url')->nullable();
$table->string('workflow_name')->nullable();
$table->string('job_name')->nullable();
$table->string('repository_full_name')->nullable();
$table->json('labels')->nullable();
$table->string('runner_name')->nullable();
$table->unsignedBigInteger('runner_id')->nullable();
$table->string('conclusion')->nullable();
$table->text('error_message')->nullable();
$table->unsignedSmallInteger('provision_attempts')->default(0);
$table->timestamp('queued_at')->nullable();
$table->timestamp('ready_at')->nullable();
$table->timestamp('started_at')->nullable();
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->unique(['github_app_id', 'trigger_workflow_job_id']);
$table->index(['github_app_id', 'runner_name']);
$table->index(['github_app_id', 'status']);
$table->index(['github_runner_config_id', 'status']);
});
}
public function down(): void
{
Schema::dropIfExists('github_runner_executions');
}
};