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

[sai-api-gen] Write files only when changes are detected #429

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

kcudnik
Copy link
Collaborator

@kcudnik kcudnik commented Aug 29, 2023

This will make easier for make pick up when file actually changed

This will make easier for make pick up when file actually changed
@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 29, 2023

@chrispsommers please review

@kcudnik kcudnik requested review from chrispsommers and marian-pritsak and removed request for chrispsommers August 29, 2023 22:03
@chrispsommers chrispsommers changed the title [sai-api-gen] Write wiles only when changes are detected [sai-api-gen] Write files only when changes are detected Aug 29, 2023
Copy link
Collaborator

@chrispsommers chrispsommers left a comment

Choose a reason for hiding this comment

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

Minor typo, otherwise I approve (subject to CI passing). Thanks, great improvement!

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 30, 2023

please merge if no more issues

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 30, 2023

btw. i added log lines when nothing to change locally:

nothing to change in ./SAI/experimental/saiexperimentaldashacl.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashacl.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashdirectionlookup.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashdirectionlookup.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashtag.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashtag.cpp
nothing to change in ./SAI/experimental/saiexperimentaldasheni.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidasheni.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashinboundrouting.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashinboundrouting.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashmeter.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashmeter.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashoutboundcatopa.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashoutboundcatopa.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashoutboundrouting.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashoutboundrouting.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashvnet.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashvnet.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashpavalidation.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashpavalidation.cpp
nothing to change in ./lib/sairoute.cpp
nothing to change in ./SAI/experimental/saiexperimentaldashvip.h
nothing to change in ./SAI/experimental/saiextensions.h
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./SAI/inc/saiobject.h
nothing to change in ./lib/saidashvip.cpp
nothing to change in ./SAI/experimental/saitypesextensions.h
nothing to change in ./lib/Makefile
nothing to change in ./lib/utils.cpp
nothing to change in ./lib/utils.h
nothing to change in ./lib/saifixedapis.cpp
nothing to change in ./lib/saiimpl.h
nothing to change in ./lib/logger.h
nothing to change in ./lib/logger.cpp
nothing to change in ./lib/saidash.h
nothing to change in ./lib/dashsai.h
nothing to change in ./lib/dashsai.cpp
nothing to change in ./lib/config.h

and generating script is not optimal ether, when sort and uniq:

       11 nothing to change in ./SAI/experimental/saiextensions.h
       12 nothing to change in ./SAI/experimental/saitypesextensions.h
       11 nothing to change in ./SAI/inc/saiobject.h

those 3 files are generated 11 and 12 times, didn't figure this out yet, but script is taking:

real    0m1.764s
user    0m1.737s
sys     0m0.017s

so potentially execution time could be also improved, maybe to like 0.5 sec etc, still p4 json needs to be parsed, but i can live with current time :D

@chrispsommers
Copy link
Collaborator

Hi @kcudnik for some reason #422 did not get merged last week as agreed, I just merged it, but you probably need to resync to main now.

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 30, 2023

there are no merge conflicts, jsut /azp run

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 30, 2023

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 429 in repo sonic-net/DASH

@chrispsommers
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@chrispsommers chrispsommers merged commit 37affbd into sonic-net:main Aug 30, 2023
4 checks passed
@kcudnik kcudnik deleted the apigen branch August 30, 2023 16:24
clarklee-guizhao added a commit to clarklee-guizhao/DASH that referenced this pull request Dec 3, 2023
* main: (75 commits)
  [dash-SAI] Enable warnings as errors (sonic-net#466)
  [SAI] wrong code generated in libsai sonic-net#415 (sonic-net#463)
  Fix incorrect IP in SONiC-DASH HLD VNET to VNET example. (sonic-net#459)
  DASH pipeline packet flow update proposal. (sonic-net#449)
  [libsai] Add attr name logging when doing get api (sonic-net#451)
  Build libsai deb packages in github workflow (sonic-net#450)
  Add Private Link mapping (sonic-net#327)
  [SAI] Update SAI submodule to the latest origin/master (sonic-net#446)
  [dash] Add libsai-debs target to create libsai debian packages (sonic-net#444)
  update p4 compile dependancy to avoid parallel  docker runs (sonic-net#443)
  [dash] Refactor libsai (sonic-net#438)
  [dash] Update SAI to latest v1.13 (sonic-net#435)
  [dash-pipeline] Refactor Makefiles (sonic-net#432)
  Remove ACL tags from BM (sonic-net#425)
  [submodule] Update SAI submodule to origin/master (sonic-net#431)
  [sai-api-gen] Write files only when changes are detected (sonic-net#429)
  Adds SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION api to dash_underlay_routing (sonic-net#422)
  [SAI] Add missing check for api initialized
  [SAI] Print oids in hex form
  [SAI] Change asserts to return error codes and add missing switch api
  ...
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