[PR #1293] [MERGED] feat: Host environment #1879

Closed
opened 2026-03-01 21:53:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1293
Author: @ChristopherHX
Created: 8/5/2022
Status: Merged
Merged: 11/16/2022
Merged by: @mergify[bot]

Base: masterHead: host_environment


📝 Commits (10+)

📊 Changes

39 files changed (+1394 additions, -185 deletions)

View changed files

📝 .github/workflows/checks.yml (+19 -0)
📝 go.mod (+1 -0)
📝 pkg/container/docker_run.go (+2 -1)
📝 pkg/container/docker_run_test.go (+3 -0)
pkg/container/executions_environment.go (+13 -0)
📝 pkg/container/file_collector.go (+23 -0)
pkg/container/host_environment.go (+470 -0)
pkg/container/host_environment_test.go (+4 -0)
pkg/container/linux_container_environment_extensions.go (+73 -0)
pkg/container/linux_container_environment_extensions_test.go (+71 -0)
pkg/container/util.go (+26 -0)
pkg/container/util_openbsd_mips64.go (+17 -0)
pkg/container/util_plan9.go (+17 -0)
pkg/container/util_windows.go (+15 -0)
pkg/lookpath/LICENSE (+27 -0)
pkg/lookpath/env.go (+18 -0)
pkg/lookpath/error.go (+10 -0)
pkg/lookpath/lp_js.go (+23 -0)
pkg/lookpath/lp_plan9.go (+56 -0)
pkg/lookpath/lp_unix.go (+59 -0)

...and 19 more files

📄 Description

This is my refactored implementation of a non docker based executor

To test running actions without docker specify -P ubuntu-latest=-self-hosted

I refactored a larger amount of code

  • Allow to alter /var/run/act
    • otherwise concurrent executors on the same host conflict each other
    • this folder cannot be created on windows
  • Tweak PATH manipulation to use custom list seperator, while not running in docker
  • Different runner context if running on host vs. in a container

Fixes https://github.com/nektos/act/issues/97

I need to look into possible linting violations

Known Issues

  • windows cmd not working, omitted here to shrink size
  • Possible escaping problems for default shell, omitted here to shrink size
  • On windows cmdline needs to be added to the container interface, omitted here to shrink size
  • Default shell bash not suitable on windows
  • docker actions are intentionally failing, since window and macos runner doesn't support them officially and some platforms like freebsd, etc. doesn't support docker

I want to know if this design change has a chance to get merged

Some implementation Details

  • lookpath is mostly copied from the go stdlib, because the original didn't allow to provide a custom PATH variable for lookup and I want to make shure multiple parallel workers don't update PATH env var to use the stdlib directly
  • Most changes are done by replace operations, API Change
  • New if conditions to avoid a crash in Tests, these issues don't appear with a well constructed run_context

Commit Message

{{title}} (#1293)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/1293 **Author:** [@ChristopherHX](https://github.com/ChristopherHX) **Created:** 8/5/2022 **Status:** ✅ Merged **Merged:** 11/16/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `host_environment` --- ### 📝 Commits (10+) - [`0ffac4c`](https://github.com/nektos/act/commit/0ffac4c71c7fc3fd7526337e6b885ccbd63f4695) feat: HostEnvironment - [`7f3b9b0`](https://github.com/nektos/act/commit/7f3b9b0a02987963121331a6a7d81ff69e13192e) fix: lint - [`5cbbeb9`](https://github.com/nektos/act/commit/5cbbeb9bd5afe1f83aa90710c272afc22ccfb59b) fixes and update code - [`cd66680`](https://github.com/nektos/act/commit/cd666807e3a09aa5398a6d4315531ff99d261c62) update go mod - [`7172785`](https://github.com/nektos/act/commit/7172785b3ad0b39e6d4a8fa674745a0754ff201e) lint / test fixes - [`51464dd`](https://github.com/nektos/act/commit/51464ddea75c462c55b08878ff406b627d787084) fix lint - [`d98c077`](https://github.com/nektos/act/commit/d98c07728330df3c7436714472559d0aa15ae65a) Evaluate job env in jobexecutor, disable test - [`ea2b60d`](https://github.com/nektos/act/commit/ea2b60d516af366a0ca8d11b36831e1a50f9ba29) fix: CI is unstable due to new linting rules - [`b9828de`](https://github.com/nektos/act/commit/b9828deb3aa099983a83b37adda8c235743d4f7b) stability fixes - [`43c0006`](https://github.com/nektos/act/commit/43c000667da0addf74fe6052999de49d1fb9f8a7) fix lint ### 📊 Changes **39 files changed** (+1394 additions, -185 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/checks.yml` (+19 -0) 📝 `go.mod` (+1 -0) 📝 `pkg/container/docker_run.go` (+2 -1) 📝 `pkg/container/docker_run_test.go` (+3 -0) ➕ `pkg/container/executions_environment.go` (+13 -0) 📝 `pkg/container/file_collector.go` (+23 -0) ➕ `pkg/container/host_environment.go` (+470 -0) ➕ `pkg/container/host_environment_test.go` (+4 -0) ➕ `pkg/container/linux_container_environment_extensions.go` (+73 -0) ➕ `pkg/container/linux_container_environment_extensions_test.go` (+71 -0) ➕ `pkg/container/util.go` (+26 -0) ➕ `pkg/container/util_openbsd_mips64.go` (+17 -0) ➕ `pkg/container/util_plan9.go` (+17 -0) ➕ `pkg/container/util_windows.go` (+15 -0) ➕ `pkg/lookpath/LICENSE` (+27 -0) ➕ `pkg/lookpath/env.go` (+18 -0) ➕ `pkg/lookpath/error.go` (+10 -0) ➕ `pkg/lookpath/lp_js.go` (+23 -0) ➕ `pkg/lookpath/lp_plan9.go` (+56 -0) ➕ `pkg/lookpath/lp_unix.go` (+59 -0) _...and 19 more files_ </details> ### 📄 Description This is my refactored implementation of a non docker based executor To test running actions without docker specify `-P ubuntu-latest=-self-hosted` I refactored a larger amount of code - Allow to alter `/var/run/act` - otherwise concurrent executors on the same host conflict each other - this folder cannot be created on windows - Tweak `PATH` manipulation to use custom list seperator, while not running in docker - Different runner context if running on host vs. in a container Fixes https://github.com/nektos/act/issues/97 _I need to look into possible linting violations_ **Known Issues** - windows cmd not working, omitted here to shrink size - Possible escaping problems for default shell, omitted here to shrink size - On windows cmdline needs to be added to the container interface, omitted here to shrink size - Default shell bash not suitable on windows - docker actions are intentionally failing, since window and macos runner doesn't support them officially and some platforms like freebsd, etc. doesn't support docker _I want to know if this design change has a chance to get merged_ _Some implementation Details_ - lookpath is mostly copied from the go stdlib, because the original didn't allow to provide a custom PATH variable for lookup and I want to make shure multiple parallel workers don't update `PATH` env var to use the stdlib directly - Most changes are done by replace operations, API Change - New if conditions to avoid a crash in Tests, these issues don't appear with a well constructed run_context ## Commit Message {{title}} (#1293) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:53:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1879
No description provided.