Compare commits

...
Author SHA1 Message Date
panxiao81 0571e64b1a ci: 使用 Pod 后端发布镜像
test / shell (pull_request) Successful in 1m7s
test / python (pull_request) Successful in 2m5s
test / go (pull_request) Successful in 5m32s
2026-09-24 07:44:46 +00:00
panxiao81 7921840604 Merge 在 runner 中暴露内置 SPIRE CLI
test / shell (push) Successful in 55s
test / python (push) Successful in 1m46s
test / go (push) Successful in 4m37s
2026-09-24 07:08:41 +00:00
panxiao81 45be4a9fd9 fix(runner): 暴露内置 SPIRE CLI
test / shell (pull_request) Successful in 40s
test / python (pull_request) Successful in 1m26s
test / go (pull_request) Successful in 4m46s
2026-09-24 07:08:08 +00:00
panxiao81 02ccd5b8d7 Merge 修复 runner 工作目录权限
test / go (push) Failing after 2s
test / python (push) Failing after 5s
test / shell (push) Failing after 5s
2026-09-24 06:25:47 +00:00
panxiao81 2edb7b2b82 fix(runner): 创建可写的工作目录
test / python (pull_request) Failing after 4s
test / go (pull_request) Failing after 4s
test / shell (pull_request) Failing after 4s
2026-09-24 06:25:23 +00:00
panxiao81 d472a906ac Merge job Docker daemon detach 修复
test / shell (push) Successful in 26s
test / python (push) Successful in 1m5s
test / go (push) Successful in 5m24s
2026-09-21 18:08:45 +00:00
panxiao81 0151b6faf6 fix(runner): fully detach job Docker daemon
test / shell (pull_request) Successful in 29s
test / python (pull_request) Successful in 59s
test / go (pull_request) Successful in 5m1s
2026-09-21 18:08:05 +00:00
panxiao81 713d9a922a Merge runner job hooks 配置加载修复
test / shell (push) Successful in 33s
test / python (push) Successful in 1m14s
test / go (push) Successful in 3m15s
publish controller image / publish-controller (push) Failing after 11m1s
2026-09-21 17:54:27 +00:00
panxiao81 537c620051 fix(runner): load job hooks configuration
test / python (pull_request) Successful in 51s
test / shell (pull_request) Successful in 40s
test / go (pull_request) Successful in 3m1s
2026-09-21 17:50:47 +00:00
panxiao81 a7b62868b6 Merge 镜像发布 SPIFFE 身份兼容修复
test / python (push) Successful in 1m11s
test / go (push) Successful in 3m20s
test / shell (push) Successful in 25s
publish controller image / publish-controller (push) Failing after 10m57s
2026-09-21 17:38:01 +00:00
panxiao81 84aa607c86 fix(ci): preserve published image job identity
test / python (pull_request) Successful in 1m27s
test / shell (pull_request) Successful in 34s
test / go (pull_request) Successful in 2m59s
2026-09-21 17:36:53 +00:00
panxiao81 57524be30f Merge controller 与 runner 镜像发布拆分
test / go (push) Successful in 2m55s
test / shell (push) Successful in 30s
test / python (push) Successful in 57s
publish controller image / publish-controller (push) Failing after 14m2s
2026-09-21 17:19:44 +00:00
7 changed files with 33 additions and 24 deletions
+2 -2
View File
@@ -15,9 +15,9 @@ on:
workflow_dispatch:
jobs:
publish-controller:
publish-images:
name: publish-controller
runs-on: [self-hosted, vm]
runs-on: [self-hosted, pod]
timeout-minutes: 45
permissions:
contents: read
+2 -2
View File
@@ -5,9 +5,9 @@ on:
workflow_dispatch:
jobs:
publish-runner:
publish-images:
name: publish-runner
runs-on: [self-hosted, vm]
runs-on: [self-hosted, pod]
timeout-minutes: 45
permissions:
contents: read
+5 -14
View File
@@ -5,29 +5,20 @@ on:
jobs:
jwt-svid:
runs-on: self-hosted
container:
volumes:
- /run/spire/agent-sockets:/run/spire/agent-sockets:ro
runs-on: [self-hosted, pod]
steps:
- name: Fetch pinned SPIRE CLI
- name: Verify bundled SPIRE CLI
shell: bash
run: |
set -euo pipefail
archive=/tmp/spire.tar.gz
curl --fail --location --silent --show-error \
--output "$archive" \
https://github.com/spiffe/spire/releases/download/v1.15.3/spire-1.15.3-linux-amd64-musl.tar.gz
printf '%s %s\n' \
ca1a4d1155317bdd2afc7f36663828a10410c7c840e54725b90b4064b0a301c7 \
"$archive" | sha256sum --check --status
tar -xzf "$archive" -C /tmp spire-1.15.3/bin/spire-agent
command -v spire-agent
spire-agent -version
- name: Fetch short-lived zot JWT-SVID
shell: bash
run: |
set -euo pipefail
/tmp/spire-1.15.3/bin/spire-agent api fetch jwt \
spire-agent api fetch jwt \
-audience zot \
-socketPath /run/spire/agent-sockets/spire-agent.sock \
>/dev/null
+2 -1
View File
@@ -21,11 +21,12 @@ RUN groupadd --gid 2000 runner \
&& useradd --uid 2000 --gid 2000 --groups docker --create-home --shell /bin/bash runner \
&& printf 'runner ALL=(ALL) NOPASSWD:ALL\n' >/etc/sudoers.d/runner \
&& chmod 0440 /etc/sudoers.d/runner \
&& install -d -o 2000 -g 2000 /data
&& install -d -o 2000 -g 2000 /data /workspace
COPY --from=runner /usr/local/bin/gitea-runner /usr/local/bin/gitea-runner
COPY --from=controller /out/gitea-dynamic-runner /usr/local/bin/gitea-dynamic-runner
COPY --from=spire /opt/spire/bin/spire-agent /opt/spire/bin/spire-agent
RUN ln -s /opt/spire/bin/spire-agent /usr/local/bin/spire-agent
COPY config/runner.yaml /etc/gitea-runner/config.yaml
COPY --chmod=0755 scripts/gitea-job-started /usr/local/libexec/gitea-job-started
COPY --chmod=0755 scripts/gitea-opensandbox-runner /usr/local/libexec/gitea-opensandbox-runner
+12 -3
View File
@@ -22,6 +22,7 @@ type ExecutorConfig struct {
FacadeSPIFFEID string
WorkloadAPIAddr string
RunnerBinary string
RunnerConfig string
ListenAddress string
WorkDir string
Stdout *os.File
@@ -35,6 +36,9 @@ func RunExecutor(ctx context.Context, config ExecutorConfig) error {
if config.RunnerBinary == "" {
config.RunnerBinary = "gitea-runner"
}
if config.RunnerConfig == "" {
config.RunnerConfig = "/etc/gitea-runner/config.yaml"
}
if config.ListenAddress == "" {
config.ListenAddress = "127.0.0.1:0"
}
@@ -93,7 +97,7 @@ func RunExecutor(ctx context.Context, config ExecutorConfig) error {
return errors.Join(readyErr, shutdownErr, serverErr)
}
command := exec.CommandContext(ctx, config.RunnerBinary, "daemon", "--once")
command := exec.CommandContext(ctx, config.RunnerBinary, runnerArguments(config.RunnerConfig)...)
command.Dir = workDir
command.Stdout = config.Stdout
command.Stderr = config.Stderr
@@ -108,6 +112,10 @@ func RunExecutor(ctx context.Context, config ExecutorConfig) error {
return errors.Join(runnerErr, shutdownErr, serverErr)
}
func runnerArguments(configFile string) []string {
return []string{"daemon", "--config", configFile, "--once"}
}
func waitForFacade(ctx context.Context, endpoint string) error {
client := &http.Client{Timeout: 2 * time.Second}
ticker := time.NewTicker(250 * time.Millisecond)
@@ -143,8 +151,9 @@ func ExecutorConfigFromEnvironment() (ExecutorConfig, error) {
config := ExecutorConfig{
AssignmentID: os.Getenv(EnvAssignmentID), Capability: os.Getenv(EnvCapability),
Backend: backend, FacadeURL: os.Getenv(EnvFacadeURL), FacadeSPIFFEID: os.Getenv(EnvFacadeID),
RunnerBinary: os.Getenv("GITEA_RUNNER_BINARY"), ListenAddress: "127.0.0.1:0",
Stdout: os.Stdout, Stderr: os.Stderr,
RunnerBinary: os.Getenv("GITEA_RUNNER_BINARY"), RunnerConfig: os.Getenv("GITEA_RUNNER_CONFIG_FILE"),
ListenAddress: "127.0.0.1:0",
Stdout: os.Stdout, Stderr: os.Stderr,
}
if config.AssignmentID == "" || config.Capability == "" || config.FacadeURL == "" || config.FacadeSPIFFEID == "" {
return ExecutorConfig{}, errors.New("complete runner assignment and facade environment is required")
@@ -4,11 +4,19 @@ import (
"context"
"net/http"
"net/http/httptest"
"reflect"
"sync/atomic"
"testing"
"time"
)
func TestRunnerArgumentsLoadJobHooksConfig(t *testing.T) {
want := []string{"daemon", "--config", "/etc/gitea-runner/config.yaml", "--once"}
if got := runnerArguments("/etc/gitea-runner/config.yaml"); !reflect.DeepEqual(got, want) {
t.Fatalf("runner arguments = %q, want %q", got, want)
}
}
func TestWaitForFacadeRetriesTransientGatewayFailure(t *testing.T) {
var requests atomic.Int32
server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, _ *http.Request) {
+2 -2
View File
@@ -42,9 +42,9 @@ if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then
'
fi
sudo sh -c 'exec nohup dockerd "$@" >/tmp/dockerd.log 2>&1' sh \
sudo sh -c 'nohup dockerd "$@" </dev/null >/tmp/dockerd.log 2>&1 &' sh \
--host=unix:///var/run/docker.sock \
--storage-driver="$storage_driver" &
--storage-driver="$storage_driver"
printf '%s\n' 'waiting for job Docker daemon'
for ((attempt = 0; attempt < wait_seconds; attempt++)); do
if docker info >/dev/null 2>&1; then