Skip to content

Commit

Permalink
Pull request project-chip#11: Optimize build time with parrallel node
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from optimize_ci_build_time to silabs

Squashed commit of the following:

commit 7ec0d686f99aac591c24a7a1492cd9238979a758
Author: jepenven-silabs <jean-francois.penven@silabs.com>
Date:   Tue Jul 12 10:06:57 2022 -0400

    Optimize build time with parrallel node
  • Loading branch information
jepenven-silabs authored and jmartinez-silabs committed Aug 30, 2022
1 parent deccb45 commit a865870
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 4 deletions.
87 changes: 86 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,87 @@ def buildOpenThreadExamples()
}
}

def buildOpenThreadLight()
{
actionWithRetry {
node(buildFarmLabel)
{
def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
buildOverlayDir)
def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath
def saveDir = 'matter/'
dir(dirPath) {
withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root")
{
// CSA Examples build
withEnv(['PW_ENVIRONMENT_ROOT='+dirPath])
{
sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py lighting-app'
}
}
}
deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
workspaceTmpDir,
'matter/',
'-name "*.s37" -o -name "*.map"')
}
}
}

def buildOpenThreadLock()
{
actionWithRetry {
node(buildFarmLabel)
{
def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
buildOverlayDir)
def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath
def saveDir = 'matter/'
dir(dirPath) {
withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root")
{
// CSA Examples build
withEnv(['PW_ENVIRONMENT_ROOT='+dirPath])
{
sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py lock-app'
}
}
}
deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
workspaceTmpDir,
'matter/',
'-name "*.s37" -o -name "*.map"')
}
}
}

def buildOpenThreadSwitch()
{
actionWithRetry {
node(buildFarmLabel)
{
def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
buildOverlayDir)
def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath
def saveDir = 'matter/'
dir(dirPath) {
withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root")
{
// CSA Examples build
withEnv(['PW_ENVIRONMENT_ROOT='+dirPath])
{
sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py light-switch-app'
}
}
}
deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
workspaceTmpDir,
'matter/',
'-name "*.s37" -o -name "*.map"')
}
}
}

def buildSilabsCustomOpenThreadExamples()
{
actionWithRetry {
Expand Down Expand Up @@ -268,7 +349,11 @@ def pipeline()
def parallelNodes = [:]

// Docker container solution
parallelNodes['Build OpenThread Examples'] = { this.buildOpenThreadExamples() }
parallelNodes['Build OpenThread Lighting'] = { this.buildOpenThreadLight() }
parallelNodes['Build OpenThread Lock'] = { this.buildOpenThreadLock() }
parallelNodes['Build OpenThread Light switch'] = { this.buildOpenThreadSwitch() }


parallelNodes['Build Wifi Examples'] = { this.buildWiFiExamples() }
// TODO Fix ME
// parallelNodes['Build Custom Examples'] = { this.buildSilabsCustomOpenThreadExamples() }
Expand Down
14 changes: 11 additions & 3 deletions silabs_ci_scripts/build_openthread_csa_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@
import json
from pathlib import Path


if (len(sys.argv) > 1):
APPS = sys.argv
# Remove path to the scripts
APPS.pop(0)
else:
APPS = {"lighting-app", "lock-app", "light-switch-app"}

#Defines
APPS = {"lighting-app", "lock-app", "light-switch-app"}
BOARDS = {"BRD4161A", "BRD4186A"}
BUILDS = {"OpenThread"}
BUILD_TYPES = {("standard", ""), ("release", "\"chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false show_qr_code=false chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true\"")}
building_command = './scripts/examples/gn_efr32_example.sh ./examples/{app}/efr32 ./out/CSA/{app}{network} {board} {buildArguments}'

#Build everything
for build in BUILDS:
for app_name in APPS:
for app_name in APPS:
for build in BUILDS:
for board in BOARDS:
for build_type in BUILD_TYPES:

#Build all examples
c = building_command.format(app=app_name, network= "/" + build + "/" + build_type[0], board=board, buildArguments=build_type[1])
val = subprocess.check_call(c, shell= True)

0 comments on commit a865870

Please sign in to comment.