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

Larch platform #15

Open
wants to merge 123 commits into
base: main
Choose a base branch
from
Open

Larch platform #15

wants to merge 123 commits into from

Conversation

kburavchenko
Copy link

No description provided.

Viacheslav Holovetskyi added 30 commits September 4, 2024 15:43
.. Now it uses "origin" and "elem" fields, instead of a deprecated "element"
field
For some reason it was `ifname` in Broadcom implementation, although this
field doesn't appear anywhere in SONIC YANG models
},
"service": {
"name": "ucentral_client",
"requires": [],
"after": [],
"after": ["gnmi", "mgmt-framework", "swss", "syncd"],
Copy link
Contributor

Choose a reason for hiding this comment

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

BRCM Sonic doesn't seem to be having explicit GNMI service;
Actually, i think we should try and separate manifests for each different target platform, and we should not try to fit a single one for all supported platforms;

@@ -13,7 +13,7 @@ netlink/netlink.full.a:

%.o: %.c
ifdef PLATFORM_REVISION
gcc -c -o $@ ${CFLAGS} -I ./ -I ../../include -D PLATFORM_REVISION='"$(PLATFORM_REVISION)"' $^
gcc -c -g -o $@ ${CFLAGS} -I ./ -I ../../include -D PLATFORM_REVISION='"$(PLATFORM_REVISION)"' $^
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to explicitly generate debug info for each type of build? This flag has to be controlled from higher call tree perspective, i think;
Especially since these flags are unconditionally changed for existing platform

status = (*gs->stub)->Get(&context, greq, &gres);

/*
* We don't have the implementation of JWT authentication, so disable it
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't be changing implementation of existing platform;
I'm still looking through code, but if you're using this implementation in Larch-plat code as well, we have to come up with some layering to maybe separate potential common code or something like that


cJSON *servers = cJSON_GetObjectItemCaseSensitive(s, "servers");
if (!cJSON_IsArray(servers))
{
Copy link
Contributor

@Cahb Cahb Sep 24, 2024

Choose a reason for hiding this comment

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

Let's respect existing common code codestyle;
e.g. use
if (xx) {
P.S. same applies to all occurances;

goto err;
}

const cJSON *server_json = NULL;
Copy link
Contributor

@Cahb Cahb Sep 24, 2024

Choose a reason for hiding this comment

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

Please move the declaration to top of the function;
P.S. same applies to all occurances;

@@ -9,6 +11,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
curl \
libjsoncpp-dev \
busybox \
gdb \
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep debugging stuff out of release (default) builds

@Cahb
Copy link
Contributor

Cahb commented Sep 25, 2024

Hi @kburavchenko, Viacheslav,

I was a bit carried away with jumping into reviewing the changes, and - where are my manners - I forgot to write a follow up comment on the changes;

First of all, thank you for this PR and interest in upstreaming the changes, especially extending it beyond just your platforms implementation, but also expanding that onto introducing changes in the Proto part as well - any interested vendor could easily pull generic parser / internal structures population and filling code that would most certainly ease their implementation of their own platform.

Secondly, the PR looks really good. I can see that the integration with base / common code and build instructions wasn't that complicated, and seems mostly clean and transparent.

I've left few comments that are related only to the base code and common part that could be shared among different vendor's implementations, i didn't really peek into your platform code and how it works, I do belive you have a better vision on how it works, e.g. you know your best in that regard :)

I hope the comments i've left make sense and you do agree on the changes required, if not we can proceed on and discuss the changes here, if you want.

Thank you once again for these changes, and hopefully we will see Larch platform implementation available in this repo, main branch in the near time :)

@kburavchenko
Copy link
Author

Hi @Cahb, thank you for a great review. All comments are useful and we will try to address them.
We will try to save all platform-independent code. I also like not touching the common code; your review helps us fix this.

Viacheslav Holovetskyi and others added 8 commits October 2, 2024 02:08
Parse switch.jumbo-frames instead of switch.properties.jumbo-frames
(according to uCentral schema)
…s those ..

.. requirements are not crossplatform across different platforms
Review fixes for uCentral upstream contribution

See merge request openlan/ols-ucentral-client!39
@kburavchenko
Copy link
Author

@Cahb please review again.

@@ -1,4 +1,4 @@
FROM debian:buster
FROM arm64v8/debian:buster
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to specify platform-specific docker image in the common (builder) dockerfile?)
I've tried these changes, and for BRCM (x86 platform) i gave up compliing image after ~45 minutes
(Without this line that specifies platform in the docker image it took me ~15-20 minutes clean build till completion)
I think the platform specific img version in my case falls back to using qemu and hence slows down the compile process on the host OS;

Root dockerfile is the image... do you really need to use arm64 here? Is it expected that you'd be generating an image / deb package on the ARM system?

Copy link
Contributor

Choose a reason for hiding this comment

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

<Discussed offline through slack, ignore this comment>

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.

2 participants