Skip to content
Snippets Groups Projects
Commit 541dcb23 authored by Philipp Spilger's avatar Philipp Spilger
Browse files

Remove content of Jenkinsfiles in favor of ppu-toolchain

* Jenkinsfile for the whole toolchain consisting of libnux,
  binutils, gcc, newlib and libstdc++ is now found in the repo
  'oppulance'

Change-Id: I1ff8a4c3f2b4879757520e63d9346b647be7a191
parent 1c1592ad
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env groovy
# This Jenkinsfile has been superseeded by the ppu-toolchain Jenkinsfile found in the
# repository 'oppulance'.
#!/usr/bin/env groovy
node {
// Default to false to ensure failure messages are sent
GERRIT_BUILD = false
try {
cleanWs()
stage('checkout') {
dir('libnux') {
checkout scm // for CI files
}
try {
run_with_modules("waf setup " +
"--project libnux " +
"--project hicann-dls-scripts " +
"--clone-depth 1 " +
"--gerrit-changes=${GERRIT_CHANGE_NUMBER} " +
"--gerrit-url=ssh://hudson@$GERRIT_HOST:$GERRIT_PORT" as String)
GERRIT_BUILD = true
} catch (MissingPropertyException ignored) { // Jenkinsfile not called via Gerrit
run_with_modules("waf setup " +
"--project libnux " +
"--project hicann-dls-scripts " +
"--clone-depth 1 " as String)
}
}
stage("Build") {
srun_jenkins("waf configure install --dls-version=2 --enable-stack-protector --enable-stack-redzone --test-execnone --test-timeout=240")
}
stage("Hardware Tests") {
run_ppu_tests("B291656")
}
} catch (Exception e) {
post_error_build_action()
throw e as java.lang.Throwable
} finally {
post_all_build_action()
}
// Some Jenkins steps fail a build without raising (e.g. archiveArtifacts)
if (currentBuild.currentResult != "SUCCESS") {
post_error_build_action()
}
}
/*
/* HELPER FUNCTIONS
*/
void run_with_modules(String command) {
sh "module purge && " +
"module load spack_visionary-defaults/autobuild && " +
"module load waf && " +
"module load gcc-nux && " +
"module load frickel-dls/current && ${command}"
}
void srun_jenkins(String command) {
run_with_modules("srun -p jenkins -c 8 --mem 15G ${command}" as String)
}
void run_with_board_allocation(String board_id, String command) {
run_with_modules("echo \"${command}\" | salloc -p dls --gres=${board_id}" as String)
}
void run_ppu_tests(String board_id) {
run_with_board_allocation(board_id, "srun waf install -j1 --test-execall")
}
void post_all_build_action() {
// Scan for compiler warnings
warnings canComputeNew: false,
canRunOnFailed: true,
categoriesPattern: '',
consoleParsers: [[parserName: 'GNU C Compiler 4 (gcc)']],
defaultEncoding: '',
excludePattern: '',
healthy: '',
includePattern: '',
messagesPattern: '',
unHealthy: '',
unstableTotalAll: '0',
unstableTotalHigh: '0',
unstableTotalLow: '0',
unstableTotalNormal: '0'
// Evaluate test results
step([$class : 'XUnitBuilder',
thresholdMode: 1,
thresholds : [[$class : 'FailedThreshold',
unstableThreshold: '0'],
],
tools : [[$class : 'GoogleTestType',
deleteOutputFiles : true,
failIfNotNew : true,
pattern : "build/test_results/**/*.xml",
skipNoTestFiles : false,
stopProcessingIfError: true]
]
])
// Always clean the workspace
cleanWs()
}
void post_error_build_action() {
if (!GERRIT_BUILD) {
mattermostSend(channel: "#dls-software",
text: "@channel Jenkins build `${env.JOB_NAME}` has failed!",
message: "${env.BUILD_URL}",
endpoint: "https://chat.bioai.eu/hooks/qrn4j3tx8jfe3dio6esut65tpr")
}
}
#!/usr/bin/env groovy
node {
// Default to false to ensure failure messages are sent
GERRIT_BUILD = false
try {
cleanWs()
stage('checkout') {
dir('libnux') {
checkout scm // for CI files
}
try {
run_with_modules("waf setup " +
"--project libnux " +
"--project hicann-dls-scripts@v3testing " +
"--clone-depth 1 " +
"--gerrit-changes=${GERRIT_CHANGE_NUMBER} " +
"--gerrit-url=ssh://hudson@$GERRIT_HOST:$GERRIT_PORT" as String)
GERRIT_BUILD = true
} catch (MissingPropertyException ignored) { // Jenkinsfile not called via Gerrit
run_with_modules("waf setup " +
"--project libnux " +
"--project hicann-dls-scripts@v3testing " +
"--clone-depth 1 " as String)
}
}
stage("Build") {
srun_jenkins("waf configure install --dls-version=3 --enable-stack-protector --enable-stack-redzone --test-execnone --test-timeout=240")
}
withEnv([
'HW_TESTBOARD_ID=B291673',
'HW_TESTBOARD_SOCKET=3', // Switchable socket the setup is plugged into
'LD_LIBRARY_PATH+WHATEVER=./lib', // Add libs to LD_LIBRARY_PATH
'PYTHONPATH+WHATEVER=./lib']) { // Add libs to PYTHONPATH
stage("Hardware Tests") {
run_ppu_tests()
}
}
} catch (Exception e) {
post_error_build_action()
throw e as java.lang.Throwable
} finally {
post_all_build_action()
}
// Some Jenkins steps fail a build without raising (e.g. archiveArtifacts)
if (currentBuild.currentResult != "SUCCESS") {
post_error_build_action()
}
}
/*
/* HELPER FUNCTIONS
*/
void run_with_modules(String command) {
sh "module purge && " +
"module load spack_visionary-defaults/autobuild && " +
"module load waf && " +
"module load xilinx/143 && " +
"module load gcc-nux && " +
"module load frickel-dls_v3testing/current && ${command}"
}
void srun_jenkins(String command) {
run_with_modules("srun -p jenkins -c 8 --mem 15G ${command}" as String)
}
void run_with_board_allocation(String command) {
run_with_modules("echo \"${command}\" | salloc -p dls --gres=${HW_TESTBOARD_ID}" as String)
}
static String powercycle_fpga_command(String ip, int socket_number) {
return "curl 'http://${ip}/login.html' --data 'pw=spikey' && " + // login
"curl 'http://${ip}/' --data 'cte${socket_number}=0' && " + // disable socket
"sleep 5 && " + // wait
"curl 'http://${ip}/' --data 'cte${socket_number}=1' && " + // enable socket
"curl 'http://${ip}/login.html' && " + // logout
"sleep 5" // FPGA powerup
}
void run_ppu_tests() {
run_with_board_allocation(
powercycle_fpga_command("129.206.176.148", "${HW_TESTBOARD_SOCKET}" as int) \
+ " && " \
+ "srun python ./hicann-dls-scripts/helper/pll_init.py" \
+ " && " \
+ "srun waf install -j1 --test-execall")
}
void post_all_build_action() {
// Scan for compiler warnings
warnings canComputeNew: false,
canRunOnFailed: true,
categoriesPattern: '',
consoleParsers: [[parserName: 'GNU C Compiler 4 (gcc)']],
defaultEncoding: '',
excludePattern: '',
healthy: '',
includePattern: '',
messagesPattern: '',
unHealthy: '',
unstableTotalAll: '0',
unstableTotalHigh: '0',
unstableTotalLow: '0',
unstableTotalNormal: '0'
// Evaluate test results
step([$class : 'XUnitBuilder',
thresholdMode: 1,
thresholds : [[$class : 'FailedThreshold',
unstableThreshold: '0'],
],
tools : [[$class : 'GoogleTestType',
deleteOutputFiles : true,
failIfNotNew : true,
pattern : "build/test_results/**/*.xml",
skipNoTestFiles : false,
stopProcessingIfError: true]
]
])
// Always clean the workspace
cleanWs()
}
void post_error_build_action() {
if (!GERRIT_BUILD) {
mattermostSend(channel: "#dls-software",
text: "@channel Jenkins build `${env.JOB_NAME}` has failed!",
message: "${env.BUILD_URL}",
endpoint: "https://chat.bioai.eu/hooks/qrn4j3tx8jfe3dio6esut65tpr")
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment