compass-core/compass
Xicheng Chang 02523b9a7e Trim some install scripts for agent install
Change-Id: I80e4605d80a5eaf186e3e80a061590739e2ed592
2016-07-09 19:29:16 -04:00
..
actions enable remote-deploy 2016-07-06 14:36:35 -04:00
api enable remote-deploy 2016-07-06 14:36:35 -04:00
apiclient support redeploy 2015-12-28 09:05:19 +08:00
db Trim some install scripts for agent install 2016-07-09 19:29:16 -04:00
deployment Fixed a couple of typos. 2016-04-19 15:52:00 +00:00
hdsdiscovery Update Readme 2015-06-29 11:26:01 -07:00
log_analyzor move adapter from db to memory 2015-08-04 10:45:24 -07:00
tasks support redeploy 2015-12-28 09:05:19 +08:00
tests Add expansion and role patching features. 2015-12-07 17:34:28 -08:00
utils Seperate chef installer as a plugin (move chef tests to plugin directory) 2015-11-10 22:34:10 -08:00
README.md Change the order of ./compass/README.md to reflect a typical RESTful call logic path 2015-06-30 12:03:32 -07:00
__init__.py add code to match new pep8 style checking and fix bugs. 2014-03-11 01:26:42 +00:00

README.md

Compass Core Python Modules

compass/ is where all the core python modules of compass are, including API, DB, tasks and installers and so on.

##Direcotries and Files

* apiclient/ - API client.
    * example.py - example code to deploy a cluster by calling compass API client.
    * restful.py - compass API client library.
    * v1/ - deprecated directory.

* api/ - API related files go here.
    * api.py - defines compass RESTful API.
    * api.raml - raml file to display/document compass RESTful api.
    * auth_handler.py - handles API authentication.
    * exception_handlers.py - handles API exceptions.
    * utils.py - utilities for API.
    * v1/ - deprecated directory.

* db/ - compass database modules.
    * api/ - Database level API interfaces, which includes all compass primitive data types.
           - This is the wrapper layer of the ORM tables and expose the useful logic of DB accessing.
    * callback.py - metadata callback methods.
    * config_validation/ - configuration validation module.
    * exception.py - compass defined exceptions for database module.
    * models.py - database model file, defining all compass database tables.
    * validator.py - database validation methods.
    * vi/ - deprecated directory.


* tasks/ - all celery tasks are defined here, and they asynchronously exercise functions in the ./actions directory.
    * client.py - module to setup celery client.
    * tasks.py - defines all celery tasks.

* actions/ -  wrappers of heavy-lifting utility functions located in ./deployment,
./hdsdiscovery, ./log_analyzor
    * health_check/ that does a health
        check on compass and output diagnoses.

* deployment/ - backend deployment module that handles upstream data and dumps to installers
        * deployment_manager.py - deployment dispatcher that defines interfaces and retrieves/updates configurations.
        * installers - contains base installers and its children installers such as os_installer and pk_installer
          (package_installer). These installers here are the "plugin" kind of files that interact with installer
          tools(e.g. chef) that do the real installation tricks.
        * utils/ - utility module that contains a constant.py which defines all keyword variables for deployment.

* hdsdiscovery/ - hardware discovery module, mainly for mac-address retrieval from switches.
        * base.py - a base class that can be extended by vendors under vendor/ directory.
        * error.py - hdsdiscovery module error handling.
        * hdmanager.py - manages hdsdiscovery functionalities.
        * SNMP_CONFIG.md - instructions on how to install and configure snmp related modules/packages.
        * utils.py - contains utility functions for hdsdiscovery.
        * vendors/ - switch/hardware vendor specific plugins. To support a new vendor:
                1. Make sure the switch product supports SNMP.
                2. Make sure the switch product uses standard MIB.
                3. Add a corresponding plugin under vendors/.
            using arista as an example, first a python file with the same name of its parent directory should be added
            (e.g: arista.py). Define the class_name in the vendor file as "Arista" and give the class identical name.
            Then create a subdirectory called "plugins" and place mac.py under it.

* log_analyzor/ - compass progress tracking module.
        * adapter_matcher.py - module to provide installing progress calculation for the adapters.
        * file_matcher.py - updates installing progresses by processing the log files.
        * line_matcher.py - updates/gets progress when a matched line is found in log files.
        * progress_calculator.py: provides functions to update installing progresses.


* utils/ - compass core module utility functions.

* tests/ - all unittest code

* test_serverside/ - tests for installers(now only supports chef).