- added continuous integration using ipr jenkins

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3958]
This commit is contained in:
Guillaume Raffy 2024-11-18 16:42:12 +01:00
parent 0dd0195d45
commit 862a3911f0
4 changed files with 62 additions and 6 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ test/__pycache__/
iprbench/resources/__pycache__/
iprbench/resources/mamul1/__pycache__/
iprbench/resultsdb/__pycache__/
build/

55
ci/ipr.jenkins Normal file
View File

@ -0,0 +1,55 @@
// Jenkinsfile for jenkins.ipr.univ-rennes1.fr (Institut de Physique de Rennes)
pipeline {
agent {label 'alambix_agent'}
environment {
IPRBENCH_VENV_PATH = "${WORKSPACE}/iprbench.venv"
}
stages {
stage('setup') {
steps {
echo 'setting up itinv test environment'
sh """#!/bin/bash
python3 -m venv ${IPRBENCH_VENV_PATH} &&
source ${IPRBENCH_VENV_PATH}/bin/activate &&
pip install --upgrade pip &&
pip install --upgrade setuptools &&
pip install .
"""
}
}
stage('testing') {
steps {
sh """#!/bin/bash
set -o errexit
source ${IPRBENCH_VENV_PATH}/bin/activate &&
python -m unittest
"""
}
}
stage('releasing iprbench...') {
steps {
// see https://www.jenkins.io/doc/book/pipeline/jenkinsfile/
// graffy created the credential 4e327c3e-8b22-462b-8294-199402e22e7c from jenkin's interface in 2020. This credential is named maco-tester, stores a private ssh key that is allowed access to ssh maco@store.ipr.univ-rennes1.fr. This maco-tester credential belongs to global domain and Jenkins store.
withCredentials([sshUserPrivateKey(credentialsId: '4e327c3e-8b22-462b-8294-199402e22e7c', keyFileVariable: 'MACO_AT_STORE_KEY_FILE_PATH', passphraseVariable: '', usernameVariable: '')]) {
// MACO_AT_STORE_KEY_FILE_PATH stores the path of the public key file to access maco@store.ipr.univ-rennes1.fr
sh """
git archive -o fr.univ-rennes.ipr.iprbench.tar.gz HEAD &&
scp -i ${MACO_AT_STORE_KEY_FILE_PATH} fr.univ-rennes.ipr.iprbench.tar.gz maco@store.ipr.univ-rennes1.fr:/mnt/store.ipr/InstallProgs/ipr/ipr-packages
"""
}
}
}
}
post
{
// always, success, failure, unstable, changed
failure
{
mail bcc: '', body: "<b>Example</b><br>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br>Build URL: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "CI build failed for ${env.JOB_NAME}", to: "guillaume.raffy@univ-rennes1.fr";
}
cleanup {
cleanWs()
}
}
}

View File

@ -1,4 +1,4 @@
__version__ = '0.0.1'
__version__ = '0.0.2'
from .core import BenchmarkId, IBenchmark, ResultsDbFactory
from .benchmarks.hibench import HiBench

View File

@ -13,10 +13,10 @@ dependencies = [
"pandas",
"matplotlib",
"sqlalchemy",
"cocluto >= 1.6",
# "cocluto@git+https://git.ipr.univ-rennes.fr/cellinfo/cocluto"
"starbench >= 1.0.1"
# "starbench@git+https://github.com/g-raffy/starbench"
# "cocluto >= 1.7",
"cocluto@git+https://git.ipr.univ-rennes.fr/cellinfo/cocluto@v1.7.0",
# "starbench >= 1.0.1"
"starbench@git+https://github.com/g-raffy/starbench@v1.0.2",
]
requires-python = ">= 3.8"
authors = [
@ -32,7 +32,7 @@ showresults = "iprbench.benchmarks.showresults:main"
Repository = "https://github.com/g-raffy/starbench"
[tool.setuptools]
packages = ["iprbench", "iprbench.benchmarks"]
packages = ["iprbench", "iprbench.benchmarks", "iprbench.resultsdb"]
[tool.setuptools.dynamic]
version = {attr = "iprbench.main.__version__"}