Skip to content

Commit

Permalink
Detected whether we're running in a Namespace runner, and if so, set …
Browse files Browse the repository at this point in the history
…`init: none`. (#52)

Background: Namespace managed runners run each github job in a container, in a
separate micro-vm managed by Namespace. These VMs and containers do not rely on
systemd, and instead use Namespace's own init/process management.
  • Loading branch information
hugosantos authored Nov 2, 2023
1 parent 721f94f commit 7fa8f59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ class NixInstallerAction {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info("Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`");
execution_env.NIX_INSTALLER_INIT = "none";
}
if (process.env.NSC_VM_ID && !process.env.NOT_NAMESPACE) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info("Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace");
execution_env.NIX_INSTALLER_INIT = "none";
}
return execution_env;
}
async execute_install(binary_path) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ class NixInstallerAction {
execution_env.NIX_INSTALLER_INIT = "none";
}

if (process.env.NSC_VM_ID && !process.env.NOT_NAMESPACE) {
actions_core.info(
"Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace",
);
execution_env.NIX_INSTALLER_INIT = "none";
}

return execution_env;
}

Expand Down

0 comments on commit 7fa8f59

Please sign in to comment.