Skip to content
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

Merged
merged 10 commits into from
Apr 15, 2024

Conversation

pavannaregundi
Copy link
Contributor

@pavannaregundi pavannaregundi commented Feb 21, 2024

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
  • Microsoft ADO (number only):

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

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)

@pavannaregundi
Copy link
Contributor Author

@Pavan-Nokia please review.

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, @xumia, thoughts?

Copy link
Collaborator

@xumia xumia Mar 1, 2024

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.


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.

Copy link
Contributor Author

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.

Comment on lines 85 to 89
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
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Reverting this change.

@pavannaregundi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

Pull request contains merge conflicts.

@Blueve
Copy link
Contributor

Blueve commented Mar 6, 2024

@Blueve
Copy link
Contributor

Blueve commented Mar 7, 2024

Hi @pavannaregundi , can you trigger a new build by typing /azpw run Azure.sonic-buildimage in comments again?

@pavannaregundi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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/
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@liushilongbuaa
Copy link
Contributor

can you trigger a new build by typing /azpw run Azure.sonic-buildimage in comments again?

@pavannaregundi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liushilongbuaa
Copy link
Contributor

can you trigger a new build by typing /azpw run Azure.sonic-buildimage in comments again?

Done. Build still failing.

Can you debug locally to fix sonic-config-engine UT?

@liushilongbuaa
Copy link
Contributor

Hi @neethajohn , can you help on the UT?

@pavannaregundi
Copy link
Contributor Author

can you trigger a new build by typing /azpw run Azure.sonic-buildimage in comments again?

Done. Build still failing.

Can you debug locally to fix sonic-config-engine UT?

@liushilongbuaa We will try looking at this. However, someone who has experience in this area can help us will be good.

@radha-danda
Copy link

/azpw run Azure.sonic-buildimage

@Blueve
Copy link
Contributor

Blueve commented Apr 8, 2024

Potential fix of build ut issue: #18566

The marvell build pipeline continuously fail, seems related to the new added PLATFORM variable. And above PR can clean up the variable before build py-wheel

@liushilongbuaa
Copy link
Contributor

@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>
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>
@pavannaregundi
Copy link
Contributor Author

@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.

@pavannaregundi
Copy link
Contributor Author

@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.

Copy link
Contributor

@liushilongbuaa liushilongbuaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavannaregundi
Copy link
Contributor Author

@prgeor All comments are addressed. Can we merge this PR.

@prgeor
Copy link
Contributor

prgeor commented Apr 14, 2024

@prgeor All comments are addressed. Can we merge this PR.

@lguohan @yxieca can you merge?

@yxieca yxieca merged commit 006f4b2 into sonic-net:master Apr 15, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants