Skip to content

Commit

Permalink
Pull request #129: Decrease build time by parallelizing all build steps
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from feature/parallel_build to silabs

Squashed commit of the following:

commit 64b15e70b5f2bf3fd769aa34855f4f93a5062e79
Author: Jakob Olesen <[email protected]>
Date:   Wed Sep 28 14:51:45 2022 +0200

    Decrease build time by parallelizing all build steps
  • Loading branch information
jsloth authored and jmartinez-silabs committed Oct 7, 2022
1 parent e0a851a commit ceb5538
Showing 1 changed file with 47 additions and 69 deletions.
116 changes: 47 additions & 69 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def initWorkspaceAndScm()
dir('third_party/silabs/matter_support/matter/efr32'){
stash name: 'BootLoader', includes: 'bootloader_binaries/*.*'
}

sh 'du -sk'

}

dir(buildOverlayDir+'/matter-scripts'){
Expand Down Expand Up @@ -191,9 +189,9 @@ def buildSilabsCustomOpenThreadExamples(app, board)
}
}
}
stash name: 'CustomOpenThreadExamples', includes: 'out/**/*.s37 '
stash name: 'CustomOpenThreadExamples', includes: 'out/**/*.s37 '


}
deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
workspaceTmpDir,
Expand Down Expand Up @@ -305,7 +303,7 @@ def exportIoTReports()

sh "echo ${env.BUILD_NUMBER}"

// This set of Applications to track code size was
// This set of Applications to track code size was
// approved by Rob Alexander on September 7 2022
// Light --> MG24 (BRD4187C)
// Lock ---> MG24 (BRD4187C) (Thread and RS9116)
Expand All @@ -317,7 +315,7 @@ def exportIoTReports()
def appVersion = ["standard", "release"]

