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

Enable P4RT at build time and disable at startup #10499

Merged
merged 4 commits into from
Oct 31, 2022

Conversation

ntoorchi
Copy link
Contributor

@ntoorchi ntoorchi commented Apr 7, 2022

Why I did it

Currently at the Azure build system, the P4RT container is disabled by default at the build time. Here the goal is to include the P4RT container at the build time while disabling it at the runtime. The user can enable/disable the p4rt app through the config based on the preference.

How I did it

Changed the config in rules/config and init-cfg.json.j2

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@bocon13
Copy link
Contributor

bocon13 commented Apr 19, 2022

@ntoorchi can you add some time and space comparisons?

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 10499 in repo Azure/sonic-buildimage

@ntoorchi
Copy link
Contributor Author

ntoorchi commented Jul 7, 2022

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@ntoorchi
Copy link
Contributor Author

ntoorchi commented Jul 7, 2022

/azp run broadcom

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 10499 in repo Azure/sonic-buildimage

@ntoorchi
Copy link
Contributor Author

ntoorchi commented Jul 7, 2022

/azpw run broadcom

@mssonicbld
Copy link
Collaborator

/AzurePipelines run broadcom

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@ntoorchi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rhalstea
Copy link
Contributor

@ntoorchi can we rebuild this, or do we know why the build failed?

@ntoorchi
Copy link
Contributor Author

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 10499 in repo sonic-net/sonic-buildimage

@ntoorchi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ntoorchi
Copy link
Contributor Author

@ntoorchi can we rebuild this, or do we know why the build failed?

@rhalstea marvell_armhf fails. It's due to this block:

ifeq ($(CONFIGURED_ARCH),armhf)

The error is recipe commences before first target. Stop. so it might be due to @echo.

@rhalstea
Copy link
Contributor

Thanks @ntoorchi,

Was this re-based to be at the most recent sonic-buildimage? I'm not sure how to tell if it was, but marvell_armhf doesn't seem to have an issue on the mainline.

@ntoorchi
Copy link
Contributor Author

@rhalstea no this is not rebased recently, but I tried on a locally rebased sonic-buildimage too. This looks like a syntax error in the slave.mk, happens when INCLUDE_P4RT=y and CONFIGURED_ARCH=armhf (running on arm processor). I guess the reason is the tab before @echo when it is not under any target. I tried using $(info ...) instead of echo and it worked. Should I add the fix to this PR or open a separate PR or issue?

@rhalstea
Copy link
Contributor

rhalstea commented Aug 17, 2022

Thanks,
We'll need this PR to pass all the "Required" tests before we can submit so I think it has to go here.

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ntoorchi
Copy link
Contributor Author

ntoorchi commented Aug 21, 2022

@rhalstea all checks passed!

@rhalstea
Copy link
Contributor

Thanks @ntoorchi!

@prsunny would you be able to review this? Asking since you seem to be who we mainly send PINS PRs to :)

CC'ing: @bhagatyj and @bocon13

@bhagatyj
Copy link

bhagatyj commented Aug 29, 2022

LGTM

@ntoorchi
Copy link
Contributor Author

@qiluo-msft, @zhangyanzhao can you please review this PR or assign someone to review? The goal is to include the P4RT at the build time. However it is disabled by default at the runtime. The PR also includes a fix to the slave.mk in order to pass marvell_armhf build.

@qiluo-msft
Copy link
Collaborator

Share the same concern: can you add some time and space comparisons?

@ntoorchi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ntoorchi
Copy link
Contributor Author

Share the same concern: can you add some time and space comparisons?

Thanks @qiluo-msft for reviewing. I am trying to use Azure Pipeline artifacts as references but build time and size usually varies by time. In general, I have noticed build time is quite comparable, and there is some increase in size due to adding P4RT.

Pipeline it is taking a long time (or failing) at this moment. But the sonic-buildimage.broadcom was successful and it took around 6h while Master build has taken around 8h. But at the normal condition, the PR build time was quite comparable with other builds, e.g. around 2h 30m.

Comparing size of downloaded artifact with the one from the commit 9750cb4, there is slightly increase in size due to adding P4RT. We have disabled some of the debugging tools to minimize the overhead.

commit size sonic-buildimage.broadcom size sonic-aboot-broadcom.swi
PR 10499 10.27G 1.13G
commit 9750cd4 9.88G 1.12 G

Please let me know if you have any specific comparison in mind.

@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Sep 20, 2022

The image sizes increases by ~10M.
Since most users do not use P4RT, could you maintain private branches/patches on top of the public branches, so there is no impact to unrelated users. We have to support various platforms and some have super small disks.

@bocon13
Copy link
Contributor

bocon13 commented Sep 22, 2022

I'm trying to understand the requirement here.

From my perspective, it looks like enabling PINS adds ~10MB to the switch image that we deploy. This seems like a very small impact to users, and it will be great to have PINS in the image to enable more users to try it out without rebuilding.

The ~400MB is the build time artifacts on a machine that likely has 1TB+ available. Personally, I don't see a problem with this, but if there is concern, we can just add a step to remove intermediate artifacts from the PINS build before they are stored in the CI system.

What do you think?

@qiluo-msft
Copy link
Collaborator

I see your point and refine my last comment. The size of build time artifacts is not a concern. ~10M of image size increasing is still a valid concern. @lguohan do you have any comment?

@ntoorchi
Copy link
Contributor Author

I see your point and refine my last comment. The size of build time artifacts is not a concern. ~10M of image size increasing is still a valid concern. @lguohan do you have any comment?

Thanks @qiluo-msft for your comment. As @bocon13 mentioned, enabling PINS would be valuable as currently many vendors are trying it out. It will be more convenient if it's present in the image, encouraging more users to trying it.

cc @bhagatyj @rhalstea

@bhagatyj
Copy link

bhagatyj commented Oct 1, 2022

Since PINS introduction last year, multiple organizations have been working on different use cases. We are also in the path of upstreaming tests. As a percentage of image size, the 10M is quite small. For this size, this container brings in a critical functionality of SDN and remote controllability.

@qiluo-msft
Copy link
Collaborator

Please solve the conflicts.

Why I did it
The extra spaces cause the error "recipe commences before first target.  Stop."
@ntoorchi
Copy link
Contributor Author

Please solve the conflicts.

Thanks Qi, I rebased and resolved the conflict but the pipeline builds are failing at this moment.

@ntoorchi
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rhalstea
Copy link
Contributor

Thanks @ntoorchi @qiluo-msft and @xumia,

The build and test look good. Can we merge this?

@qiluo-msft qiluo-msft merged commit 45d1746 into sonic-net:master Oct 31, 2022
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.

7 participants