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

split initialization of sonic_platform to a per-daemon basis #3

Closed
wants to merge 8 commits into from

Conversation

stephenxs
Copy link
Owner

@stephenxs stephenxs commented Jul 15, 2019

- What I did
split sonic_platform initialization to a per-daemon basis to save the startup time of daemons
make Mellanox new platform api able to be installed on host so that reboot cause can be handled on it.

- How I did it

  1. modify makefiles so that the following modules are installed on host:
    • sonic_platform, which handles reboot cause
    • sonic_daemon_base, on which sonic_platform depends
  2. remove unnecessary dependencies of sonic_platform on host
    • implement platform.py
    • add an added argument to sonic_platform.platform.Platform's constructor, as following:
      Platform.__init__(self, daemon = None)
      • [TBD] the base class sonic_platform_base.platform_base.PlatformBase.init should be updated accordingly
    • Platform's constructor loads and initializes only the functionalities on a per-daemon basis, i.e. only functionalities required by the daemon are initialized for it.
    • define initializers for each components belonging the chassis and remove them out of the chassis's constructor so that they can be called only when needed. currently the following initializers defined:
      • initialize_psu
      • initialize_watchdog
      • initialize_fan
      • initialize_sfp
      • initialize_eeprom
      • initialize_components_list

- How to verify it
load chassis on host and check whether reboot-cause and watchdog can be well handled.
load chassis on pmon docker and check whether other components can be well handled.
run process-reboot-cause and check whether the correct reboot cause can be parsed.

- Description for the changelog

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

Stephen Sun added 2 commits July 14, 2019 10:04
…aemon-base

2. remove dependency on the modules not feasible to install on host, like swsscomm, sdk, etc.
@stephenxs stephenxs changed the title Install npapi on host split initialization of sonic_platform to a per-daemon basis Jul 15, 2019
Stephen Sun added 6 commits July 17, 2019 01:39
…esults from referencing an already destroyed global variable when destructuring daemon_base.Logger by introducing a class member to represent the global
1. removing iniaializations of varient components out from constructor and providing one initializer for each.
2. only import other modules when initializing it.
by doing so, initializing time is reduced and unnecessary dependencies of chassis is removed for daemons who don't need them.
we decide to split chassis in a host/daemon basis rather than a per-daemon bases.
adjust the argument of Platform() accordingly as well as all code that calls Platform.
@stephenxs
Copy link
Owner Author

I'm going to split this PR into 3 which contain the following logic and then close it.

  1. installing vendor-specific sonic_platform on the host:
    • make file rules which contains the logic of making it and installing it.
    • remove unnecessary dependencies which can block sonic_platform from installing on the host.
  2. fix the sonic_daemon_base's issue which reports error when destructing sonic_daemon_base.
  3. mellanox specific part:
    • split initializers of variant categories of devices so that unnecessary dependencies can be avoided
    • improve reboot-cause-handling logic

@stephenxs stephenxs closed this Aug 4, 2019
@stephenxs stephenxs deleted the install-npapi-on-host branch September 8, 2019 06:30
stephenxs pushed a commit that referenced this pull request Dec 10, 2020
This update brings in the following commits.

86c1108 Enable arm architecture to build in addition to amd64 (#37)
4acb2c3 fix bugs and enhance Transformer (#35)
49e5a22 ygot related enhancements and fixes (#34)
51224de Fix ietf yang search path for cvl schema builds (#32)
3c6cdb3 CVL Changes #8: 'must' and 'when' expression evaluation (#31)
dabf231 CVL Changes #7: 'leafref' evaluation (#28)
6f9535f CVL Changes #6: Customized Xpath Engine integration (#27)
5e2466b DB-Layer fixes/enhancements (#26)
9a27302 CVL Changes #4: Implementation of new CVL APIs (#22)
dbf1093 Translib support for authorization, yang versioning and Delete flag (#21)
80f369e CVL Changes #5: YParser enhancement (#23)
904ce18 CVL Changes #3: Multi-db instance support (#20)
9d24a34 CVL Changes #2:  YValidator infra changes for evaluating xpath expression (#19)
f3fc40f CVL Changes #1: Initial CVL code reorganization and common infra changes (#18)
4922601 Bulk and RPC API support in translib (#16)
1d730df RFC7895 yang module library implementation (#15)
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.

1 participant