Skip to content

Commit

Permalink
Switch to process isolation mode by default and give an option to use…
Browse files Browse the repository at this point in the history
… hyperv isolation to improve performance
  • Loading branch information
AndrewKahr committed Oct 28, 2023
1 parent d47dc75 commit 974b785
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ inputs:
'Amount of memory to assign the docker container. Defaults to 95% of total system memory rounded down to the
nearest megabyte on Linux and 80% on Windows. On unrecognized platforms, defaults to 75% of total system memory.
To manually specify a value, use the format <number><unit>, where unit is either m or g. ie: 512m = 512 megabytes'
dockerIsolationMode:
required: false
default: 'process'
description:
'Isolation mode to use for the docker container. Can be either process or hyperv. Only applicable on Windows'
allowDirtyBuild:
required: false
default: ''
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/model/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class Docker {
dockerWorkspacePath,
dockerCpuLimit,
dockerMemoryLimit,
dockerIsolationMode,
} = parameters;

return `docker run \
Expand All @@ -118,6 +119,7 @@ class Docker {
--volume "${actionFolder}/BlankProject":"c:/BlankProject" \
--cpus=${dockerCpuLimit} \
--memory=${dockerMemoryLimit} \
--isolation=${dockerIsolationMode} \
${image} \
powershell c:/steps/entrypoint.ps1`;
}
Expand Down
4 changes: 4 additions & 0 deletions src/model/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ class Input {
);
}

static get dockerIsolationMode(): string {
return Input.getInput('dockerIsolationMode') || 'process';
}

public static ToEnvVarFormat(input: string) {
if (input.toUpperCase() === input) {
return input;
Expand Down

0 comments on commit 974b785

Please sign in to comment.