Parameterized kube memory, cpu, disc space for builds
parent
4f86195a1f
commit
6fa438534f
12
action.yml
12
action.yml
|
|
@ -30,6 +30,18 @@ inputs:
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
description: 'Supply a base64 encoded kubernetes config to run builds on kubernetes and stream logs until completion.'
|
description: 'Supply a base64 encoded kubernetes config to run builds on kubernetes and stream logs until completion.'
|
||||||
|
kubeContainerMemory:
|
||||||
|
default: '800M'
|
||||||
|
required: false
|
||||||
|
description: 'Amount of memory to assign the build container in Kubernetes (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes)'
|
||||||
|
kubeContainerCPU:
|
||||||
|
default: '0.25'
|
||||||
|
required: false
|
||||||
|
description: 'Amount of CPU time to assign the build container in Kubernetes (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes)'
|
||||||
|
kubeVolumeDiscSize:
|
||||||
|
default: '5Gi'
|
||||||
|
required: false
|
||||||
|
description: 'Amount of disc space to assign the Kubernetes Persistent Volume (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes)'
|
||||||
githubToken:
|
githubToken:
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -38,6 +38,9 @@ class BuildParameters {
|
||||||
customParameters: Input.customParameters,
|
customParameters: Input.customParameters,
|
||||||
kubeConfig: Input.kubeConfig,
|
kubeConfig: Input.kubeConfig,
|
||||||
githubToken: Input.githubToken,
|
githubToken: Input.githubToken,
|
||||||
|
kubeContainerMemory: Input.kubeContainerMemory,
|
||||||
|
kubeContainerCPU: Input.kubeContainerCPU,
|
||||||
|
kubeVolumeDiscSize: Input.kubeVolumeDiscSize,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,19 @@ class Input {
|
||||||
}
|
}
|
||||||
|
|
||||||
static get githubToken() {
|
static get githubToken() {
|
||||||
return core.getInput('githubToken') || false;
|
return core.getInput('githubToken') || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
static get kubeContainerMemory() {
|
||||||
|
return core.getInput('kubeContainerMemory') || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
static get kubeContainerCPU() {
|
||||||
|
return core.getInput('kubeContainerCPU') || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
static get kubeVolumeDiscSize() {
|
||||||
|
return core.getInput('kubeVolumeDiscSize') || '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class Kubernetes {
|
||||||
volumeMode: 'Filesystem',
|
volumeMode: 'Filesystem',
|
||||||
resources: {
|
resources: {
|
||||||
requests: {
|
requests: {
|
||||||
storage: '5Gi',
|
storage: this.buildParameters.kubeVolumeDiscSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -176,6 +176,12 @@ class Kubernetes {
|
||||||
/entrypoint.sh;
|
/entrypoint.sh;
|
||||||
`,
|
`,
|
||||||
],
|
],
|
||||||
|
resources: {
|
||||||
|
requests: {
|
||||||
|
memory: this.buildParameters.kubeContainerMemory,
|
||||||
|
cpu: this.buildParameters.kubeContainerCPU,
|
||||||
|
},
|
||||||
|
},
|
||||||
env: [
|
env: [
|
||||||
{
|
{
|
||||||
name: 'GITHUB_WORKSPACE',
|
name: 'GITHUB_WORKSPACE',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue