feat: support env reuse and git mirror in v0.1 cicd

This commit is contained in:
Codex
2026-06-02 00:52:19 +08:00
parent f34312c424
commit df38f605fa
11 changed files with 365 additions and 79 deletions
+7 -1
View File
@@ -2,6 +2,8 @@ import { stableHash } from "../common/validation.js";
import type { BackendProfile, ExecutionPolicy, JsonRecord, JsonValue, RunRecord, SecretRef } from "../common/types.js";
import { backendProfileSpec } from "../common/backend-profiles.js";
const defaultBootRepoUrl = "http://git-mirror-http.devops-infra.svc.cluster.local/pikasTech/agentrun.git";
export interface RunnerJobRenderOptions {
run: RunRecord;
commandId: string;
@@ -124,7 +126,7 @@ export function renderRunnerJobManifest(options: RunnerJobRenderOptions): { mani
name: "runner",
image: options.image,
imagePullPolicy: options.imagePullPolicy ?? "IfNotPresent",
command: ["bun", "src/runner/main.ts"],
command: ["/opt/agentrun/deploy/runtime/boot/agentrun-runner.sh"],
env,
volumeMounts: [
{ name: "runner-home", mountPath: "/home/agentrun" },
@@ -164,6 +166,10 @@ function runnerEnv(options: RunnerJobRenderOptions, context: { namespace: string
{ name: "AGENTRUN_RESOURCE_BUNDLE_JSON", value: JSON.stringify(options.run.resourceBundleRef ?? null) },
{ name: "AGENTRUN_WORKSPACE_ROOT", value: "/home/agentrun/workspaces" },
{ name: "AGENTRUN_SOURCE_COMMIT", value: context.sourceCommit },
{ name: "AGENTRUN_BOOT_COMMIT", value: context.sourceCommit },
{ name: "AGENTRUN_BOOT_REPO_URL", value: defaultBootRepoUrl },
{ name: "AGENTRUN_BOOT_MODE", value: "runner" },
{ name: "AGENTRUN_APP_ROOT", value: "/home/agentrun/agentrun-source" },
{ name: "AGENTRUN_RUNTIME_NAMESPACE", value: context.namespace },
{ name: "AGENTRUN_K8S_JOB_NAME", value: context.jobName },
{ name: "AGENTRUN_LOG_PATH", value: "/tmp/agentrun-runner.jsonl" },