Skip to content

Commit f23047c

Browse files
committed
ci: optimized performance using tmpfs
1 parent ca60a25 commit f23047c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

vars/runJenkinsPipeline.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def call(){
7070
filename 'ci/docker/python/linux/Dockerfile'
7171
label 'linux && docker && x86'
7272
additionalBuildArgs '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg PIP_CACHE_DIR=/.cache/pip'
73-
args '--mount source=python-jenkins-tmp-getmarcapi,target=/tmp'
73+
args '--mount source=python-jenkins-tmp-getmarcapi,target=/tmp --mount type=tmpfs,dst=/.config --tmpfs /tmp_data:exec -e UV_PROJECT_ENVIRONMENT=/tmp_data/.venv'
7474
}
7575
}
7676
environment{
@@ -406,11 +406,11 @@ def call(){
406406
image = docker.build(UUID.randomUUID().toString(), '-f ci/docker/python/linux/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg PIP_CACHE_DIR=/.cache/pip .')
407407
}
408408
try{
409-
image.inside('--mount source=python-jenkins-tmp-getmarcapi,target=/tmp'){
409+
image.inside('--mount source=python-jenkins-tmp-getmarcapi,target=/tmp --mount type=tmpfs,dst=/.local --tmpfs /tox_workdir:exec'){
410410
try{
411411
sh( label: 'Running Tox',
412412
script: """uv python install cpython-${version}
413-
uv run --frozen --only-group tox --with tox-uv tox run -e ${toxEnv} --runner uv-venv-lock-runner
413+
uv run --frozen --only-group tox --with tox-uv tox run -e ${toxEnv} --runner uv-venv-lock-runner --workdir /tox_workdir
414414
"""
415415
)
416416
} finally{
@@ -529,7 +529,7 @@ def call(){
529529
docker {
530530
image 'ghcr.io/astral-sh/uv:debian'
531531
label "linux && ${ARCHITECTURE} && docker"
532-
args '--mount source=python-tmp-getmarapi,target="/tmp"'
532+
args '--mount source=python-tmp-getmarapi,target="/tmp" --tmpfs /tox_workdir:exec -e UV_PROJECT_ENVIRONMENT=/tox_workdir/.venv'
533533
}
534534
}
535535
when{
@@ -542,7 +542,7 @@ def call(){
542542
def installpkg = findFiles(glob: 'dist/*.whl')[0].path
543543
sh(
544544
label: 'Testing with tox',
545-
script: "uv run --frozen --no-dev --only-group tox --with tox-uv tox --installpkg ${installpkg} -e py${PYTHON_VERSION.replace('.', '')}"
545+
script: "uv run --frozen --no-dev --only-group tox --with tox-uv tox --workdir /tox_workdir/tox --installpkg ${installpkg} -e py${PYTHON_VERSION.replace('.', '')}"
546546
)
547547
}
548548
}
@@ -553,7 +553,7 @@ def call(){
553553
filename 'ci/docker/python/linux/Dockerfile'
554554
label 'linux && docker && x86'
555555
additionalBuildArgs '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg PIP_CACHE_DIR=/.cache/pip'
556-
args '--mount source=python-jenkins-tmp-getmarcapi,target=/tmp'
556+
args '--mount source=python-jenkins-tmp-getmarcapi,target=/tmp --tmpfs /tox_workdir:exec -e UV_PROJECT_ENVIRONMENT=/tox_workdir/.venv'
557557
}
558558
}
559559
when{
@@ -566,7 +566,7 @@ def call(){
566566
def installpkg = findFiles(glob: 'dist/*.tar.gz')[0].path
567567
sh(
568568
label: 'Testing with tox',
569-
script: "uv run --only-group tox --with tox-uv --frozen tox --installpkg ${installpkg} -e py${PYTHON_VERSION.replace('.', '')}"
569+
script: "uv run --only-group tox --with tox-uv --frozen tox --workdir /tox_workdir/tox --installpkg ${installpkg} -e py${PYTHON_VERSION.replace('.', '')}"
570570
)
571571
}
572572
}

0 commit comments

Comments
 (0)