Skip to content

Commit

Permalink
Pull request project-chip#23: Build all examples in an optimized way
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from build_all_boards to silabs

Squashed commit of the following:

commit 1f36a7fe16ca44c5c169abcf49c99a2161c143d6
Author: jepenven-silabs <[email protected]>
Date:   Tue Jul 19 23:26:31 2022 -0400

    fix error

commit 560e3f8ca330fe7f75fddf7bb0cdb16211b3dda9
Author: jepenven-silabs <[email protected]>
Date:   Tue Jul 19 20:35:07 2022 -0400

    Build all examples in an optimized way
  • Loading branch information
jepenven-silabs authored and jmartinez-silabs committed Aug 30, 2022
1 parent 4d273b8 commit 4164b94
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 126 deletions.
155 changes: 39 additions & 116 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def bootstrapWorkspace()
}
}

def buildOpenThreadExamples()
def buildOpenThreadExample(String name, String board)
{
actionWithRetry {
node(buildFarmLabel)
Expand All @@ -113,7 +113,7 @@ def buildOpenThreadExamples()
// CSA Examples build
withEnv(['PW_ENVIRONMENT_ROOT='+dirPath])
{
sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py'
sh "python3 ./silabs_ci_scripts/build_openthread_csa_examples.py \"${name}\" \"${board}\""
}
}
}
Expand All @@ -125,115 +125,9 @@ 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/out/',
'-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/out/',
'-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/out/',
'-name "*.s37" -o -name "*.map"')
}
}
}

def buildOpenThreadWindow()
{
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 window-app'
}
}
}
deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(),
workspaceTmpDir,
'matter/',
'-name "*.s37" -o -name "*.map"')
}
}
}

def buildSilabsCustomOpenThreadExamples()
def buildSilabsCustomOpenThreadExamples(String board)
{
actionWithRetry {
node(buildFarmLabel)
Expand All @@ -248,7 +142,10 @@ def buildSilabsCustomOpenThreadExamples()
// Custom Silabs build
withEnv(['PW_ENVIRONMENT_ROOT='+dirPath])
{
sh 'python3 ./silabs_ci_scripts/build_custom_examples.py'
sh "echo ${board}"
sh "echo $board"
sh "echo \"${board}\""
sh "python3 ./silabs_ci_scripts/build_custom_examples.py \"${board}\""
}
}
}
Expand Down Expand Up @@ -285,7 +182,6 @@ def buildWiFiLighting()
'-name "*.s37" -o -name "*.map"')
}
}

}

def buildWiFiLock()
Expand Down Expand Up @@ -465,17 +361,44 @@ def pipeline()
def parallelNodes = [:]

// Docker container solution
parallelNodes['Build OpenThread Lighting'] = { this.buildOpenThreadLight() }
parallelNodes['Build OpenThread Lock'] = { this.buildOpenThreadLock() }
parallelNodes['Build OpenThread Light switch'] = { this.buildOpenThreadSwitch() }
parallelNodes['Build OpenThread Window'] = { this.buildOpenThreadWindow() }
parallelNodes['Build OpenThread Lighting BRD4161A'] = { this.buildOpenThreadExample("lighting-app", "BRD4161A") }
parallelNodes['Build OpenThread Lighting BRD4164A'] = { this.buildOpenThreadExample("lighting-app", "BRD4164A") }
parallelNodes['Build OpenThread Lighting BRD4166A'] = { this.buildOpenThreadExample("lighting-app", "BRD4166A") }
parallelNodes['Build OpenThread Lighting BRD4186A'] = { this.buildOpenThreadExample("lighting-app", "BRD4186A") }
parallelNodes['Build OpenThread Lighting BRD4187A'] = { this.buildOpenThreadExample("lighting-app", "BRD4187A") }
// Fix Me
//parallelNodes['Build OpenThread Lighting BRD4304A'] = { this.buildOpenThreadExample("lighting-app", "BRD4304A") }

