Switch to process isolation mode by default and give an option to use hyperv isolation to improve performance
parent
d47dc754af
commit
974b785700
|
@ -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: ''
|
||||
|
|
|
@ -5925,7 +5925,7 @@ class Docker {
|
|||
"${overrideCommands !== '' ? overrideCommands : `/entrypoint.sh`}"`;
|
||||
}
|
||||
static getWindowsCommand(image, parameters) {
|
||||
const { workspace, actionFolder, unitySerial, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||
const { workspace, actionFolder, unitySerial, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, dockerIsolationMode, } = parameters;
|
||||
return `docker run \
|
||||
--workdir c:${dockerWorkspacePath} \
|
||||
--rm \
|
||||
|
@ -5944,6 +5944,7 @@ class Docker {
|
|||
--volume "${actionFolder}/BlankProject":"c:/BlankProject" \
|
||||
--cpus=${dockerCpuLimit} \
|
||||
--memory=${dockerMemoryLimit} \
|
||||
--isolation=${dockerIsolationMode} \
|
||||
${image} \
|
||||
powershell c:/steps/entrypoint.ps1`;
|
||||
}
|
||||
|
@ -6934,6 +6935,9 @@ class Input {
|
|||
}
|
||||
return (Input.getInput('dockerMemoryLimit') || `${Math.floor((node_os_1.default.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`);
|
||||
}
|
||||
static get dockerIsolationMode() {
|
||||
return Input.getInput('dockerIsolationMode') || 'process';
|
||||
}
|
||||
static ToEnvVarFormat(input) {
|
||||
if (input.toUpperCase() === input) {
|
||||
return input;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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`;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue