Skip to contentSkip to conversation

Any convention on putting source codes into openbmc/openbmc repository

DISCUSSION Thang Nguyen 5 participants 8 messages Feb 17, 2021 – Feb 22, 2021

lore
Share & tools
lore
#0 lore raw

Hi,

We implemented several features using c/cpp codes. Currently we put the c/cpp source into the openbmc repository like below:

https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-common/recipes-ac01/host/ampere-host-error-monitor

https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-jade/recipes-ampere/host/ampere-scp-failover

I check from http://github.com/openbmc/openbmc but don't see source codes put there. Is there any rule that prevent source codes put into the openbmc repository?

Best Regards,

Thang Q. Nguyen -

#1 lore raw

Code should be put into an appropriate repo, and repos created where necessary. Then referenced in recipes from openbmc/openbmc metalayers.

Quoted 21 lines · Thang Nguyen

Hi,

We implemented several features using c/cpp codes. Currently we put the c/cpp source into the openbmc repository like below:

https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-common/recipes-ac01/host/ampere-host-error-monitor

https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-jade/recipes-ampere/host/ampere-scp-failover

I check from http://github.com/openbmc/openbmc but don't see source codes put there. Is there any rule that prevent source codes put into the openbmc repository?

Best Regards,

Thang Q. Nguyen -

Signature · 13 lines
Nancy Yuen

•

Google Platforms

•

[email protected]

•

Google LLC
#2 lore raw
Quoted 1 line · Nancy Yuen

Code should be put into an appropriate repo, and repos created where necessary.  Then referenced in recipes from openbmc/openbmc metalayers.

Thanks Nancy for the feedback. Do we have requirement for this or just a recommendation?

Quoted 55 lines · On Wed, Feb 17, 2021 at 12:55 AM Thang Nguyen <[email protected]…

Hi,

We implemented several features using c/cpp codes. Currently we put the
c/cpp source into the openbmc repository like below:

https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-common/recipes-ac01/host/ampere-host-error-monitor
<https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-common/recipes-ac01/host/ampere-host-error-monitor>

https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-jade/recipes-ampere/host/ampere-scp-failover
<https://github.com/ampere-openbmc/openbmc/tree/ampere/meta-ampere/meta-jade/recipes-ampere/host/ampere-scp-failover>

I check from http://github.com/openbmc/openbmc
<http://github.com/openbmc/openbmc> but don't see source codes put there. Is there any rule that prevent source codes put into the openbmc repository?

Best Regards,

Thang Q. Nguyen -

Signature · 25 lines
Nancy Yuen

	

•

	

Google Platforms

	

•

	

[email protected] <mailto:[email protected]>

	

•

	

Google LLC
#3 lore raw
Quoted 7 lines · Thang Nguyen

On 18/02/2021 06:46, Nancy Yuen wrote:

Code should be put into an appropriate repo, and repos created where necessary. Then referenced in recipes from openbmc/openbmc metalayers.

Thanks Nancy for the feedback. Do we have requirement for this or just a recommendation?

It's a requirement.

OpenBMC uses a project called yocto, which is itself based on openembedded (OE). OE is a set of build scripts and configuration files for building a filesystem. The filesystem will contain applications, such as ipmi daemons, web servers, sensor monitoring code, etc. The source code for those applications comes from the application's repository. For example, our ssh server (dropbear) comes from dropbear's website.

For applications that are developed exclusively for openbmc, we host their source code as part of the openbmc organisation on github. But the source code lives outside of the main yocto-derived repository, and is checked out at build time.

If you have application code that you wish to be part of your system, you should first see if it makes sense to contribute that code to an existing repository. If it is unique, or deserves it's own repository, then you can mail the list to request the creation of a new repository for your code.

Apologies if I've covered something you already understood. Once you've been around the project for a while it becomes second nature, but it was hard to describe the concepts from scratch!

Cheers,

Joel

#4 lore raw
Quoted 28 lines · Joel Stanley
Quoted 6 lines · Thang Nguyen

On 18/02/2021 06:46, Nancy Yuen wrote:

Code should be put into an appropriate repo, and repos created where necessary. Then referenced in recipes from openbmc/openbmc metalayers.

Thanks Nancy for the feedback. Do we have requirement for this or just a recommendation?

It's a requirement.

OpenBMC uses a project called yocto, which is itself based on openembedded (OE). OE is a set of build scripts and configuration files for building a filesystem. The filesystem will contain applications, such as ipmi daemons, web servers, sensor monitoring code, etc. The source code for those applications comes from the application's repository. For example, our ssh server (dropbear) comes from dropbear's website.

For applications that are developed exclusively for openbmc, we host their source code as part of the openbmc organisation on github. But the source code lives outside of the main yocto-derived repository, and is checked out at build time.

If you have application code that you wish to be part of your system, you should first see if it makes sense to contribute that code to an existing repository. If it is unique, or deserves it's own repository, then you can mail the list to request the creation of a new repository for your code.

Quoted 7 lines

Apologies if I've covered something you already understood. Once you've been around the project for a while it becomes second nature, but it was hard to describe the concepts from scratch!

Cheers,

Joel

Thanks Joel for your feedback.

BR/ThangQ.

#5 lore raw
In reply to Joel Stanley
Quoted 9 lines · Joel Stanley
Quoted 6 lines · Thang Nguyen

On 18/02/2021 06:46, Nancy Yuen wrote:

Code should be put into an appropriate repo, and repos created where necessary. Then referenced in recipes from openbmc/openbmc metalayers.

It's a requirement.

My opinion is that there are two reasons that come to my mind on why we follow this convention right now beyond just that Yocto is happier with it:

1. We like to have a discussion before making a new repository to make sure we're not fragmenting the codebase more than necessary. Often problems/solutions overlap more than might seem obvious when you're looking at it just from your machine or architecture's perspective. There may be some existing implementation that could be modified slightly to make it fit your needs, or it could be that someone else has the same problem and would like to work with you on implementation.

2. All of our CI infrastructure is set up where machine recipes go in openbmc/openbmc and code goes in various code repositories. If you try to put code directly into openbmc/openbmc you do not gain any of those CI efforts we already have:
* Build of your code and unit tests when someone makes a code change.
* Unit test execution.
* Code formatting.
* Static code analysis.
We have a lot of support at a repository level that doesn't exist in openbmc/openbmc directly, because it isn't approriate for what is there.

Hopefully this gives you some additional context on why.

Signature · 1 line
Patrick Williams
#6 lore raw
Quoted 11 lines · Patrick Williams
Quoted 7 lines · Joel Stanley
Quoted 5 lines · Thang Nguyen

On 18/02/2021 06:46, Nancy Yuen wrote:

Code should be put into an appropriate repo, and repos created where necessary. Then referenced in recipes from openbmc/openbmc metalayers.

It's a requirement.

My opinion is that there are two reasons that come to my mind on why we follow this convention right now beyond just that Yocto is happier with it:

Quoted 8 lines

1. We like to have a discussion before making a new repository to make sure we're not fragmenting the codebase more than necessary. Often problems/solutions overlap more than might seem obvious when you're looking at it just from your machine or architecture's perspective. There may be some existing implementation that could be modified slightly to make it fit your needs, or it could be that someone else has the same problem and would like to work with you on implementation.

Thanks. It clears for me.

Quoted 13 lines

2. All of our CI infrastructure is set up where machine recipes go in openbmc/openbmc and code goes in various code repositories. If you try to put code directly into openbmc/openbmc you do not gain any of those CI efforts we already have:
* Build of your code and unit tests when someone makes a code change.
* Unit test execution.
* Code formatting.
* Static code analysis.
We have a lot of support at a repository level that doesn't exist in openbmc/openbmc directly, because it isn't approriate for what is there.

Does the CI setup automatically? if not, how can I set it up?

It seems I don't have CI setup on the http://github.com/openbmc/ssifbridge repository. How can I have CI for it?

Quoted 3 lines

Hopefully this gives you some additional context on why.

#7 lore raw
Quoted 40 lines · Thang Nguyen
Quoted 11 lines · Patrick Williams
Quoted 7 lines · Joel Stanley
Quoted 5 lines · Thang Nguyen

On 18/02/2021 06:46, Nancy Yuen wrote:

Code should be put into an appropriate repo, and repos created where necessary. Then referenced in recipes from openbmc/openbmc metalayers.

It's a requirement.

My opinion is that there are two reasons that come to my mind on why we follow this convention right now beyond just that Yocto is happier with it:

Quoted 8 lines

1. We like to have a discussion before making a new repository to make sure we're not fragmenting the codebase more than necessary. Often problems/solutions overlap more than might seem obvious when you're looking at it just from your machine or architecture's perspective. There may be some existing implementation that could be modified slightly to make it fit your needs, or it could be that someone else has the same problem and would like to work with you on implementation.

Thanks. It clears for me.

Quoted 13 lines

2. All of our CI infrastructure is set up where machine recipes go in openbmc/openbmc and code goes in various code repositories. If you try to put code directly into openbmc/openbmc you do not gain any of those CI efforts we already have:
* Build of your code and unit tests when someone makes a code change.
* Unit test execution.
* Code formatting.
* Static code analysis.
We have a lot of support at a repository level that doesn't exist in openbmc/openbmc directly, because it isn't approriate for what is there.

Quoted 3 lines

Does the CI setup automatically? if not, how can I set it up?

It seems I don't have CI setup on the http://github.com/openbmc/ssifbridge repository. How can I have CI for it?

Just need to make a request on mailing list or find me on discord. I’ve added it now.

Quoted 3 lines
Quoted 3 lines

Hopefully this gives you some additional context on why.