fetched mlz version

- before some chamges in the gerrit pipline

Change-Id: I33eb2d75f83345a7039d0fb709e66defefb1c3e0
This commit is contained in:
2023-05-02 11:31:30 +02:00
parent b19a8c2e5c
commit da15df076a
765 changed files with 35890 additions and 59302 deletions

View File

@ -1,4 +1,4 @@
FROM python:3-buster AS base
FROM python:3.9 AS base
ARG PYVER=python3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
@ -11,7 +11,7 @@ RUN apt-get update && \
locales \
python3 \
python3-dev \
python3-pytango \
python3-tango \
python3-venv python3-setuptools \
virtualenv
@ -33,14 +33,15 @@ RUN virtualenv /home/jenkins/tools2 && \
rm -rf /home/jenkins/tools2src
RUN virtualenv -p /usr/bin/python3 --system-site-packages /home/jenkins/secopvenv && \
git clone https://forge.frm2.tum.de/review/sine2020/secop/playground /home/jenkins/playground && \
git clone https://forge.frm2.tum.de/review/secop/frappy /home/jenkins/frappy && \
. /home/jenkins/secopvenv/bin/activate && \
pip install -U pip wheel setuptools && \
pip install -r /home/jenkins/playground/requirements-dev.txt -r /home/jenkins/playground/requirements.txt pylint pytest && \
rm -rf /home/jenkins/playground
pip install -r /home/jenkins/frappy/requirements-dev.txt -r /home/jenkins/frappy/requirements.txt pylint pytest && \
rm -rf /home/jenkins/frappy
FROM base AS docs
ARG PYVER=python3
ENV DEBIAN_FRONTEND=noninteractive
USER root
@ -50,6 +51,8 @@ RUN apt-get update && \
texlive-latex-base \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-fonts-extra \
tex-gyre \
texlive-base \
texlive-binaries \
latexmk

53
ci/Jenkinsfile vendored
View File

@ -4,7 +4,7 @@ properties([
daysToKeepStr: '',
numToKeepStr: '50')),
parameters([
string(defaultValue: 'sine2020/secop/playground',
string(defaultValue: 'secop/frappy',
description: '', name: 'GERRIT_PROJECT'),
string(defaultValue: 'master',
description: '', name: 'GERRIT_BRANCH'),
@ -13,11 +13,6 @@ properties([
choice(choices: '''\
patchset-created
ref-updated
change-merged''',
description: '', name: 'GERRIT_EVENT'),
choice(choices: '''\
patchset-created
ref-updated
change-merged''',
description: '', name: 'GERRIT_EVENT_TYPE')])
])
@ -30,8 +25,6 @@ def changedFiles = '';
def run_pylint(pyver) {
stage ('pylint-' + pyver) {
def cpylint = "RUNNING"
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
def status = 'OK'
changedFiles = sh returnStdout: true, script: '''\
#!/bin/bash
@ -45,14 +38,14 @@ git diff HEAD~1... --name-only --diff-filter=ARCM -- \\*.py
pip install -r requirements-dev.txt
pip install -r requirements.txt
pip install isort pylint
python3 setup.py develop
pip install -e .
export PYTHONIOENCODING=utf8
echo "$changedFiles"
if [[ -n "$changedFiles" ]]; then
set -o pipefail
pylint $changedFiles | tee pylint_results.txt
isort -df $changedFiles | tee isort_results.txt
isort --df $changedFiles || true | tee isort_results.txt
fi
"""
withCredentials([string(credentialsId: 'GERRITHTTP',
@ -69,16 +62,11 @@ fi
} // credentials
echo "pylint result: $res"
this.verifyresult.put('pylint'+pyver, 1)
cpylint = "SUCCESSFUL"
if ( res != 0 ) {
currentBuild.result='FAILURE'
this.verifyresult.put('pylint'+ pyver, -1)
status = 'FAILURE'
cpylint = "FAILED"
}
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
archiveArtifacts([allowEmptyArchive: true,
artifacts: 'pylint-*.txt'])
recordIssues([enabledForFailure: true,
@ -89,23 +77,17 @@ fi
failedTotalAll: 1])
if (status == 'FAILURE') {
throw new Exception('Failure in pylint with ' + pyver)
}
}
} // run_pylint
def run_tests(pyver) {
stage('Test:' + pyver) {
def cpytest = "RUNNING"
gerritPostCheck(["jenkins:pytest_${pyver}":"RUNNING"])
writeFile file: 'setup.cfg', text: '''
[tool:pytest]
addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
def status = "OK"
verifyresult.put(pyver, 0)
try {
timeout(5) {
sh '''\
@ -113,37 +95,27 @@ addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
. /home/jenkins/secopvenv/bin/activate
pip install -r requirements-dev.txt
pip install -r requirements.txt
python3 setup.py develop
pip install -e .
make test
'''
verifyresult.put(pyver, 1)
cpytest = "SUCCESSFUL"
}
} catch (all) {
currentBuild.result = 'FAILURE'
status = 'FAILURE'
cpytest= "FAILED"
verifyresult.put(pyver, -1)
}
gerritPostCheck(["jenkins:pytest_${pyver}":cpytest])
step([$class: 'JUnitResultArchiver', allowEmptyResults: true,
keepLongStdio: true, testResults: 'pytest.xml'])
if (status == 'FAILURE') {
throw new Exception('Failure in test with ' + pyver)
}
}
}
def run_docs() {
def cdocs = "RUNNING"
gerritPostCheck(["jenkins:docs":cdocs])
stage('prepare') {
sh '''
. /home/jenkins/secopvenv/bin/activate
pip install -r requirements-dev.txt
pip install -r requirements.txt
python3 setup.py develop
pip install -e .
'''
}
@ -185,9 +157,7 @@ def run_docs() {
stage('store html doc for build') {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'doc/_build/html', reportFiles: 'index.html', reportName: 'Built documentation', reportTitles: ''])
cdocs = "SUCCESSFUL"
}
gerritPostCheck(["jenkins:docs":cdocs])
}
@ -219,16 +189,16 @@ node("dockerhost") {
sh '''#!/bin/bash
git worktree add tmpmaster origin/master
cd tmpmaster
docker build --target base --tag secop_base:latest ci
docker build --target docs --tag secop_docs:latest ci
docker build --target base --tag frappy_base:latest ci
docker build --target docs --tag frappy_docs:latest ci
cd ..
rm -rf tmpmaster
'''
}
stage('execute tests') {
def img = docker.image('secop_base:latest')
def docimg = docker.image('secop_docs:latest')
def img = docker.image('frappy_base:latest')
def docimg = docker.image('frappy_docs:latest')
parallel 'Test': {
img.inside {
@ -246,9 +216,10 @@ node("dockerhost") {
if (GERRIT_EVENT_TYPE == 'change-merged')
{
sh '''
rsync -rlv doc/_build/* /ictrlsrv/share/public/doc/secop
rsync -rlv doc/_build/* /ictrlsrv/share/public/doc/frappy
'''
}
}}
}}, failFast: false
}
setGerritReview()
}

View File

@ -10,10 +10,10 @@ The Dockerfile defines two images:
To create the images:
docker build --target <base|docs> --tag secop_<base|docs>:latest .
docker build --target <base|docs> --tag frappy_<base|docs>:latest .
To test images interactivly:
docker run -u jenkins -i -t secop<base|docs> /bin/bash
docker run -u jenkins -i -t frappy<base|docs> /bin/bash
The Jenkinsfile uses this Dockerfile (only approved checked-in versions from master)
to build the images (a rebuild will only happen if the Dockerfile is changed as docker