Switch to process isolation mode by default and give an option to use hyperv isolation to improve performance

This commit is contained in:
Andrew Kahr 2023-10-27 18:55:23 -07:00
parent d47dc754af
commit 974b785700
5 changed files with 11 additions and 0 deletions

View File

@ -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: ''

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -98,6 +98,7 @@ class Docker {
dockerWorkspacePath,
dockerCpuLimit,
dockerMemoryLimit,
dockerIsolationMode,
} = parameters;
return `docker run \
@ -118,6 +119,7 @@ class Docker {
--volume "${actionFolder}/BlankProject":"c:/BlankProject" \
--cpus=${dockerCpuLimit} \
--memory=${dockerMemoryLimit} \
--isolation=${dockerIsolationMode} \
${image} \
powershell c:/steps/entrypoint.ps1`;
}

View File

@ -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;