-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Marvell] Build infrastructure enhancements #18143
Conversation
@Pavan-Nokia please review. |
90b6ff5
to
2174f65
Compare
@@ -49,7 +49,11 @@ jobs: | |||
sudo modprobe overlay | |||
sudo apt-get install -y acl | |||
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" | |||
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure | |||
if [ ${PLATFORM_AZP} == marvell-arm64 ] || [ ${PLATFORM_AZP} == marvell-armhf ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the if-checks here, can the top-level pipeline build files be updated to point to marvell
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saiarcot895 If we look at the changes in the build commands, only configure command is different in "PLATFORM=marvell" string. Other commands are same. So I opted this change.
If we change name in top-level pipeline( ex: name: marvell-armhf) we need to change or checks multiple places such as how the build pipelines are fetched in "Azure.sonic-buildimage.official.marvell-armhf?branchName=master&label=Marvell-armhf" or while running a make command(make target/sonic-marvell-armhf.bin) for build. I thought this is less change, and does not break other arm64 platform builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, @xumia, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about define a new parameter in azure-pipelines-build.yml for marvell-armhf and marvell-amd64.
PLATFORM_ARCH: arm64 |
For example:
PLATFORM: marvell
If the variable PLATFORM is not defined (empty), then use PLATFORM_AZP
[ -z "$PLATFORM" ] && PLATFORM=$(PLATFORM_AZP)
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$PLATFORM PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
// There is a little different $PLATFORM and $(PLATFORM), be careful.
Any other platforms have the similar requirements, only need to override the variable, no logic change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xumia Have pushed the changes as recommended by you. Please review.
2174f65
to
7f454a7
Compare
.azure-pipelines/build-template.yml
Outdated
if [ ${{ parameters.platform }} == marvell-arm64 ] || [ ${{ parameters.platform }} == marvell-armhf ]; then | ||
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=marvell PLATFORM_ARCH=${{ parameters.platform_arch }} | ||
else | ||
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} PLATFORM_ARCH=${{ parameters.platform_arch }} | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file has been deprecated, and it is no use. The change can be skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Reverting this change.
6d0f3b5
to
56d0df8
Compare
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Pull request contains merge conflicts. |
Hi @pavannaregundi , can you trigger a new build by typing |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -49,7 +49,8 @@ jobs: | |||
sudo modprobe overlay | |||
sudo apt-get install -y acl | |||
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" | |||
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure | |||
[ -z "$PLATFORM" ] && PLATFORM=$(PLATFORM_AZP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? When PLATFORM is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liushilongbuaa This is a new optional variable introduced in 'azure-pipelines-build.yml' to select the platform if it is different from default PLATFORM_AZP. Basically, pick platform name from PLATFORM_AZP when PLATFORM variable is not set.
Details of this change are already present in comments above.
@@ -781,7 +781,7 @@ if [[ $TARGET_BOOTLOADER == uboot ]]; then | |||
## Overwriting the initrd image with uInitrd | |||
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE | |||
else | |||
sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit.its $FILESYSTEM_ROOT/boot/ | |||
sudo cp -v $PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic_fit.its $FILESYSTEM_ROOT/boot/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
centec-arm64 is also impacted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But $CONFIGURED_PLATFORM for "centec-arm64" is "centec-arm64". So change will work.
can you trigger a new build by typing /azpw run Azure.sonic-buildimage in comments again? |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Can you debug locally to fix sonic-config-engine UT? |
Hi @neethajohn , can you help on the UT? |
@liushilongbuaa We will try looking at this. However, someone who has experience in this area can help us will be good. |
/azpw run Azure.sonic-buildimage |
Potential fix of build ut issue: #18566 The marvell build pipeline continuously fail, seems related to the new added |
@pavannaregundi , can you rerun PR checker by comment '/azpw run Azure.sonic-buildimage'? |
'mrvl-prestera' and 'sonic-platform-marvell' submodules are moved from 'marvell-arm64'to 'marvell'. Additionaly submodules are changed to support multi-architecture build. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
sonic-platform-nokia is created from merge of 'marvell-armhf' and 'marvell-arm64' in 'marvell'. Additionaly changes are done to support multi-arch build. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
Combine all the architecture targets in makefiles. Added CONFIGURED_ARCH check to build for specific architecture. Updated sai deb which matches latest SAI commit. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
Changed build_image.sh and onie-mk-demo.sh to read architecture specific platform.conf. Moved marvell-arm64/platform.conf to marvell/platform_arm64.conf. Moved marvell-armhf/platform.conf to marvell/platform_armhf.conf. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
Use CONFIGURED_PLATFORM based path while reading sonic_fit.its. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
This change is needed to generate the output image with architecture suffix for arm64/armhf platform. For arm64, defined a marvell specific file to avoid affect on other vendors. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
Change 'marvell-arm64' and 'marvell-armhf' platform_asic name to 'marvell'. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
Removed 'marvell-armhf' and 'marvell-arm64' as infra is combined with 'marvell' folder. Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
793f219
to
44e9f1a
Compare
make configure is changed as below for 'marvell-arm64' and 'marvell-armhf'. arm64 - make configure PLATFORM=marvell PLATFORM_ARCH=arm64 armhf - make configure PLATFORM=marvell PLATFORM_ARCH=armhf Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>
@Blueve @liushilongbuaa I have pushed a change by changing the azure new variable for platform to "PLATFORM_NAME", instead of "PLATFORM". It could be that yml is setting this as env variable. |
Builds are passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@prgeor All comments are addressed. Can we merge this PR. |
Why I did it
This change is about marvell build infrastructure enhancement by merging architecture specific marvell platform(marvell-arm64 and marvell-armhf) folders under 'marvell'.
Work item tracking
How I did it
This is archived with following changes divided into following commits,
Move mrvl-prestera and sonic-platform-marvell submodule
'mrvl-prestera' and 'sonic-platform-marvell' submodules are moved from 'marvell-arm64'to 'marvell'. Additionaly submodules are changed to support multi-architecture build.
Create sonic-platform-nokia from marvell-arm64/armhf
'sonic-platform-nokia' is created from merge of 'marvell-armhf' and 'marvell-arm64' in 'marvell'. Additionally changes are done in debian/rules to support multi-architecture build.
Change marvell platform makefile to support all arch
Combine all the architecture targets in makefiles. Added CONFIGURED_ARCH check to build for specific architecture.
Updated sai deb which matches latest SAI commit.
Add support for architecture specific platform.conf
Changed build_image.sh and onie-mk-demo.sh to read architecture specific platform.conf.
Moved marvell-arm64/platform.conf to marvell/platform_arm64.conf.
Moved marvell-armhf/platform.conf to marvell/platform_armhf.conf.
[arm64] Adjust the path to read sonic_fit.its
Use CONFIGURED_PLATFORM based path while reading sonic_fit.its.
[arm64/armhf] Add architecure suffix for output image
This change is needed to generate the output image with architecture suffix for arm64/armhf platform.
For arm64, defined a marvell specific file to avoid affect on other vendors.
Change platform_asic name to marvell
Change 'marvell-arm64' and 'marvell-armhf' platform_asic name to 'marvell'.
Remove marvell-armhf and marvell-arm64 folders
Removed 'marvell-armhf' and 'marvell-arm64' as infra is combined with 'marvell' folder.
Update readme to reflect new build commands
Change azure pipeline commands for marvell
New build commands:
AMD64 - make configure PLATFORM=marvell && make target/sonic-marvell.bin
ARM64 - make configure PLATFORM=marvell PLATFORM_ARCH=arm64 && make target/sonic-marvell-arm64.bin
ARMHF - make configure PLATFORM=marvell PLATFORM_ARCH=armhf && make target/sonic-marvell-armhf.bin
How to verify it
Built images for all the platform and installed on hardware to verify the port up.
Verified onie and sonic-sonic install.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)