Changes in / [cbef27b:bd405fa]


Ignore:
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/FullBuild

    rcbef27b rbd405fa  
    2525                                )
    2626                        }
     27
     28                        //Push latest changes to do-lang repo
     29                        push_build()
    2730                }
    28 
    29                 promote_email(true)
    3031        }
    3132
     
    4243
    4344                //Send email to notify the failure
    44                 promote_email(false)
     45                promote_failure_email()
    4546        }
    4647
     
    9192}
    9293
     94def push_build() {
     95        //Don't use the build_stage function which outputs the compiler
     96        stage('Push') {
     97
     98                status_prefix = 'Push'
     99
     100                def out_dir = pwd tmp: true
     101                sh "mkdir -p ${out_dir}"
     102
     103                //checkout the code to make sure this is a valid git repo
     104                checkout scm
     105
     106                collect_git_info()
     107
     108                //parse git logs to find what changed
     109                sh "git remote > ${out_dir}/GIT_REMOTE"
     110                git_remote = readFile("${out_dir}/GIT_REMOTE")
     111                remoteDoLangExists = git_remote.contains("DoLang")
     112
     113                if( !remoteDoLangExists ) {
     114                        sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'
     115                }
     116
     117                //sh "GIT_SSH_COMMAND=\"ssh -v\" git push DoLang ${gitRefNewValue}:master"
     118                echo('BUILD NOT PUSH SINCE DO-LANG SERVER WAS DOWN')
     119        }
     120}
     121
    93122//Helper routine to collect information about the git history
    94123def collect_git_info() {
     
    112141
    113142//Email notification on a full build failure
    114 def promote_email(boolean success) {
     143def promote_failure_email() {
    115144        echo('notifying users')
    116 
    117         def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
    118145
    119146        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    120147        //Configurations for email format
    121         def email_subject = "[cforall git][${result}]"
    122         def email_body = """<p>This is an automated email from the Jenkins build machine. It was
    123 generated following the result of the C∀ nightly build.</p>
     148        def email_subject = "[cforall git][PROMOTE - FAILURE]"
     149        def email_body = """This is an automated email from the Jenkins build machine. It was
     150generated because of a git hooks/post-receive script following
     151a ref change was pushed to the repository containing
     152the project "UNNAMED PROJECT".
    124153
    125 <p>Check console output at ${env.BUILD_URL} to view the results.</p>
     154Check console output at ${env.BUILD_URL} to view the results.
    126155
    127 <p>- Status --------------------------------------------------------------</p>
     156- Status --------------------------------------------------------------
    128157
    129 <p>${result}</p>
    130 
    131 <p>- Performance --------------------------------------------------------------</p>
    132 
    133 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
     158PROMOTE FAILURE
    134159"""
    135160
     
    137162
    138163        //send email notification
    139         emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
     164        emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
    140165}
  • Jenkinsfile

    rcbef27b rbd405fa  
    11#!groovy
    2 
    3 import groovy.transform.Field
    42
    53//===========================================================================================================
     
    2422                wrap([$class: 'TimestamperBuildWrapper']) {
    2523
     24                        notify_server(0)
     25
    2626                        Settings = prepare_build()
    2727
     
    3434                                checkout()
    3535
     36                                notify_server(0)
     37
    3638                                build()
    3739
     
    4850                        BuildDir  = pwd tmp: true
    4951                        SrcDir    = pwd tmp: false
     52
     53                        notify_server(45)
    5054                }
    5155        }
     
    6872        finally {
    6973                //Send email with final results if this is not a full build
    70                 email(log_needed)
     74                if( Settings && !Settings.Silent ) {
     75                        email(log_needed, Settings.IsSandbox)
     76                }
    7177
    7278                echo 'Build Completed'
     
    110116                        //Also specify the compiler by hand
    111117                        targets=""
    112                         if( Settings.RunAllTests || Settings.RunBenchmark ) {
     118                        if( Settings.RunAllTests ) {
    113119                                targets="--with-target-hosts='host:debug,host:nodebug'"
    114120                        } else {
     
    147153                dir (BuildDir) {
    148154                        //Append bench results
    149                         sh "make --no-print-directory -C benchmark jenkins"
     155                        sh "${SrcDir}/benchmark/jenkins.sh ${Settings.GitNewRef} ${Settings.Architecture} ${BuildDir}/bench.json"
    150156                }
    151157        }
     
    171177
    172178                if( !Settings.Publish ) return
    173                 if( !Settings.RunBenchmark ) {
    174                         echo 'No results to publish!!!'
    175                         return
    176                 }
    177 
    178                 def groupCompile = new PlotGroup('Compilation', 'seconds', true)
    179                 def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false)
    180179
    181180                //Then publish the results
    182                 do_plot('compile'  , groupCompile    , 'Compilation')
    183                 do_plot('ctxswitch', groupConcurrency, 'Context Switching')
    184                 do_plot('mutex'    , groupConcurrency, 'Mutual Exclusion')
    185                 do_plot('signal'   , groupConcurrency, 'Internal and External Scheduling')
     181                sh 'curl --silent --show-error -H \'Content-Type: application/json\' --data @${BuildDir}/bench.json https://cforall.uwaterloo.ca:8082/jenkins/publish > /dev/null || true'
    186182        }
    187183}
     
    200196
    201197        return """
    202 <pre>
    203198The branch ${env.BRANCH_NAME} has been updated.
    204199${gitUpdate}
    205 </pre>
    206 
    207 <p>Check console output at ${env.BUILD_URL} to view the results.</p>
    208 
    209 <p>- Status --------------------------------------------------------------</p>
    210 
    211 <p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>
    212 
    213 <p>- Log -----------------------------------------------------------------</p>
    214 
    215 <pre>
     200
     201Check console output at ${env.BUILD_URL} to view the results.
     202
     203- Status --------------------------------------------------------------
     204
     205BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}
     206
     207- Log -----------------------------------------------------------------
    216208${gitLog}
    217 </pre>
    218 
    219 <p>-----------------------------------------------------------------------</p>
    220 <pre>
     209-----------------------------------------------------------------------
    221210Summary of changes:
    222211${gitDiff}
    223 </pre>
    224212"""
    225213}
    226214
    227215//Standard build email notification
    228 def email(boolean log) {
     216def email(boolean log, boolean bIsSandbox) {
    229217        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    230218        //Configurations for email format
     
    233221        def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    234222        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
    235         def email_body = """<p>This is an automated email from the Jenkins build machine. It was
     223        def email_body = """This is an automated email from the Jenkins build machine. It was
    236224generated because of a git hooks/post-receive script following
    237 a ref change which was pushed to the C∀ repository.</p>
     225a ref change which was pushed to the Cforall repository.
    238226""" + GitLogMessage()
    239227
    240         def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
    241 
    242         if( Settings && !Settings.Silent ) {
     228        def email_to = "cforall@lists.uwaterloo.ca"
     229
     230        if( Settings && !Settings.IsSandbox ) {
    243231                //send email notification
    244232                emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
     
    323311                }
    324312
    325                 this.IsSandbox          = (branch == "jenkins-sandbox")
    326313                this.RunAllTests        = param.RunAllTests
    327314                this.RunBenchmark       = param.RunBenchmark
     
    329316                this.Publish            = param.Publish
    330317                this.Silent             = param.Silent
     318                this.IsSandbox          = (branch == "jenkins-sandbox")
    331319
    332320                def full = param.RunAllTests ? " (Full)" : ""
     
    345333                this.GitNewRef = ''
    346334                this.GitOldRef = ''
    347         }
    348 }
    349 
    350 class PlotGroup implements Serializable {
    351         public String name
    352         public String unit
    353         public boolean log
    354 
    355         PlotGroup(String name, String unit, boolean log) {
    356                 this.name = name
    357                 this.unit = unit
    358                 this.log = log
    359335        }
    360336}
     
    422398}
    423399
     400def notify_server(int wait) {
     401        sh """curl --silent --show-error --data "wait=${wait}" -X POST https://cforall.uwaterloo.ca:8082/jenkins/notify > /dev/null || true"""
     402        return
     403}
     404
    424405def make_doc() {
    425406        def err = null
     
    436417        }
    437418}
    438 
    439 def do_plot(String file, PlotGroup group, String title) {
    440         echo "file is ${BuildDir}/benchmark/${file}.csv, group ${group}, title ${title}"
    441         dir("${BuildDir}/benchmark/") {
    442                 plot csvFileName: "cforall-${env.BRANCH_NAME}-${file}.csv",
    443                         csvSeries: [[
    444                                 file: "${file}.csv",
    445                                 exclusionValues: '',
    446                                 displayTableFlag: false,
    447                                 inclusionFlag: 'OFF',
    448                                 url: ''
    449                         ]],
    450                         group: "${group.name}",
    451                         title: "${title}",
    452                         style: 'lineSimple',
    453                         exclZero: false,
    454                         keepRecords: false,
    455                         logarithmic: group.log,
    456                         numBuilds: '120',
    457                         useDescr: true,
    458                         yaxis: group.unit,
    459                         yaxisMaximum: '',
    460                         yaxisMinimum: ''
    461         }
    462 }
  • benchmark/Makefile.am

    rcbef27b rbd405fa  
    6767
    6868.NOTPARALLEL:
    69 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv
    7069
    7170## =========================================================================================================
     
    9594## =========================================================================================================
    9695
    97 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
    98 
    9996jenkins$(EXEEXT):
     97        @echo "{"
     98        @echo -e '\t"githash": "'${githash}'",'
     99        @echo -e '\t"arch": "'   ${arch}   '",'
    100100@DOifskipcompile@
    101         @+make compile.csv
     101        @echo -e '\t"compile": {'
     102        @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :'
     103        @echo -e '\t\t"dummy" : {}'
     104        @echo -e '\t},'
    102105@DOendif@
    103         @+make ctxswitch.csv
    104         @+make mutex.csv
    105         @+make signal.csv
    106 @DOifskipcompile@
    107         @cat compile.csv
    108 @DOendif@
    109         @cat ctxswitch.csv
    110         @cat mutex.csv
    111         @cat signal.csv
    112 
    113 compile.csv:
    114         @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
    115         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
    116         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
    117         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
    118         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
    119         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
    120         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
    121         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
    122         @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
    123         @$(srcdir)/fixcsv.sh $@
    124 
    125 ctxswitch.csv:
    126         @echo "coroutine,thread" > $@
    127         @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    128         @+make ctxswitch-cfa_thread.runquiet >> $@
    129         @$(srcdir)/fixcsv.sh $@
    130 
    131 mutex.csv:
    132         @echo "1-monitor,2-monitor" > $@
    133         @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
    134         @+make mutex-cfa2.runquiet >> $@
    135         @$(srcdir)/fixcsv.sh $@
    136 
    137 signal.csv:
    138         @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
    139         @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
    140         @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
    141         @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
    142         @+make waitfor-cfa2.runquiet >> $@
    143         @$(srcdir)/fixcsv.sh $@
     106        @echo -e '\t"ctxswitch": {'
     107        @echo -en '\t\t"coroutine":'
     108        @+make ctxswitch-cfa_coroutine.runquiet
     109        @echo -en '\t\t,"thread":'
     110        @+make ctxswitch-cfa_thread.runquiet
     111        @echo -e '\t},'
     112        @echo -e '\t"mutex": ['
     113        @echo -en '\t\t'
     114        @+make mutex-cfa1.runquiet
     115        @echo -en '\t\t,'
     116        @+make mutex-cfa2.runquiet
     117        @echo -e '\t],'
     118        @echo -e '\t"scheduling": ['
     119        @echo -en '\t\t'
     120        @+make signal-cfa1.runquiet
     121        @echo -en '\t\t,'
     122        @+make signal-cfa2.runquiet
     123        @echo -en '\t\t,'
     124        @+make waitfor-cfa1.runquiet
     125        @echo -en '\t\t,'
     126        @+make waitfor-cfa2.runquiet
     127        @echo -e '\n\t],'
     128        @echo -e '\t"epoch": ' $(shell date +%s)
     129        @echo "}"
    144130
    145131## =========================================================================================================
  • benchmark/Makefile.in

    rcbef27b rbd405fa  
    401401PRINT_FORMAT = %20s: #Comments needed for spacing
    402402dummy_SOURCES = dummyC.c dummyCXX.cpp
    403 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
    404403CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \
    405404        tls-fetch_add.run ctxswitch-pthread.run \
     
    732731
    733732.NOTPARALLEL:
    734 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv
    735733
    736734all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
     
    758756
    759757jenkins$(EXEEXT):
     758        @echo "{"
     759        @echo -e '\t"githash": "'${githash}'",'
     760        @echo -e '\t"arch": "'   ${arch}   '",'
    760761@DOifskipcompile@
    761         @+make compile.csv
     762        @echo -e '\t"compile": {'
     763        @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :'
     764        @echo -e '\t\t"dummy" : {}'
     765        @echo -e '\t},'
    762766@DOendif@
    763         @+make ctxswitch.csv
    764         @+make mutex.csv
    765         @+make signal.csv
    766 @DOifskipcompile@
    767         @cat compile.csv
    768 @DOendif@
    769         @cat ctxswitch.csv
    770         @cat mutex.csv
    771         @cat signal.csv
    772 
    773 compile.csv:
    774         @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
    775         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
    776         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
    777         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
    778         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
    779         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
    780         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
    781         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
    782         @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
    783         @$(srcdir)/fixcsv.sh $@
    784 
    785 ctxswitch.csv:
    786         @echo "coroutine,thread" > $@
    787         @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    788         @+make ctxswitch-cfa_thread.runquiet >> $@
    789         @$(srcdir)/fixcsv.sh $@
    790 
    791 mutex.csv:
    792         @echo "1-monitor,2-monitor" > $@
    793         @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
    794         @+make mutex-cfa2.runquiet >> $@
    795         @$(srcdir)/fixcsv.sh $@
    796 
    797 signal.csv:
    798         @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
    799         @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
    800         @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
    801         @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
    802         @+make waitfor-cfa2.runquiet >> $@
    803         @$(srcdir)/fixcsv.sh $@
     767        @echo -e '\t"ctxswitch": {'
     768        @echo -en '\t\t"coroutine":'
     769        @+make ctxswitch-cfa_coroutine.runquiet
     770        @echo -en '\t\t,"thread":'
     771        @+make ctxswitch-cfa_thread.runquiet
     772        @echo -e '\t},'
     773        @echo -e '\t"mutex": ['
     774        @echo -en '\t\t'
     775        @+make mutex-cfa1.runquiet
     776        @echo -en '\t\t,'
     777        @+make mutex-cfa2.runquiet
     778        @echo -e '\t],'
     779        @echo -e '\t"scheduling": ['
     780        @echo -en '\t\t'
     781        @+make signal-cfa1.runquiet
     782        @echo -en '\t\t,'
     783        @+make signal-cfa2.runquiet
     784        @echo -en '\t\t,'
     785        @+make waitfor-cfa1.runquiet
     786        @echo -en '\t\t,'
     787        @+make waitfor-cfa2.runquiet
     788        @echo -e '\n\t],'
     789        @echo -e '\t"epoch": ' $(shell date +%s)
     790        @echo "}"
    804791
    805792loop$(EXEEXT):
  • tools/PrettyGitLogs.sh

    rcbef27b rbd405fa  
    2727git rev-list --format=short ${GitOldRef}...${GitNewRef} >  ${GIT_LOG}
    2828
    29 git diff --stat --color ${GitNewRef} ${GitOldRef} | sed -e 's/\[32m/<span style\=\"color\: \#00AA00\;\">/g' -e 's/\[31m/<span style\=\"color\: \#AA0000\;\">/g' -e 's/\[m/<\/span>/g' >  ${GIT_DIFF}
     29git diff --stat ${GitNewRef} ${GitOldRef} >  ${GIT_DIFF}
Note: See TracChangeset for help on using the changeset viewer.