Skip to content

Commit

Permalink
Merge pull request #492 from UIUCLibrary/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
henryborchers authored Dec 6, 2023
2 parents ede4657 + 5f63116 commit dea13a4
Show file tree
Hide file tree
Showing 3 changed files with 365 additions and 188 deletions.
237 changes: 171 additions & 66 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -371,35 +371,71 @@ def testPythonPackages(){
SUPPORTED_WINDOWS_VERSIONS.each{ pythonVersion ->
if(params.INCLUDE_WINDOWS_X86_64 == true){
windowsTests["Windows - Python ${pythonVersion}-x86: sdist"] = {
packages.testPkg2(
packages.testPkg(
agent: [
dockerfile: [
label: 'windows && docker && x86',
filename: 'ci/docker/python/windows/tox/Dockerfile',
additionalBuildArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE',
args: '-v pipcache_speedwagon:c:/users/containeradministrator/appdata/local/pip'
additionalBuildArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE'
]
],
glob: 'dist/*.tar.gz,dist/*.zip',
stash: 'PYTHON_PACKAGES',
toxEnv: "py${pythonVersion.replace('.', '')}-PySide6",
retry: 3,
retries: 3,
testSetup: {
checkout scm
unstash 'PYTHON_PACKAGES'
},
testCommand: {
findFiles(glob: 'dist/*.tar.gz,dist/*.zip').each{
powershell(label: 'Running Tox', script: "tox --installpkg ${it.path} --workdir \$env:TEMP\\tox -e py${pythonVersion.replace('.', '')}-PySide6")
}

},
post:[
cleanup: {
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
],
notFailBuild: true,
deleteDirs: true
)
},
]
)
}
windowsTests["Windows - Python ${pythonVersion}-x86: wheel"] = {
packages.testPkg2(
packages.testPkg(
agent: [
dockerfile: [
label: 'windows && docker && x86',
filename: 'ci/docker/python/windows/tox/Dockerfile',
additionalBuildArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE',
args: '-v pipcache_speedwagon:c:/users/containeradministrator/appdata/local/pip'
additionalBuildArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE'
]
],
glob: 'dist/*.whl',
stash: 'PYTHON_PACKAGES',
toxEnv: "py${pythonVersion.replace('.', '')}-PySide6",
retry: 3,
retries: 3,
testSetup: {
checkout scm
unstash 'PYTHON_PACKAGES'
},
testCommand: {
findFiles(glob: 'dist/*.whl').each{
powershell(label: 'Running Tox', script: "tox --installpkg ${it.path} --workdir \$env:TEMP\\tox -e py${pythonVersion.replace('.', '')}-PySide6")
}

},
post:[
cleanup: {
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
],
notFailBuild: true,
deleteDirs: true
)
},
]
)
}
}
Expand All @@ -415,7 +451,7 @@ def testPythonPackages(){
}
architectures.each{ processorArchitecture ->
linuxTests["Linux-${processorArchitecture} - Python ${pythonVersion}: sdist"] = {
packages.testPkg2(
packages.testPkg(
agent: [
dockerfile: [
label: "linux && docker && ${processorArchitecture}",
Expand All @@ -424,14 +460,35 @@ def testPythonPackages(){
args: '-v pipcache_speedwagon:/.cache/pip'
]
],
glob: 'dist/*.tar.gz',
stash: 'PYTHON_PACKAGES',
toxEnv: processorArchitecture=='arm' ? "py${pythonVersion.replace('.', '')}" : "py${pythonVersion.replace('.', '')}-PySide6",
retry: 3,
retries: 3,
testSetup: {
checkout scm
unstash 'PYTHON_PACKAGES'
},
testCommand: {
findFiles(glob: 'dist/*.tar.gz').each{
sh(
label: 'Running Tox',
script: "tox --installpkg ${it.path} --workdir /tmp/tox -e py${pythonVersion.replace('.', '')}-PySide6"
)
}
},
post:[
cleanup: {
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
],
notFailBuild: true,
deleteDirs: true
)
},
]
)
}
linuxTests["Linux-${processorArchitecture} - Python ${pythonVersion}: wheel"] = {
packages.testPkg2(
packages.testPkg(
agent: [
dockerfile: [
label: "linux && docker && ${processorArchitecture}",
Expand All @@ -440,10 +497,31 @@ def testPythonPackages(){
args: '-v pipcache_speedwagon:/.cache/pip'
]
],
glob: 'dist/*.whl',
stash: 'PYTHON_PACKAGES',
toxEnv: processorArchitecture=='arm' ? "py${pythonVersion.replace('.', '')}" : "py${pythonVersion.replace('.', '')}-PySide6",
retry: 3,
retries: 3,
testSetup: {
checkout scm
unstash 'PYTHON_PACKAGES'
},
testCommand: {
findFiles(glob: 'dist/*.whl').each{
sh(
label: 'Running Tox',
script: "tox --installpkg ${it.path} --workdir /tmp/tox -e py${pythonVersion.replace('.', '')}-PySide6"
)
}
},
post:[
cleanup: {
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
],
notFailBuild: true,
deleteDirs: true
)
},
]
)
}
}
Expand All @@ -460,62 +538,94 @@ def testPythonPackages(){
}
architectures.each{ processorArchitecture ->
macTests["Mac - ${processorArchitecture} - Python ${pythonVersion}: wheel"] = {
packages.testPkg2(
packages.testPkg(
agent: [
label: "mac && python${pythonVersion} && ${processorArchitecture}",
],
glob: 'dist/*.tar.gz,dist/*.zip',
stash: 'PYTHON_PACKAGES',
toxEnv: "py${pythonVersion.replace('.', '')}-PySide6",
toxExec: 'venv/bin/tox',
retries: 3,
testSetup: {
checkout scm
unstash 'PYTHON_PACKAGES'
sh(
label:'Install Tox',
script: '''python3 -m venv venv
venv/bin/pip install pip --upgrade
venv/bin/pip install -r requirements/requirements_tox.txt
'''
)
},
testTeardown: {
sh 'rm -r venv/'
testCommand: {
findFiles(glob: 'dist/*.whl').each{
sh(label: 'Running Tox',
script: """python${pythonVersion} -m venv venv
./venv/bin/python -m pip install --upgrade pip
./venv/bin/pip install -r requirements/requirements_tox.txt
./venv/bin/tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}-PySide6"""
)
}

},
retry: 3,
post:[
cleanup: {
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: '.tox/', type: 'INCLUDE'],
],
notFailBuild: true,
deleteDirs: true
)
},
]
)
}
macTests["Mac - ${processorArchitecture} - Python ${pythonVersion}: sdist"] = {
packages.testPkg2(
packages.testPkg(
agent: [
label: "mac && python${pythonVersion} && ${processorArchitecture}",
],
glob: 'dist/*.tar.gz,dist/*.zip',
stash: 'PYTHON_PACKAGES',
toxEnv: "py${pythonVersion.replace('.', '')}-PySide6",
toxExec: 'venv/bin/tox',
retries: 3,
testSetup: {
checkout scm
unstash 'PYTHON_PACKAGES'
sh(
label:'Install Tox',
script: '''python3 -m venv venv
venv/bin/pip install pip --upgrade
venv/bin/pip install -r requirements/requirements_tox.txt
'''
)
},
testTeardown: {
sh 'rm -r venv/'
testCommand: {
findFiles(glob: 'dist/*.tar.gz').each{
sh(label: 'Running Tox',
script: """python${pythonVersion} -m venv venv
./venv/bin/python -m pip install --upgrade pip
./venv/bin/pip install -r requirements/requirements_tox.txt
./venv/bin/tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}-PySide6"""
)
}

},
retry: 3,
post:[
cleanup: {
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: '.tox/', type: 'INCLUDE'],
],
notFailBuild: true,
deleteDirs: true
)
},
]
)
}
}
}
parallel(linuxTests + windowsTests + macTests)
}
}
def buildPackages(){
timeout(5){
withEnv(['PIP_NO_CACHE_DIR=off']) {
sh(label: 'Building Python Package',
script: '''python -m venv venv --upgrade-deps
venv/bin/pip install build
venv/bin/python -m build .
'''
)
}
}
}