parallelNodes['Build OpenThread Lock BRD4161A'] = { this.buildOpenThreadExample("lock-app", "BRD4161A") }
parallelNodes['Build OpenThread Lock BRD4164A'] = { this.buildOpenThreadExample("lock-app", "BRD4164A") }
parallelNodes['Build OpenThread Lock BRD4166A'] = { this.buildOpenThreadExample("lock-app", "BRD4166A") }
parallelNodes['Build OpenThread Lock BRD4186A'] = { this.buildOpenThreadExample("lock-app", "BRD4186A") }
parallelNodes['Build OpenThread Lock BRD4187A'] = { this.buildOpenThreadExample("lock-app", "BRD4187A") }
// parallelNodes['Build OpenThread Lock BRD4304A'] = { this.buildOpenThreadExample("lock-app", "BRD4304A") }

parallelNodes['Build OpenThread Light switch BRD4161A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4161A") }
parallelNodes['Build OpenThread Light switch BRD4164A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4164A") }
parallelNodes['Build OpenThread Light switch BRD4166A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4166A") }
parallelNodes['Build OpenThread Light switch BRD4186A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4186A") }
parallelNodes['Build OpenThread Light switch BRD4187A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4187A") }
// parallelNodes['Build OpenThread Light switch BRD4304A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4304A") }

parallelNodes['Build OpenThread Window BRD4161A'] = { this.buildOpenThreadExample("window-app", "BRD4161A") }
parallelNodes['Build OpenThread Window BRD4164A'] = { this.buildOpenThreadExample("window-app", "BRD4164A") }
parallelNodes['Build OpenThread Window BRD4166A'] = { this.buildOpenThreadExample("window-app", "BRD4166A") }
parallelNodes['Build OpenThread Window BRD4186A'] = { this.buildOpenThreadExample("window-app", "BRD4186A") }
parallelNodes['Build OpenThread Window BRD4187A'] = { this.buildOpenThreadExample("window-app", "BRD4187A") }
// parallelNodes['Build OpenThread Window BRD4304A'] = { this.buildOpenThreadExample("window-app", "BRD4304A") }



parallelNodes['Build Wifi Lighting'] = { this.buildWiFiLighting() }
parallelNodes['Build Wifi Lock'] = { this.buildWiFiLock() }

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

parallelNodes['Build Custom Examples'] = { this.buildSilabsCustomOpenThreadExamples() }
parallelNodes['Build Custom Examples BRD4161A'] = { this.buildSilabsCustomOpenThreadExamples("BRD4161A") }
parallelNodes['Build Custom Examples BRD4186A'] = { this.buildSilabsCustomOpenThreadExamples("BRD4186A") }

parallelNodes.failFast = false
parallel parallelNodes
Expand Down
11 changes: 9 additions & 2 deletions silabs_ci_scripts/build_custom_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
import glob
from pathlib import Path

if (len(sys.argv) > 1):
BOARDS = {sys.argv[1]}
else:
BOARDS = {"BRD4161A", "BRD4186A"}

print(BOARDS)

#Defines
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\"")}
BUILD_TYPES = {("standard", "")}
building_command = './scripts/examples/gn_efr32_example.sh ./silabs_examples/{app}/efr32 ./out/custom/{app}/{network} {board} {buildArguments}'

for examples in glob.glob("./silabs_examples/*"):
Expand Down
34 changes: 26 additions & 8 deletions silabs_ci_scripts/build_openthread_csa_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,36 @@
from pathlib import Path


#Defines
BUILDS = {"OpenThread"}
standard_build = ("standard", "")
release_build = ("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}'


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

#Defines
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}'
if (len(sys.argv) > 2):
BOARDS = {sys.argv[2]}
else:
BOARDS = {"BRD4161A", "BRD4186A"}

if (len(sys.argv) > 3):
if(sys.argv[3] == "standard"):
BUILD_TYPES = {standard_build}
elif(sys.argv[3] == "release"):
BUILD_TYPES = {release_build}
else:
BUILD_TYPES = {standard_build, release_build}


print(BUILD_TYPES)
print(BOARDS)
print(APPS)

#Build everything
for app_name in APPS:
Expand Down

0 comments on commit 4164b94

Please sign in to comment.