xgboost/tests/ci_build/jenkins_tools.Groovy
Philip Hyunsu Cho ea850ecd20
[CI] Refactor Jenkins CI pipeline + migrate all Linux tests to Jenkins (#4401)
* All Linux tests are now in Jenkins CI
* Tests are now de-coupled from builds. We can now build XGBoost with one version of CUDA/JDK and test it with another version of CUDA/JDK
* Builds (compilation) are significantly faster because 1) They use C5 instances with faster CPU cores; and 2) build environment setup is cached using Docker containers
2019-04-26 18:39:12 -07:00

39 lines
1.2 KiB
Groovy

#!/usr/bin/groovy
// -*- mode: groovy -*-
/* Utility functions for Jenkins */
// Command to run command inside a docker container
dockerRun = 'tests/ci_build/ci_build.sh'
/**
* Creates cmake and make builds
*/
def buildFactory(buildName, conf, restricted, build_func) {
def os = conf["os"]
def device = conf["withGpu"] ? (conf["multiGpu"] ? "mgpu" : "gpu") : "cpu"
def restricted_flag = restricted ? "restricted" : "unrestricted"
def nodeReq = "${os} && ${device} && ${restricted_flag}"
def dockerTarget = conf["withGpu"] ? "gpu" : "cpu"
[ ("${buildName}") : { build_func("${buildName}", conf, nodeReq, dockerTarget) }
]
}
def cmakeOptions(conf) {
return ([
conf["withGpu"] ? '-DUSE_CUDA=ON' : '-DUSE_CUDA=OFF',
conf["withNccl"] ? '-DUSE_NCCL=ON' : '-DUSE_NCCL=OFF',
conf["withOmp"] ? '-DOPEN_MP:BOOL=ON' : '']
).join(" ")
}
def getBuildName(conf) {
def gpuLabel = conf['withGpu'] ? ( (conf['multiGpu'] ? "_mgpu" : "") + "_cuda" + conf['cudaVersion'] + (conf['withNccl'] ? "_nccl" : "_nonccl")) : "_cpu"
def ompLabel = conf['withOmp'] ? "_omp" : ""
def pyLabel = "_py${conf['pythonVersion']}"
return "${conf['os']}${gpuLabel}${ompLabel}${pyLabel}"
}
return this