// Generate report for MG24 (BRD4187C) apps
openThreadMG24Apps.each { app ->
openThreadMG24Apps.each { app ->
appVersion.each { version ->
sh """unset OTEL_EXPORTER_OTLP_ENDPOINT
code_size_analyzer_cli \
Expand Down Expand Up @@ -358,7 +356,7 @@ def exportIoTReports()
}

// Generate report for WiFi implementation MG24 BRD4186C + RS9116
wifiSizeTrackingApp.each { app ->
wifiSizeTrackingApp.each { app ->
sh """unset OTEL_EXPORTER_OTLP_ENDPOINT
code_size_analyzer_cli \
--map_file out/${app}_wifi_rs911x/BRD4186C/*.map \
Expand Down Expand Up @@ -423,10 +421,10 @@ def openThreadTestSuite(devicegoup, name, board)
git pull
'''
}
catchError(buildResult: 'UNSTABLE',
catchInterruptions: false,
message: "[ERROR] One or more openthread tests have failed",

catchError(buildResult: 'UNSTABLE',
catchInterruptions: false,
message: "[ERROR] One or more openthread tests have failed",
stageResult: 'UNSTABLE')
{
dir('matter')
Expand All @@ -437,15 +435,15 @@ def openThreadTestSuite(devicegoup, name, board)
unstash stashFolder
unstash 'ChipTool'
unstash 'BootLoader'

bootloaderPath=pwd()+'/bootloader_binaries'
echo 'bootloaderPath: '+bootloaderPath

sh '''
pwd && ls -R
chiptoolPath=`find $PWD -name "chip-tool" -print `
echo chiptoolPath
'''
// unstash 'CustomOpenThreadExamples'

Expand Down Expand Up @@ -582,9 +580,9 @@ def utfThreadTestSuite(devicegoup,testbed_name,app_name, matter_type , board, te
'DEBUG=true'
])
{
catchError(buildResult: 'UNSTABLE',
catchInterruptions: false,
message: "[ERROR] One or more tests have failed",
catchError(buildResult: 'UNSTABLE',
catchInterruptions: false,
message: "[ERROR] One or more tests have failed",
stageResult: 'UNSTABLE')
{
sh """
Expand Down Expand Up @@ -654,7 +652,7 @@ def utfWiFiTestSuite(devicegoup, testbed_name, app_name, matter_type, board, wif
chiptoolPath=`find $PWD -name "chip-tool" -print `
echo $chiptoolPath
'''

sh "cp out/${app_name}_wifi_${wifi_module}/${board}/*.s37 ../manifest"

}
Expand Down Expand Up @@ -691,9 +689,9 @@ def utfWiFiTestSuite(devicegoup, testbed_name, app_name, matter_type, board, wif
'DEBUG=true'
])
{
catchError(buildResult: 'UNSTABLE',
catchInterruptions: false,
message: "[ERROR] One or more tests have failed",
catchError(buildResult: 'UNSTABLE',
catchInterruptions: false,
message: "[ERROR] One or more tests have failed",
stageResult: 'UNSTABLE')
{
// pytestParam="\"pytest --tb=native tests${test_suite} --manifest manifest${manifestyaml}.yaml ${testsequenceyaml}\""
Expand Down Expand Up @@ -722,7 +720,7 @@ def pushToNexus()
buildOverlayDir)
def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath
def saveDir = 'matter/'

dir(dirPath) {
try{
withCredentials([usernamePassword(credentialsId: 'svc_gsdk', passwordVariable: 'SL_PASSWORD', usernameVariable: 'SL_USERNAME')])
Expand Down Expand Up @@ -750,7 +748,7 @@ def pushToNexus()
'''
}
} catch (e)
} catch (e)
{
deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
workspaceTmpDir,
Expand All @@ -759,9 +757,9 @@ def pushToNexus()
throw e
}
}

deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), workspaceTmpDir, 'matter/')

}
}
}
Expand All @@ -780,16 +778,19 @@ def pipeline()
sh 'sudo exportfs -af'
}
}

stage('Build OpenThread Examples')
def parallelNodesBuild = [:]
stage("Build")
{
advanceStageMarker()

//---------------------------------------------------------------------
// Build OpenThread Examples
//---------------------------------------------------------------------
// build library dependencies
def parallelNodes = [:]
def openThreadBoards = [:]

// Build only for release candidate branch
if (env.BRANCH_NAME.startsWith('RC_')) {
if (env.BRANCH_NAME.startsWith('RC_')) {
openThreadBoards = ["BRD4161A", "BRD4162A", "BRD4163A", "BRD4164A", "BRD4166A", "BRD4186C", "BRD4187C", "BRD2703A"]
} else {
openThreadBoards = ["BRD4161A", "BRD4166A", "BRD4187C", "BRD2703A" ]
Expand All @@ -798,24 +799,18 @@ def pipeline()

openThreadApps.each { appName ->
openThreadBoards.each { board ->
parallelNodes[appName + " " + board] = { this.buildOpenThreadExample(appName, board) }
parallelNodesBuild["OpenThread " + appName + " " + board] = { this.buildOpenThreadExample(appName, board) }

}
}


parallelNodes.failFast = false
parallel parallelNodes
}

stage("Build WiFi Examples")
{
advanceStageMarker()
def parallelNodes = [:]
//---------------------------------------------------------------------
// Build WiFi Examples
//---------------------------------------------------------------------
def wifiBoards = [:]

// Build only for release candidate branch
if (env.BRANCH_NAME.startsWith('RC_')) {
if (env.BRANCH_NAME.startsWith('RC_')) {
wifiBoards = ["BRD4161A", "BRD4186C", "BRD4187C"]
} else {
wifiBoards = ["BRD4161A", "BRD4186C"]
Expand All @@ -825,28 +820,19 @@ def pipeline()

//TODO FIX ME Enable WF200 once silabs branch is updated with CSA for MG24 and WF200 support
def wifiRCP = ["rs911x"]
// def wifiRCP = ["rs911x", "wf200"]
// def wifiRCP = ["rs911x", "wf200"]

wifiApps.each { appName ->
wifiBoards.each { board ->
wifiRCP.each { rcp ->
parallelNodes[appName + " " + board + " " + rcp] = { this.buildWiFiExample(appName, board, rcp) }
parallelNodesBuild["WiFi " + appName + " " + board + " " + rcp] = { this.buildWiFiExample(appName, board, rcp) }
}
}
}

parallelNodes.failFast = false
parallel parallelNodes

}



stage("Build Custom examples")
{
advanceStageMarker()

def parallelNodes = [:]
//---------------------------------------------------------------------
// Build Custom examples
//---------------------------------------------------------------------
def boardsForCustom = [:]
def silabsExamples = ["onoff-plug-app", "sl-newLight", "template"]

Expand All @@ -858,25 +844,17 @@ def pipeline()

silabsExamples.each { example ->
boardsForCustom.each { board ->
parallelNodes[example + " " + board] = { this.buildSilabsCustomOpenThreadExamples(example, board) }
parallelNodesBuild["Custom " + example + " " + board] = { this.buildSilabsCustomOpenThreadExamples(example, board) }
}
}

parallelNodes.failFast = false
parallel parallelNodes
}

stage("Build Tooling")
{
advanceStageMarker()
// build library dependencies
def parallelNodes = [:]


parallelNodes['Build Chip-tool '] = { this.buildChipTool() }
//---------------------------------------------------------------------
// Build Tooling
//---------------------------------------------------------------------
parallelNodesBuild['Build Chip-tool '] = { this.buildChipTool() }

parallelNodes.failFast = false
parallel parallelNodes
parallelNodesBuild.failFast = false
parallel parallelNodesBuild

}

Expand Down

0 comments on commit ceb5538

Please sign in to comment.