def buildSphinx(){
def sphinx = load('ci/jenkins/scripts/sphinx.groovy')
Expand Down Expand Up @@ -872,16 +982,7 @@ pipeline {
}
}
steps{
timeout(5){
withEnv(['PIP_NO_CACHE_DIR=off']) {
sh(label: 'Building Python Package',
script: '''python -m venv venv --upgrade-deps
venv/bin/pip install build
venv/bin/python -m build .
'''
)
}
}
buildPackages()
}
post{
always{
Expand Down Expand Up @@ -1420,7 +1521,8 @@ pipeline {
script{
if (!env.TAG_NAME?.trim()){
checkout scm
docker.build('speedwagon:devpi','-f ./ci/docker/python/linux/jenkins/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL .').inside{
def dockerImage = docker.build('speedwagon:devpi','-f ./ci/docker/python/linux/jenkins/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL .')
dockerImage.inside{
load('ci/jenkins/scripts/devpi.groovy').pushPackageToIndex(
pkgName: props.name,
pkgVersion: props.version,
Expand All @@ -1430,6 +1532,7 @@ pipeline {
credentialsId: DEVPI_CONFIG.credentialsId,
)
}
sh script: "docker image rm --no-prune ${dockerImage.imageName()}"
}
}
}
Expand All @@ -1438,7 +1541,8 @@ pipeline {
node('linux && docker && x86 && devpi-access') {
script{
checkout scm
docker.build('speedwagon:devpi','-f ./ci/docker/python/linux/jenkins/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL .').inside{
def dockerImage = docker.build('speedwagon:devpi','-f ./ci/docker/python/linux/jenkins/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL .')
dockerImage.inside{
load('ci/jenkins/scripts/devpi.groovy').removePackage(
pkgName: props.name,
pkgVersion: props.version,
Expand All @@ -1448,6 +1552,7 @@ pipeline {

)
}
sh script: "docker image rm --no-prune ${dockerImage.imageName()}"
}
}
}
Expand Down
Loading

0 comments on commit dea13a4

Please sign in to comment.