Skip to content

Commit

Permalink
Run all Windows jobs in a single worker image
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jul 17, 2020
1 parent 03a1243 commit 7e5edd6
Showing 1 changed file with 15 additions and 32 deletions.
47 changes: 15 additions & 32 deletions Jenkinsfile-win64
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ def commit_id // necessary to pass a variable from one stage to another

pipeline {
agent none

// Setup common job properties
options {
timestamps()
timeout(time: 240, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '10'))
preserveStashes()
}

// Build stages
stages {
stage('Jenkins Win64: Initialize') {
Expand Down Expand Up @@ -40,8 +49,7 @@ pipeline {
steps {
script {
parallel ([
'test-win64-cpu': { TestWin64CPU() },
'test-win64-gpu-cuda10.1': { TestWin64GPU(cuda_target: 'cuda10_1') }
'test-win64-cuda10.0': { TestWin64() },
])
}
milestone ordinal: 3
Expand All @@ -66,7 +74,7 @@ def checkoutSrcs() {
}

def BuildWin64() {
node('win64 && build && cuda10') {
node('win64 && cuda10_unified') {
unstash name: 'srcs'
echo "Building XGBoost for Windows AMD64 target..."
bat "nvcc --version"
Expand Down Expand Up @@ -107,48 +115,23 @@ def BuildWin64() {
}
}

def TestWin64CPU() {
node('win64 && cpu') {
def TestWin64() {
node('win64 && cuda10_unified') {
unstash name: 'srcs'
unstash name: 'xgboost_whl'
unstash name: 'xgboost_cli'
echo "Test Win64 CPU"
echo "Test Win64"
echo "Installing Python wheel..."
bat "conda activate && (python -m pip uninstall -y xgboost || cd .)"
bat """
conda activate && for /R %%i in (python-package\\dist\\*.whl) DO python -m pip install "%%i"
"""
echo "Installing Python dependencies..."
bat """
conda activate && conda install -y hypothesis && conda upgrade scikit-learn pandas numpy hypothesis
conda activate && conda install -y hypothesis && conda upgrade scikit-learn pandas numpy hypothesis && python -m pip install cupy-cuda100
"""
echo "Running Python tests..."
bat "conda activate && python -m pytest -v -s --fulltrace tests\\python"
bat "conda activate && python -m pip uninstall -y xgboost"
deleteDir()
}
}

def TestWin64GPU(args) {
node("win64 && gpu && ${args.cuda_target}") {
unstash name: 'srcs'
unstash name: 'xgboost_whl'
unstash name: 'xgboost_cpp_tests'
echo "Test Win64 GPU (${args.cuda_target})"
bat "nvcc --version"
echo "Running C++ tests..."
bat "build\\testxgboost.exe"
echo "Installing Python wheel..."
bat "conda activate && (python -m pip uninstall -y xgboost || cd .)"
bat """
conda activate && for /R %%i in (python-package\\dist\\*.whl) DO python -m pip install "%%i"
"""
echo "Installing Python dependencies..."
def cuda_short_ver = args.cuda_target.replaceAll('_', '')
bat """
conda activate && conda install -y hypothesis && conda upgrade scikit-learn pandas numpy hypothesis && python -m pip install cupy-${cuda_short_ver}
"""
echo "Running Python tests..."
bat """
conda activate && python -m pytest -v -s --fulltrace -m "(not slow) and (not mgpu)" tests\\python-gpu
"""
Expand Down

0 comments on commit 7e5edd6

Please sign in to comment.