From 81f3d3ef3fbb2b4f9ac3da65e3bc413033f8b990 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 25 Apr 2026 15:47:25 -0700 Subject: [PATCH] Rename act_runner to runner --- .dockerignore | 2 +- .gitea/workflows/release-nightly.yml | 4 +-- .gitignore | 2 +- .golangci.yml | 2 +- .goreleaser.yaml | 4 +-- Dockerfile | 10 ++++---- Makefile | 10 ++++---- README.md | 22 ++++++++-------- act/artifactcache/handler.go | 2 +- act/artifacts/server.go | 2 +- act/artifacts/server_test.go | 4 +-- act/common/executor.go | 2 +- act/common/git/git.go | 2 +- act/container/container_types.go | 2 +- act/container/docker_auth.go | 2 +- act/container/docker_build.go | 3 ++- act/container/docker_network.go | 2 +- act/container/docker_pull.go | 2 +- act/container/docker_run.go | 4 +-- act/container/docker_run_test.go | 2 +- act/container/docker_stub.go | 2 +- act/container/docker_volume.go | 2 +- act/container/host_environment.go | 6 ++--- act/container/parse_env_file.go | 2 +- act/exprparser/functions.go | 2 +- act/exprparser/functions_test.go | 2 +- act/exprparser/interpreter.go | 2 +- act/exprparser/interpreter_test.go | 2 +- act/model/github_context.go | 4 +-- act/model/workflow.go | 2 +- act/runner/action.go | 6 ++--- act/runner/action_composite.go | 4 +-- act/runner/action_test.go | 2 +- act/runner/command.go | 2 +- act/runner/command_test.go | 4 +-- act/runner/container_mock_test.go | 4 +-- act/runner/expression.go | 8 +++--- act/runner/expression_test.go | 4 +-- act/runner/job_executor.go | 6 ++--- act/runner/job_executor_test.go | 6 ++--- act/runner/local_repository_cache.go | 2 +- act/runner/logger.go | 2 +- act/runner/max_parallel_test.go | 2 +- act/runner/reusable_workflow.go | 6 ++--- act/runner/run_context.go | 10 ++++---- act/runner/run_context_test.go | 4 +-- act/runner/runner.go | 4 +-- act/runner/runner_test.go | 4 +-- act/runner/step.go | 8 +++--- act/runner/step_action_local.go | 4 +-- act/runner/step_action_local_test.go | 4 +-- act/runner/step_action_remote.go | 6 ++--- act/runner/step_action_remote_test.go | 6 ++--- act/runner/step_docker.go | 6 ++--- act/runner/step_docker_test.go | 4 +-- act/runner/step_factory.go | 2 +- act/runner/step_factory_test.go | 2 +- act/runner/step_run.go | 8 +++--- act/runner/step_run_test.go | 4 +-- act/runner/step_test.go | 4 +-- examples/README.md | 2 +- examples/docker-compose/README.md | 14 +++++------ examples/docker/README.md | 4 +-- examples/kubernetes/README.md | 2 +- examples/kubernetes/dind-docker.yaml | 4 +-- examples/kubernetes/rootless-docker.yaml | 4 +-- examples/vm/README.md | 2 +- examples/vm/rootless-docker.md | 32 ++++++++++++------------ go.mod | 2 +- internal/app/cmd/cache-server.go | 4 +-- internal/app/cmd/cmd.go | 18 ++++++------- internal/app/cmd/daemon.go | 18 ++++++------- internal/app/cmd/exec.go | 10 ++++---- internal/app/cmd/register.go | 8 +++--- internal/app/poll/poller.go | 6 ++--- internal/app/poll/poller_test.go | 4 +-- internal/app/run/runner.go | 20 +++++++-------- internal/app/run/workflow.go | 2 +- internal/app/run/workflow_test.go | 2 +- internal/pkg/config/config.example.yaml | 16 ++++++------ internal/pkg/config/config.go | 6 ++--- internal/pkg/metrics/metrics.go | 4 +-- internal/pkg/report/reporter.go | 6 ++--- internal/pkg/report/reporter_test.go | 6 ++--- internal/pkg/ver/version.go | 2 +- main.go | 2 +- scripts/run.sh | 10 ++++---- 87 files changed, 230 insertions(+), 229 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7646fe3f..f5deacb2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -40,7 +40,7 @@ cpu.out *.db *.log -/act_runner +/runner /debug /bin diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml index 9f1dcdc8..08a88b1b 100644 --- a/.gitea/workflows/release-nightly.yml +++ b/.gitea/workflows/release-nightly.yml @@ -69,7 +69,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Echo the tag - run: echo "${{ env.DOCKER_ORG }}/act_runner:nightly${{ matrix.variant.tag_suffix }}" + run: echo "${{ env.DOCKER_ORG }}/runner:nightly${{ matrix.variant.tag_suffix }}" - name: Build and push uses: docker/build-push-action@v6 @@ -82,4 +82,4 @@ jobs: linux/arm64 push: true tags: | - ${{ env.DOCKER_ORG }}/act_runner:nightly${{ matrix.variant.tag_suffix }} + ${{ env.DOCKER_ORG }}/runner:nightly${{ matrix.variant.tag_suffix }} diff --git a/.gitignore b/.gitignore index 1a543fda..027fac09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/act_runner +/runner .env .runner coverage.txt diff --git a/.golangci.yml b/.golangci.yml index cff28eb2..42e2d5e0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -114,7 +114,7 @@ formatters: custom-order: true sections: - standard - - prefix(gitea.com/gitea/act_runner) + - prefix(gitea.com/gitea/runner) - blank - default gofumpt: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 4d06f658..f4e929ff 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -63,7 +63,7 @@ builds: flags: - -trimpath ldflags: - - -s -w -X gitea.com/gitea/act_runner/internal/pkg/ver.version={{ .Summary }} + - -s -w -X gitea.com/gitea/runner/internal/pkg/ver.version={{ .Summary }} binary: >- {{ .ProjectName }}- {{- .Version }}- @@ -86,7 +86,7 @@ blobs: provider: s3 bucket: "{{ .Env.S3_BUCKET }}" region: "{{ .Env.S3_REGION }}" - directory: "act_runner/{{.Version}}" + directory: "runner/{{.Version}}" extra_files: - glob: ./**.xz - glob: ./**.sha256 diff --git a/Dockerfile b/Dockerfile index c616a333..44667c32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN apk add --no-cache make git ARG GOPROXY ENV GOPROXY=${GOPROXY:-} -COPY . /opt/src/act_runner -WORKDIR /opt/src/act_runner +COPY . /opt/src/runner +WORKDIR /opt/src/runner RUN make clean && make build @@ -21,7 +21,7 @@ FROM docker:28-dind AS dind RUN apk add --no-cache s6 bash git tzdata -COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner +COPY --from=builder /opt/src/runner/runner /usr/local/bin/runner COPY scripts/run.sh /usr/local/bin/run.sh COPY scripts/s6 /etc/s6 @@ -37,7 +37,7 @@ FROM docker:28-dind-rootless AS dind-rootless USER root RUN apk add --no-cache s6 bash git tzdata -COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner +COPY --from=builder /opt/src/runner/runner /usr/local/bin/runner COPY scripts/run.sh /usr/local/bin/run.sh COPY scripts/s6 /etc/s6 @@ -56,7 +56,7 @@ ENTRYPOINT ["s6-svscan","/etc/s6"] FROM alpine AS basic RUN apk add --no-cache tini bash git tzdata -COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner +COPY --from=builder /opt/src/runner/runner /usr/local/bin/runner COPY scripts/run.sh /usr/local/bin/run.sh VOLUME /data diff --git a/Makefile b/Makefile index c0e5b284..43f074b8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ DIST := dist -EXECUTABLE := act_runner +EXECUTABLE := runner DIST_DIRS := $(DIST)/binaries $(DIST)/release GO ?= go SHASUM ?= shasum -a 256 @@ -13,7 +13,7 @@ DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64 WINDOWS_ARCHS ?= windows/amd64 GOFILES := $(shell find . -type f -name "*.go" -o -name "go.mod" ! -name "generated.*") -DOCKER_IMAGE ?= gitea/act_runner +DOCKER_IMAGE ?= gitea/runner DOCKER_TAG ?= nightly DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG) DOCKER_ROOTLESS_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)-dind-rootless @@ -67,7 +67,7 @@ else endif TAGS ?= -LDFLAGS ?= -X "gitea.com/gitea/act_runner/internal/pkg/ver.version=v$(RELASE_VERSION)" +LDFLAGS ?= -X "gitea.com/gitea/runner/internal/pkg/ver.version=v$(RELASE_VERSION)" .PHONY: all all: build @@ -140,11 +140,11 @@ test: fmt-check security-check ## test everything @$(GO) test -race -short -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1 .PHONY: install -install: $(GOFILES) ## install the act_runner binary via `go install` +install: $(GOFILES) ## install the runner binary via `go install` $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' .PHONY: build -build: go-check $(EXECUTABLE) ## build the act_runner binary +build: go-check $(EXECUTABLE) ## build the runner binary $(EXECUTABLE): $(GOFILES) $(GO) build -v -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@ diff --git a/README.md b/README.md index 61e30cdf..f504cf2b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker Engine Community version is required for docker mode. To install Docker C ### Download pre-built binary -Visit [here](https://dl.gitea.com/act_runner/) and download the right version for your platform. +Visit [here](https://dl.gitea.com/runner/) and download the right version for your platform. ### Build from source @@ -26,8 +26,8 @@ make docker ## Quickstart -Actions are disabled by default, so you need to add the following to the configuration file of your Gitea instance to enable it: - +Actions are disabled by default, so you need to add the following to the configuration file of your Gitea instance to enable it: + ```ini [actions] ENABLED=true @@ -36,7 +36,7 @@ ENABLED=true ### Register ```bash -./act_runner register +./runner register ``` And you will be asked to input: @@ -68,7 +68,7 @@ INFO Runner registered successfully. You can also register with command line arguments. ```bash -./act_runner register --instance http://192.168.8.8:3000 --token --no-interactive +./runner register --instance http://192.168.8.8:3000 --token --no-interactive ``` If the registry succeed, it will run immediately. Next time, you could run the runner directly. @@ -76,29 +76,29 @@ If the registry succeed, it will run immediately. Next time, you could run the r ### Run ```bash -./act_runner daemon +./runner daemon ``` ### Run with docker ```bash -docker run -e GITEA_INSTANCE_URL=https://your_gitea.com -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock --name my_runner gitea/act_runner:nightly +docker run -e GITEA_INSTANCE_URL=https://your_gitea.com -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock --name my_runner gitea/runner:nightly ``` ### Configuration You can also configure the runner with a configuration file. -The configuration file is a YAML file, you can generate a sample configuration file with `./act_runner generate-config`. +The configuration file is a YAML file, you can generate a sample configuration file with `./runner generate-config`. ```bash -./act_runner generate-config > config.yaml +./runner generate-config > config.yaml ``` You can specify the configuration file path with `-c`/`--config` argument. ```bash -./act_runner -c config.yaml register # register with config file -./act_runner -c config.yaml daemon # run with config file +./runner -c config.yaml register # register with config file +./runner -c config.yaml daemon # run with config file ``` You can read the latest version of the configuration file online at [config.example.yaml](internal/pkg/config/config.example.yaml). diff --git a/act/artifactcache/handler.go b/act/artifactcache/handler.go index 7f090799..54a1977d 100644 --- a/act/artifactcache/handler.go +++ b/act/artifactcache/handler.go @@ -19,7 +19,7 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/julienschmidt/httprouter" "github.com/sirupsen/logrus" diff --git a/act/artifacts/server.go b/act/artifacts/server.go index 3c722d6e..fb4e8b6b 100644 --- a/act/artifacts/server.go +++ b/act/artifacts/server.go @@ -17,7 +17,7 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/julienschmidt/httprouter" ) diff --git a/act/artifacts/server_test.go b/act/artifacts/server_test.go index b240308c..0fadd656 100644 --- a/act/artifacts/server_test.go +++ b/act/artifacts/server_test.go @@ -17,8 +17,8 @@ import ( "testing" "testing/fstest" - "gitea.com/gitea/act_runner/act/model" - "gitea.com/gitea/act_runner/act/runner" + "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/act/runner" "github.com/julienschmidt/httprouter" log "github.com/sirupsen/logrus" diff --git a/act/common/executor.go b/act/common/executor.go index 60008a35..08de6faa 100644 --- a/act/common/executor.go +++ b/act/common/executor.go @@ -117,7 +117,7 @@ func NewParallelExecutor(parallel int, executors ...Executor) Executor { log.Debugf("Worker %d executing task %d", workerID, taskCount) // Recover from panics in executors to avoid crashing the worker // goroutine which would leave the runner process hung. - // https://gitea.com/gitea/act_runner/issues/371 + // https://gitea.com/gitea/runner/issues/371 errs <- func() (err error) { defer func() { if r := recover(); r != nil { diff --git a/act/common/git/git.go b/act/common/git/git.go index f3ecd992..815c3a72 100644 --- a/act/common/git/git.go +++ b/act/common/git/git.go @@ -15,7 +15,7 @@ import ( "strings" "sync" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/config" diff --git a/act/container/container_types.go b/act/container/container_types.go index 03713b43..a1b2f01c 100644 --- a/act/container/container_types.go +++ b/act/container/container_types.go @@ -8,7 +8,7 @@ import ( "context" "io" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/go-connections/nat" ) diff --git a/act/container/docker_auth.go b/act/container/docker_auth.go index 3df7edb4..cf046e71 100644 --- a/act/container/docker_auth.go +++ b/act/container/docker_auth.go @@ -10,7 +10,7 @@ import ( "context" "strings" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/credentials" diff --git a/act/container/docker_build.go b/act/container/docker_build.go index f2e99b45..387df08f 100644 --- a/act/container/docker_build.go +++ b/act/container/docker_build.go @@ -12,10 +12,11 @@ import ( "os" "path/filepath" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/archive" + // github.com/docker/docker/builder/dockerignore is deprecated "github.com/moby/buildkit/frontend/dockerfile/dockerignore" "github.com/moby/patternmatcher" diff --git a/act/container/docker_network.go b/act/container/docker_network.go index 1137895c..accd34db 100644 --- a/act/container/docker_network.go +++ b/act/container/docker_network.go @@ -9,7 +9,7 @@ package container import ( "context" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/docker/api/types" ) diff --git a/act/container/docker_pull.go b/act/container/docker_pull.go index 6262e33b..71515be1 100644 --- a/act/container/docker_pull.go +++ b/act/container/docker_pull.go @@ -13,7 +13,7 @@ import ( "fmt" "strings" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/distribution/reference" "github.com/docker/docker/api/types" diff --git a/act/container/docker_run.go b/act/container/docker_run.go index 0b22ccd7..bb9d8fb6 100644 --- a/act/container/docker_run.go +++ b/act/container/docker_run.go @@ -20,8 +20,8 @@ import ( "strconv" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/filecollector" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/filecollector" "github.com/Masterminds/semver" "github.com/docker/cli/cli/compose/loader" diff --git a/act/container/docker_run_test.go b/act/container/docker_run_test.go index aed61a03..beae70ca 100644 --- a/act/container/docker_run_test.go +++ b/act/container/docker_run_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" diff --git a/act/container/docker_stub.go b/act/container/docker_stub.go index 84f32bde..74fd4a2a 100644 --- a/act/container/docker_stub.go +++ b/act/container/docker_stub.go @@ -10,7 +10,7 @@ import ( "context" "runtime" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/docker/api/types" "github.com/pkg/errors" diff --git a/act/container/docker_volume.go b/act/container/docker_volume.go index 22ba493b..475fe7e2 100644 --- a/act/container/docker_volume.go +++ b/act/container/docker_volume.go @@ -9,7 +9,7 @@ package container import ( "context" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/volume" diff --git a/act/container/host_environment.go b/act/container/host_environment.go index 8e8e026c..538bafeb 100644 --- a/act/container/host_environment.go +++ b/act/container/host_environment.go @@ -19,9 +19,9 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/filecollector" - "gitea.com/gitea/act_runner/act/lookpath" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/filecollector" + "gitea.com/gitea/runner/act/lookpath" "github.com/go-git/go-billy/v5/helper/polyfill" "github.com/go-git/go-billy/v5/osfs" diff --git a/act/container/parse_env_file.go b/act/container/parse_env_file.go index b0509601..ec27807f 100644 --- a/act/container/parse_env_file.go +++ b/act/container/parse_env_file.go @@ -12,7 +12,7 @@ import ( "io" "strings" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" ) func parseEnvFile(e Container, srcPath string, env *map[string]string) common.Executor { diff --git a/act/exprparser/functions.go b/act/exprparser/functions.go index 7f318781..4243abe2 100644 --- a/act/exprparser/functions.go +++ b/act/exprparser/functions.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/go-git/go-git/v5/plumbing/format/gitignore" "github.com/rhysd/actionlint" diff --git a/act/exprparser/functions_test.go b/act/exprparser/functions_test.go index c281f73f..cd57f555 100644 --- a/act/exprparser/functions_test.go +++ b/act/exprparser/functions_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/exprparser/interpreter.go b/act/exprparser/interpreter.go index 8a97ccff..5f1e6b3b 100644 --- a/act/exprparser/interpreter.go +++ b/act/exprparser/interpreter.go @@ -12,7 +12,7 @@ import ( "reflect" "strings" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/rhysd/actionlint" ) diff --git a/act/exprparser/interpreter_test.go b/act/exprparser/interpreter_test.go index d930321f..2b18d58c 100644 --- a/act/exprparser/interpreter_test.go +++ b/act/exprparser/interpreter_test.go @@ -8,7 +8,7 @@ import ( "math" "testing" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/model/github_context.go b/act/model/github_context.go index 86e9dd78..c70fb240 100644 --- a/act/model/github_context.go +++ b/act/model/github_context.go @@ -9,8 +9,8 @@ import ( "fmt" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/common/git" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" ) type GithubContext struct { diff --git a/act/model/workflow.go b/act/model/workflow.go index 7334049c..73fae8a5 100644 --- a/act/model/workflow.go +++ b/act/model/workflow.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" log "github.com/sirupsen/logrus" "go.yaml.in/yaml/v4" diff --git a/act/runner/action.go b/act/runner/action.go index 1e41a134..fa88bef7 100644 --- a/act/runner/action.go +++ b/act/runner/action.go @@ -18,9 +18,9 @@ import ( "runtime" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/model" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/action_composite.go b/act/runner/action_composite.go index ebfa676a..15d7b67c 100644 --- a/act/runner/action_composite.go +++ b/act/runner/action_composite.go @@ -11,8 +11,8 @@ import ( "strconv" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" ) func evaluateCompositeInputAndEnv(ctx context.Context, parent *RunContext, step actionStep) map[string]string { diff --git a/act/runner/action_test.go b/act/runner/action_test.go index d2a416df..bd5ad545 100644 --- a/act/runner/action_test.go +++ b/act/runner/action_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/command.go b/act/runner/command.go index 5338e34e..7552109b 100644 --- a/act/runner/command.go +++ b/act/runner/command.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" ) var commandPatternGA *regexp.Regexp diff --git a/act/runner/command_test.go b/act/runner/command_test.go index 52542913..89105efb 100644 --- a/act/runner/command_test.go +++ b/act/runner/command_test.go @@ -11,8 +11,8 @@ import ( "os" "testing" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" diff --git a/act/runner/container_mock_test.go b/act/runner/container_mock_test.go index cf95a3b4..ccb00764 100644 --- a/act/runner/container_mock_test.go +++ b/act/runner/container_mock_test.go @@ -8,8 +8,8 @@ import ( "context" "io" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" "github.com/stretchr/testify/mock" ) diff --git a/act/runner/expression.go b/act/runner/expression.go index a5e4e7d9..05ac13d4 100644 --- a/act/runner/expression.go +++ b/act/runner/expression.go @@ -15,10 +15,10 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/exprparser" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" _ "embed" diff --git a/act/runner/expression_test.go b/act/runner/expression_test.go index 76e779fe..59fc704b 100644 --- a/act/runner/expression_test.go +++ b/act/runner/expression_test.go @@ -8,8 +8,8 @@ import ( "context" "testing" - "gitea.com/gitea/act_runner/act/exprparser" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" assert "github.com/stretchr/testify/assert" yaml "go.yaml.in/yaml/v4" diff --git a/act/runner/job_executor.go b/act/runner/job_executor.go index 0487f2e8..b5fc84d1 100644 --- a/act/runner/job_executor.go +++ b/act/runner/job_executor.go @@ -10,8 +10,8 @@ import ( "strconv" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" ) type jobInfo interface { @@ -137,7 +137,7 @@ func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executo // if !rc.IsHostEnv(ctx) && rc.Config.ContainerNetworkMode == "" { // // clean network in docker mode only // // if the value of `ContainerNetworkMode` is empty string, - // // it means that the network to which containers are connecting is created by `act_runner`, + // // it means that the network to which containers are connecting is created by `runner`, // // so, we should remove the network at last. // networkName, _ := rc.networkName() // logger.Infof("Cleaning up network for job %s, and network name is: %s", rc.JobName, networkName) diff --git a/act/runner/job_executor_test.go b/act/runner/job_executor_test.go index ca2e5406..69af7570 100644 --- a/act/runner/job_executor_test.go +++ b/act/runner/job_executor_test.go @@ -12,9 +12,9 @@ import ( "slices" "testing" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/local_repository_cache.go b/act/runner/local_repository_cache.go index 1482aa99..d8e1ebad 100644 --- a/act/runner/local_repository_cache.go +++ b/act/runner/local_repository_cache.go @@ -16,7 +16,7 @@ import ( "path/filepath" "strings" - "gitea.com/gitea/act_runner/act/filecollector" + "gitea.com/gitea/runner/act/filecollector" ) type LocalRepositoryCache struct { diff --git a/act/runner/logger.go b/act/runner/logger.go index 2140ee85..fe5061e5 100644 --- a/act/runner/logger.go +++ b/act/runner/logger.go @@ -13,7 +13,7 @@ import ( "strings" "sync" - "gitea.com/gitea/act_runner/act/common" + "gitea.com/gitea/runner/act/common" "github.com/sirupsen/logrus" "golang.org/x/term" diff --git a/act/runner/max_parallel_test.go b/act/runner/max_parallel_test.go index c560cb2c..c1e97c01 100644 --- a/act/runner/max_parallel_test.go +++ b/act/runner/max_parallel_test.go @@ -6,7 +6,7 @@ package runner import ( "testing" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "go.yaml.in/yaml/v4" diff --git a/act/runner/reusable_workflow.go b/act/runner/reusable_workflow.go index 17ba8b83..84a633ac 100644 --- a/act/runner/reusable_workflow.go +++ b/act/runner/reusable_workflow.go @@ -17,9 +17,9 @@ import ( "strings" "sync" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/common/git" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/act/model" ) func newLocalReusableWorkflowExecutor(rc *RunContext) common.Executor { diff --git a/act/runner/run_context.go b/act/runner/run_context.go index 19ad88ef..84839614 100644 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -23,10 +23,10 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/exprparser" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" "github.com/docker/go-connections/nat" "github.com/opencontainers/selinux/go-selinux" @@ -383,7 +383,7 @@ func (rc *RunContext) startJobContainer() common.Executor { if createAndDeleteNetwork { // clean network if it has been created by act // if using service containers - // it means that the network to which containers are connecting is created by `act_runner`, + // it means that the network to which containers are connecting is created by `runner`, // so, we should remove the network at last. logger.Infof("Cleaning up network for job %s, and network name is: %s", rc.JobName, networkName) if err := container.NewDockerNetworkRemoveExecutor(networkName)(ctx); err != nil { diff --git a/act/runner/run_context_test.go b/act/runner/run_context_test.go index a1e86597..6f122fe7 100644 --- a/act/runner/run_context_test.go +++ b/act/runner/run_context_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "gitea.com/gitea/act_runner/act/exprparser" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" log "github.com/sirupsen/logrus" assert "github.com/stretchr/testify/assert" diff --git a/act/runner/runner.go b/act/runner/runner.go index 6389f53a..b2da796b 100644 --- a/act/runner/runner.go +++ b/act/runner/runner.go @@ -13,8 +13,8 @@ import ( "sync" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" docker_container "github.com/docker/docker/api/types/container" log "github.com/sirupsen/logrus" diff --git a/act/runner/runner_test.go b/act/runner/runner_test.go index 6eabca86..b241f23a 100644 --- a/act/runner/runner_test.go +++ b/act/runner/runner_test.go @@ -16,8 +16,8 @@ import ( "strings" "testing" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" "github.com/joho/godotenv" log "github.com/sirupsen/logrus" diff --git a/act/runner/step.go b/act/runner/step.go index b599fffc..d4ee50ac 100644 --- a/act/runner/step.go +++ b/act/runner/step.go @@ -13,10 +13,10 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/exprparser" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" ) type step interface { diff --git a/act/runner/step_action_local.go b/act/runner/step_action_local.go index bcd255f4..79a7173d 100644 --- a/act/runner/step_action_local.go +++ b/act/runner/step_action_local.go @@ -15,8 +15,8 @@ import ( "path" "path/filepath" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" ) type stepActionLocal struct { diff --git a/act/runner/step_action_local_test.go b/act/runner/step_action_local_test.go index abf0ce20..ea997f0e 100644 --- a/act/runner/step_action_local_test.go +++ b/act/runner/step_action_local_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_action_remote.go b/act/runner/step_action_remote.go index 30025ec9..3df97136 100644 --- a/act/runner/step_action_remote.go +++ b/act/runner/step_action_remote.go @@ -16,9 +16,9 @@ import ( "regexp" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/common/git" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/act/model" gogit "github.com/go-git/go-git/v5" ) diff --git a/act/runner/step_action_remote_test.go b/act/runner/step_action_remote_test.go index 52e97a78..0dda59e5 100644 --- a/act/runner/step_action_remote_test.go +++ b/act/runner/step_action_remote_test.go @@ -14,9 +14,9 @@ import ( "testing" "time" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/common/git" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_docker.go b/act/runner/step_docker.go index 2f18fff0..c7c71eae 100644 --- a/act/runner/step_docker.go +++ b/act/runner/step_docker.go @@ -9,9 +9,9 @@ import ( "fmt" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/model" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/step_docker_test.go b/act/runner/step_docker_test.go index e1bf8998..1ab5b4b6 100644 --- a/act/runner/step_docker_test.go +++ b/act/runner/step_docker_test.go @@ -10,8 +10,8 @@ import ( "io" "testing" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_factory.go b/act/runner/step_factory.go index 6964630a..af77ca56 100644 --- a/act/runner/step_factory.go +++ b/act/runner/step_factory.go @@ -7,7 +7,7 @@ package runner import ( "fmt" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" ) type stepFactory interface { diff --git a/act/runner/step_factory_test.go b/act/runner/step_factory_test.go index d770de64..dbe02d36 100644 --- a/act/runner/step_factory_test.go +++ b/act/runner/step_factory_test.go @@ -7,7 +7,7 @@ package runner import ( "testing" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/runner/step_run.go b/act/runner/step_run.go index 076f1759..4fb70dfe 100644 --- a/act/runner/step_run.go +++ b/act/runner/step_run.go @@ -11,10 +11,10 @@ import ( "runtime" "strings" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/lookpath" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/lookpath" + "gitea.com/gitea/runner/act/model" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/step_run_test.go b/act/runner/step_run_test.go index 75ef9ae3..2f5412a7 100644 --- a/act/runner/step_run_test.go +++ b/act/runner/step_run_test.go @@ -10,8 +10,8 @@ import ( "io" "testing" - "gitea.com/gitea/act_runner/act/container" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_test.go b/act/runner/step_test.go index 7f4d93a4..3efd052c 100644 --- a/act/runner/step_test.go +++ b/act/runner/step_test.go @@ -8,8 +8,8 @@ import ( "context" "testing" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/examples/README.md b/examples/README.md index d5a5b7ec..5ab3fa14 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,4 +1,4 @@ -# Usage Examples for `act_runner` +# Usage Examples for `runner` Welcome to our collection of usage and deployment examples specifically designed for Gitea setups. Whether you're a beginner or an experienced user, you'll find practical resources here that you can directly apply to enhance your Gitea experience. We encourage you to contribute your own insights and knowledge to make this collection even more comprehensive and valuable. diff --git a/examples/docker-compose/README.md b/examples/docker-compose/README.md index 76ffd0fb..f6b7048a 100644 --- a/examples/docker-compose/README.md +++ b/examples/docker-compose/README.md @@ -1,4 +1,4 @@ -### Running `act_runner` using `docker-compose` +### Running `runner` using `docker-compose` ```yml ... @@ -19,15 +19,15 @@ # - GITEA_RUNNER_REGISTRATION_TOKEN= runner: - image: gitea/act_runner + image: gitea/runner restart: always depends_on: gitea: # required so runner can attach to gitea, see "healthcheck" - condition: service_healthy + condition: service_healthy restart: true volumes: - - ./data/act_runner:/data + - ./data/runner:/data - /var/run/docker.sock:/var/run/docker.sock environment: - GITEA_INSTANCE_URL= @@ -38,18 +38,18 @@ - GITEA_RUNNER_REGISTRATION_TOKEN= ``` -### Running `act_runner` using Docker-in-Docker (DIND) +### Running `runner` using Docker-in-Docker (DIND) ```yml ... runner: - image: gitea/act_runner:latest-dind-rootless + image: gitea/runner:latest-dind-rootless restart: always privileged: true depends_on: - gitea volumes: - - ./data/act_runner:/data + - ./data/runner:/data environment: - GITEA_INSTANCE_URL= - DOCKER_HOST=unix:///var/run/user/1000/docker.sock diff --git a/examples/docker/README.md b/examples/docker/README.md index dde2d633..738410b3 100644 --- a/examples/docker/README.md +++ b/examples/docker/README.md @@ -1,7 +1,7 @@ -### Run `act_runner` in a Docker Container +### Run `runner` in a Docker Container ```sh -docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/data --name my_runner gitea/act_runner:nightly +docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/data --name my_runner gitea/runner:nightly ``` The `/data` directory inside the docker container contains the runner API keys after registration. diff --git a/examples/kubernetes/README.md b/examples/kubernetes/README.md index 5427893f..45658cc2 100644 --- a/examples/kubernetes/README.md +++ b/examples/kubernetes/README.md @@ -1,4 +1,4 @@ -## Kubernetes Docker in Docker Deployment with `act_runner` +## Kubernetes Docker in Docker Deployment with `runner` NOTE: Docker in Docker (dind) requires elevated privileges on Kubernetes. The current way to achieve this is to set the pod `SecurityContext` to `privileged`. Keep in mind that this is a potential security issue that has the potential for a malicious application to break out of the container context. diff --git a/examples/kubernetes/dind-docker.yaml b/examples/kubernetes/dind-docker.yaml index e423ceec..2ae54bcf 100644 --- a/examples/kubernetes/dind-docker.yaml +++ b/examples/kubernetes/dind-docker.yaml @@ -13,7 +13,7 @@ spec: apiVersion: v1 data: # The registration token can be obtained from the web UI, API or command-line. - # You can also set a pre-defined global runner registration token for the Gitea instance via + # You can also set a pre-defined global runner registration token for the Gitea instance via # `GITEA_RUNNER_REGISTRATION_TOKEN`/`GITEA_RUNNER_REGISTRATION_TOKEN_FILE` environment variable. token: << base64 encoded registration token >> kind: Secret @@ -48,7 +48,7 @@ spec: claimName: act-runner-vol containers: - name: runner - image: gitea/act_runner:nightly + image: gitea/runner:nightly command: ["sh", "-c", "while ! nc -z localhost 2376 > kind: Secret @@ -48,7 +48,7 @@ spec: fsGroup: 1000 containers: - name: runner - image: gitea/act_runner:nightly-dind-rootless + image: gitea/runner:nightly-dind-rootless imagePullPolicy: Always # command: ["sh", "-c", "while ! nc -z localhost 2376 /home/rootless/act_runner/config + runner generate-config >/home/rootless/runner/config ``` -- Create a new user-level`systemd` unit file as `/home/rootless/.config/systemd/user/act_runner.service` with the following contents: +- Create a new user-level`systemd` unit file as `/home/rootless/.config/systemd/user/runner.service` with the following contents: ```bash Description=Gitea Actions runner - Documentation=https://gitea.com/gitea/act_runner + Documentation=https://gitea.com/gitea/runner After=docker.service [Service] Environment=PATH=/home/rootless/bin:/sbin:/usr/sbin:/home/rootless/bin:/home/rootless/bin:/home/rootless/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games Environment=DOCKER_HOST=unix:///run/user/1001/docker.sock - ExecStart=/usr/bin/act_runner daemon -c /home/rootless/act_runner/config + ExecStart=/usr/bin/runner daemon -c /home/rootless/runner/config ExecReload=/bin/kill -s HUP $MAINPID - WorkingDirectory=/home/rootless/act_runner + WorkingDirectory=/home/rootless/runner TimeoutSec=0 RestartSec=2 Restart=always @@ -88,8 +88,8 @@ export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock - Reboot -After the system restarts, check that the`act_runner` is working and that the runner is connected to Gitea. +After the system restarts, check that the`runner` is working and that the runner is connected to Gitea. ````bash - systemctl --user status act_runner - journalctl --user -xeu act_runner + systemctl --user status runner + journalctl --user -xeu runner diff --git a/go.mod b/go.mod index cff808c8..9126e381 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitea.com/gitea/act_runner +module gitea.com/gitea/runner go 1.26.0 diff --git a/internal/app/cmd/cache-server.go b/internal/app/cmd/cache-server.go index eed57d96..79d3bfc9 100644 --- a/internal/app/cmd/cache-server.go +++ b/internal/app/cmd/cache-server.go @@ -8,8 +8,8 @@ import ( "os" "os/signal" - "gitea.com/gitea/act_runner/act/artifactcache" - "gitea.com/gitea/act_runner/internal/pkg/config" + "gitea.com/gitea/runner/act/artifactcache" + "gitea.com/gitea/runner/internal/pkg/config" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/internal/app/cmd/cmd.go b/internal/app/cmd/cmd.go index 37481fa8..018e7a93 100644 --- a/internal/app/cmd/cmd.go +++ b/internal/app/cmd/cmd.go @@ -8,16 +8,16 @@ import ( "fmt" "os" - "gitea.com/gitea/act_runner/internal/pkg/config" - "gitea.com/gitea/act_runner/internal/pkg/ver" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/ver" "github.com/spf13/cobra" ) func Execute(ctx context.Context) { - // ./act_runner + // ./runner rootCmd := &cobra.Command{ - Use: "act_runner [event name to run]\nIf no event name passed, will default to \"on: push\"", + Use: "runner [event name to run]\nIf no event name passed, will default to \"on: push\"", Short: "Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly.", Args: cobra.MaximumNArgs(1), Version: ver.Version(), @@ -26,7 +26,7 @@ func Execute(ctx context.Context) { configFile := "" rootCmd.PersistentFlags().StringVarP(&configFile, "config", "c", "", "Config file path") - // ./act_runner register + // ./runner register var regArgs registerArgs registerCmd := &cobra.Command{ Use: "register", @@ -42,7 +42,7 @@ func Execute(ctx context.Context) { registerCmd.Flags().BoolVar(®Args.Ephemeral, "ephemeral", false, "Configure the runner to be ephemeral and only ever be able to pick a single job (stricter than --once)") rootCmd.AddCommand(registerCmd) - // ./act_runner daemon + // ./runner daemon var daemArgs daemonArgs daemonCmd := &cobra.Command{ Use: "daemon", @@ -53,10 +53,10 @@ func Execute(ctx context.Context) { daemonCmd.Flags().BoolVar(&daemArgs.Once, "once", false, "Run one job then exit") rootCmd.AddCommand(daemonCmd) - // ./act_runner exec + // ./runner exec rootCmd.AddCommand(loadExecCmd(ctx)) - // ./act_runner config + // ./runner config rootCmd.AddCommand(&cobra.Command{ Use: "generate-config", Short: "Generate an example config file", @@ -66,7 +66,7 @@ func Execute(ctx context.Context) { }, }) - // ./act_runner cache-server + // ./runner cache-server var cacheArgs cacheServerArgs cacheCmd := &cobra.Command{ Use: "cache-server", diff --git a/internal/app/cmd/daemon.go b/internal/app/cmd/daemon.go index b85d3a36..aaac6401 100644 --- a/internal/app/cmd/daemon.go +++ b/internal/app/cmd/daemon.go @@ -16,14 +16,14 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/internal/app/poll" - "gitea.com/gitea/act_runner/internal/app/run" - "gitea.com/gitea/act_runner/internal/pkg/client" - "gitea.com/gitea/act_runner/internal/pkg/config" - "gitea.com/gitea/act_runner/internal/pkg/envcheck" - "gitea.com/gitea/act_runner/internal/pkg/labels" - "gitea.com/gitea/act_runner/internal/pkg/metrics" - "gitea.com/gitea/act_runner/internal/pkg/ver" + "gitea.com/gitea/runner/internal/app/poll" + "gitea.com/gitea/runner/internal/app/run" + "gitea.com/gitea/runner/internal/pkg/client" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/envcheck" + "gitea.com/gitea/runner/internal/pkg/labels" + "gitea.com/gitea/runner/internal/pkg/metrics" + "gitea.com/gitea/runner/internal/pkg/ver" "connectrpc.com/connect" "github.com/mattn/go-isatty" @@ -104,7 +104,7 @@ func runDaemon(ctx context.Context, daemArgs *daemonArgs, configFile *string) fu } // if dockerSocketPath passes the check, override DOCKER_HOST with dockerSocketPath os.Setenv("DOCKER_HOST", dockerSocketPath) - // empty cfg.Container.DockerHost means act_runner need to find an available docker host automatically + // empty cfg.Container.DockerHost means runner need to find an available docker host automatically // and assign the path to cfg.Container.DockerHost if cfg.Container.DockerHost == "" { cfg.Container.DockerHost = dockerSocketPath diff --git a/internal/app/cmd/exec.go b/internal/app/cmd/exec.go index 750fb3c6..1195b2b5 100644 --- a/internal/app/cmd/exec.go +++ b/internal/app/cmd/exec.go @@ -15,11 +15,11 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/act/artifactcache" - "gitea.com/gitea/act_runner/act/artifacts" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" - "gitea.com/gitea/act_runner/act/runner" + "gitea.com/gitea/runner/act/artifactcache" + "gitea.com/gitea/runner/act/artifacts" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/act/runner" "github.com/docker/docker/api/types/container" "github.com/joho/godotenv" diff --git a/internal/app/cmd/register.go b/internal/app/cmd/register.go index 04af75d7..ea4c0ee9 100644 --- a/internal/app/cmd/register.go +++ b/internal/app/cmd/register.go @@ -14,10 +14,10 @@ import ( "strings" "time" - "gitea.com/gitea/act_runner/internal/pkg/client" - "gitea.com/gitea/act_runner/internal/pkg/config" - "gitea.com/gitea/act_runner/internal/pkg/labels" - "gitea.com/gitea/act_runner/internal/pkg/ver" + "gitea.com/gitea/runner/internal/pkg/client" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/labels" + "gitea.com/gitea/runner/internal/pkg/ver" pingv1 "code.gitea.io/actions-proto-go/ping/v1" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" diff --git a/internal/app/poll/poller.go b/internal/app/poll/poller.go index 20d88e1f..37ab7b28 100644 --- a/internal/app/poll/poller.go +++ b/internal/app/poll/poller.go @@ -12,9 +12,9 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/act_runner/internal/pkg/client" - "gitea.com/gitea/act_runner/internal/pkg/config" - "gitea.com/gitea/act_runner/internal/pkg/metrics" + "gitea.com/gitea/runner/internal/pkg/client" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/metrics" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "connectrpc.com/connect" diff --git a/internal/app/poll/poller_test.go b/internal/app/poll/poller_test.go index 6a69da49..e9d10d12 100644 --- a/internal/app/poll/poller_test.go +++ b/internal/app/poll/poller_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "gitea.com/gitea/act_runner/internal/pkg/client/mocks" - "gitea.com/gitea/act_runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/client/mocks" + "gitea.com/gitea/runner/internal/pkg/config" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" connect_go "connectrpc.com/connect" diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 64101eba..b486aec9 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -15,16 +15,16 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/act_runner/act/artifactcache" - "gitea.com/gitea/act_runner/act/common" - "gitea.com/gitea/act_runner/act/model" - "gitea.com/gitea/act_runner/act/runner" - "gitea.com/gitea/act_runner/internal/pkg/client" - "gitea.com/gitea/act_runner/internal/pkg/config" - "gitea.com/gitea/act_runner/internal/pkg/labels" - "gitea.com/gitea/act_runner/internal/pkg/metrics" - "gitea.com/gitea/act_runner/internal/pkg/report" - "gitea.com/gitea/act_runner/internal/pkg/ver" + "gitea.com/gitea/runner/act/artifactcache" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/act/runner" + "gitea.com/gitea/runner/internal/pkg/client" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/labels" + "gitea.com/gitea/runner/internal/pkg/metrics" + "gitea.com/gitea/runner/internal/pkg/report" + "gitea.com/gitea/runner/internal/pkg/ver" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "connectrpc.com/connect" diff --git a/internal/app/run/workflow.go b/internal/app/run/workflow.go index 26fab971..fe75ccf3 100644 --- a/internal/app/run/workflow.go +++ b/internal/app/run/workflow.go @@ -9,7 +9,7 @@ import ( "sort" "strings" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "go.yaml.in/yaml/v4" diff --git a/internal/app/run/workflow_test.go b/internal/app/run/workflow_test.go index b16cc0b9..b91fc3ac 100644 --- a/internal/app/run/workflow_test.go +++ b/internal/app/run/workflow_test.go @@ -6,7 +6,7 @@ package run import ( "testing" - "gitea.com/gitea/act_runner/act/model" + "gitea.com/gitea/runner/act/model" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "github.com/stretchr/testify/require" diff --git a/internal/pkg/config/config.example.yaml b/internal/pkg/config/config.example.yaml index 14da4c73..c114dc94 100644 --- a/internal/pkg/config/config.example.yaml +++ b/internal/pkg/config/config.example.yaml @@ -1,7 +1,7 @@ # Example configuration file, it's safe to copy this as the default config file without any modification. # You don't have to copy this file to your instance, -# just run `./act_runner generate-config > config.yaml` to generate a config file. +# just run `./runner generate-config > config.yaml` to generate a config file. log: # The level of logging, can be trace, debug, info, warn, error, fatal @@ -79,21 +79,21 @@ cache: # 0 means to use a random available port. port: 0 # The external cache server URL. Valid only when enable is true. - # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself. + # If it's specified, runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself. # The URL should generally end with "/". external_server: "" container: # Specifies the network to which the container will connect. # Could be host, bridge or the name of a custom network. - # If it's empty, act_runner will create a network automatically. + # If it's empty, runner will create a network automatically. network: "" # Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker). privileged: false # Any other options to be used when the container is started (e.g., --add-host=my.gitea.url:host-gateway). options: # The parent directory of a job's working directory. - # NOTE: There is no need to add the first '/' of the path as act_runner will add it automatically. + # NOTE: There is no need to add the first '/' of the path as runner will add it automatically. # If the path starts with '/', the '/' will be trimmed. # For example, if the parent directory is /path/to/my/dir, workdir_parent should be path/to/my/dir # If it's empty, /workspace will be used. @@ -109,17 +109,17 @@ container: # - '**' valid_volumes: [] # Overrides the docker client host with the specified one. - # If it's empty, act_runner will find an available docker host automatically. - # If it's "-", act_runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers. + # If it's empty, runner will find an available docker host automatically. + # If it's "-", runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers. # If it's not empty or "-", the specified docker host will be used. An error will be returned if it doesn't work. docker_host: "" # Pull docker image(s) even if already present force_pull: true # Rebuild docker image(s) even if already present force_rebuild: false - # Always require a reachable docker daemon, even if not required by act_runner + # Always require a reachable docker daemon, even if not required by runner require_docker: false - # Timeout to wait for the docker daemon to be reachable, if docker is required by require_docker or act_runner + # Timeout to wait for the docker daemon to be reachable, if docker is required by require_docker or runner docker_timeout: 0s # Bind the workspace to the host filesystem instead of using Docker volumes. # This is required for Docker-in-Docker (DinD) setups when jobs use docker compose diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 248b79bc..0936b66d 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -60,8 +60,8 @@ type Container struct { DockerHost string `yaml:"docker_host"` // DockerHost specifies the Docker host. It overrides the value specified in environment variable DOCKER_HOST. ForcePull bool `yaml:"force_pull"` // Pull docker image(s) even if already present ForceRebuild bool `yaml:"force_rebuild"` // Rebuild docker image(s) even if already present - RequireDocker bool `yaml:"require_docker"` // Always require a reachable docker daemon, even if not required by act_runner - DockerTimeout time.Duration `yaml:"docker_timeout"` // Timeout to wait for the docker daemon to be reachable, if docker is required by require_docker or act_runner + RequireDocker bool `yaml:"require_docker"` // Always require a reachable docker daemon, even if not required by runner + DockerTimeout time.Duration `yaml:"docker_timeout"` // Timeout to wait for the docker daemon to be reachable, if docker is required by require_docker or runner BindWorkdir bool `yaml:"bind_workdir"` // BindWorkdir binds the workspace to the host filesystem instead of using Docker volumes. Required for DinD when jobs use docker compose with bind mounts. } @@ -185,7 +185,7 @@ func LoadDefault(file string) (*Config, error) { if cfg.Container.NetworkMode == "bridge" { // Previously, if the value of `container.network_mode` is `bridge`, we will create a new network for job. // But “bridge” is easily confused with the bridge network created by Docker by default. - // So we set the value of `container.network` to empty string to make `act_runner` automatically create a new network for job. + // So we set the value of `container.network` to empty string to make `runner` automatically create a new network for job. cfg.Container.Network = "" } else { cfg.Container.Network = cfg.Container.NetworkMode diff --git a/internal/pkg/metrics/metrics.go b/internal/pkg/metrics/metrics.go index 5ce08382..b83d69b1 100644 --- a/internal/pkg/metrics/metrics.go +++ b/internal/pkg/metrics/metrics.go @@ -12,8 +12,8 @@ import ( "github.com/prometheus/client_golang/prometheus/collectors" ) -// Namespace is the Prometheus namespace for all act_runner metrics. -const Namespace = "act_runner" +// Namespace is the Prometheus namespace for all runner metrics. +const Namespace = "runner" // Label value constants for Prometheus metrics. // Using constants prevents typos from silently creating new time-series. diff --git a/internal/pkg/report/reporter.go b/internal/pkg/report/reporter.go index dc2bfbca..593cb469 100644 --- a/internal/pkg/report/reporter.go +++ b/internal/pkg/report/reporter.go @@ -12,9 +12,9 @@ import ( "sync" "time" - "gitea.com/gitea/act_runner/internal/pkg/client" - "gitea.com/gitea/act_runner/internal/pkg/config" - "gitea.com/gitea/act_runner/internal/pkg/metrics" + "gitea.com/gitea/runner/internal/pkg/client" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/metrics" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "connectrpc.com/connect" diff --git a/internal/pkg/report/reporter_test.go b/internal/pkg/report/reporter_test.go index 15b361ab..29ac5ac4 100644 --- a/internal/pkg/report/reporter_test.go +++ b/internal/pkg/report/reporter_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "gitea.com/gitea/act_runner/internal/pkg/client/mocks" - "gitea.com/gitea/act_runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/client/mocks" + "gitea.com/gitea/runner/internal/pkg/config" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" connect_go "connectrpc.com/connect" @@ -220,7 +220,7 @@ func TestReporter_Fire(t *testing.T) { } // TestReporter_EphemeralRunnerDeletion reproduces the exact scenario from -// https://gitea.com/gitea/act_runner/issues/793: +// https://gitea.com/gitea/runner/issues/793: // // 1. RunDaemon calls ReportLog(false) — runner is still alive // 2. Close() updates state to Result=FAILURE (between RunDaemon's ReportLog and ReportState) diff --git a/internal/pkg/ver/version.go b/internal/pkg/ver/version.go index 3c07a189..c86157cd 100644 --- a/internal/pkg/ver/version.go +++ b/internal/pkg/ver/version.go @@ -3,7 +3,7 @@ package ver -// go build -ldflags "-X gitea.com/gitea/act_runner/internal/pkg/ver.version=1.2.3" +// go build -ldflags "-X gitea.com/gitea/runner/internal/pkg/ver.version=1.2.3" var version = "dev" func Version() string { diff --git a/main.go b/main.go index 4adbd13f..cd16cfaf 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "os/signal" "syscall" - "gitea.com/gitea/act_runner/internal/app/cmd" + "gitea.com/gitea/runner/internal/app/cmd" ) func main() { diff --git a/scripts/run.sh b/scripts/run.sh index 18807237..87280509 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -36,12 +36,12 @@ if [[ ! -s "$RUNNER_STATE_FILE" ]]; then try=$((try + 1)) success=0 - # The point of this loop is to make it simple, when running both act_runner and gitea in docker, - # for the act_runner to wait a moment for gitea to become available before erroring out. Within + # The point of this loop is to make it simple, when running both runner and gitea in docker, + # for the runner to wait a moment for gitea to become available before erroring out. Within # the context of a single docker-compose, something similar could be done via healthchecks, but # this is more flexible. while [[ $success -eq 0 ]] && [[ $try -lt ${GITEA_MAX_REG_ATTEMPTS:-10} ]]; do - act_runner register \ + runner register \ --instance "${GITEA_INSTANCE_URL}" \ --token "${GITEA_RUNNER_REGISTRATION_TOKEN}" \ --name "${GITEA_RUNNER_NAME:-`hostname`}" \ @@ -57,8 +57,8 @@ if [[ ! -s "$RUNNER_STATE_FILE" ]]; then fi done fi -# Prevent reading the token from the act_runner process +# Prevent reading the token from the runner process unset GITEA_RUNNER_REGISTRATION_TOKEN unset GITEA_RUNNER_REGISTRATION_TOKEN_FILE -exec act_runner daemon ${CONFIG_ARG} ${RUN_ARGS} +exec runner daemon ${CONFIG_ARG} ${RUN_ARGS}