add initial compileGroup support

This commit is contained in:
Brian Gough
2020-06-11 16:01:44 +01:00
parent 9b92793b89
commit b33734bab6
9 changed files with 183 additions and 18 deletions

View File

@@ -63,6 +63,17 @@ module.exports = {
}
}
if (process.env.ALLOWED_COMPILE_GROUPS) {
try {
module.exports.allowedCompileGroups = process.env.ALLOWED_COMPILE_GROUPS.split(
' '
)
} catch (error) {
console.error(error, 'could not apply allowed compile group setting')
process.exit(1)
}
}
if (process.env.DOCKER_RUNNER) {
let seccompProfilePath
module.exports.clsi = {
@@ -82,6 +93,21 @@ if (process.env.DOCKER_RUNNER) {
checkProjectsIntervalMs: 10 * 60 * 1000
}
try {
// Override individual docker settings using path-based keys, e.g.:
// compileGroupDockerConfigs = {
// priority: { 'HostConfig.CpuShares': 100 }
// beta: { 'dotted.path.here', 'value'}
// }
const compileGroupConfig = JSON.parse(
process.env.COMPILE_GROUP_DOCKER_CONFIGS || '{}'
)
module.exports.clsi.docker.compileGroupConfig = compileGroupConfig
} catch (error) {
console.error(error, 'could not apply compile group docker configs')
process.exit(1)
}
try {
seccompProfilePath = Path.resolve(__dirname, '../seccomp/clsi-profile.json')
module.exports.clsi.docker.seccomp_profile = JSON.stringify(