Skip to content

GIT definition source

Corridor provides an option for the users to integrate with GIT for the definitions of objects. This integration can be done by creating a handler which has the logic to connect to the git repo and fetch the required code.

Example Configuration for enabling git

# A handler for parsing contents from git repository
from corridor_api.config.handlers import DefinitionHandler
class CorridorGitHandler(DefinitionHandler):
name = 'corridor_git_handler'

    def parse_definition(self, contents, info, def_type):
        if def_type in ('model-pickle', 'model-pmml', 'model-onnx', 'model-lookup', 'model-h2o-mojo'):
            return contents

# Add git configuration to DEFINITION_SOURCES
git_conf = {
    'handler': 'CorridorGitHandler',
    # Add the repo url here
    'repos': ['[email protected]:corridor/model_repository.git']
}
DEFINITION_SOURCES = {
    'data-vault-aggregate': {'manual': None, 'file-upload': {}},
    'fact-feature': {'manual': None, 'file-upload': {}},
    'fact-feature-aggregate': {'manual': None, 'file-upload': {}},
    'model-pmml': {'manual': None, 'file-upload': {}, 'git': git_conf},
    'model-pickle': {'manual': None, 'file-upload': {}, 'git': git_conf},
    ...
    ...
}