Esempio n. 1
0
def create_app():
    app_builder = ignition.build_resource_driver('Openstack VIM Driver')
    app_builder.include_file_config_properties(default_config_path,
                                               required=True)
    app_builder.include_file_config_properties('./ovd_config.yml',
                                               required=False)
    # custom config file e.g. for K8s populated from Helm chart values
    app_builder.include_file_config_properties('/var/ovd/ovd_config.yml',
                                               required=False)
    app_builder.include_environment_config_properties('OVD_CONFIG',
                                                      required=False)
    app_builder.add_property_group(AdditionalResourceDriverProperties())
    app_builder.add_service(ToscaParserService)
    app_builder.add_service(ToscaTopologyDiscoveryService,
                            tosca_parser_service=ToscaParserCapability)
    app_builder.add_service(ToscaHeatTranslatorService,
                            tosca_parser_service=ToscaParserCapability)
    app_builder.add_service(
        ResourceDriverHandler,
        OpenstackDeploymentLocationTranslator(),
        heat_translator_service=ToscaHeatTranslatorCapability,
        tosca_discovery_service=ToscaTopologyDiscoveryCapability,
        resource_driver_config=AdditionalResourceDriverProperties)

    # Custom Property Group, Service and API
    app_builder.add_property_group(OpenstackAdminProperties())
    app_builder.add_api_configurator(OpenstackAdminApiConfigurator())
    app_builder.add_service_configurator(OpenstackAdminServiceConfigurator())

    return app_builder.configure()
Esempio n. 2
0
def create_app():
    app_builder = ignition.build_resource_driver('kubedriver')
    app_builder.include_file_config_properties(default_config_path, required=True)
    app_builder.include_file_config_properties('./kubedriver_config.yml', required=False)
    # custom config file e.g. for K8s populated from Helm chart values
    app_builder.include_file_config_properties('/var/kubedriver/kubedriver_config.yml', required=False)
    app_builder.include_environment_config_properties('KUBEDRIVER_CONFIG', required=False)

    app_builder.add_property_group(AdditionalResourceDriverProperties())
    app_builder.add_property_group(KegDeploymentProperties())

    app_builder.add_service(NameManager)
    app_builder.add_service(KegPersistenceFactory)
    app_builder.add_service(KegdReportPersistenceFactory)
    app_builder.add_service(OpenshiftApiControllerFactory)
    app_builder.add_service(LocationContextFactory, 
            api_ctl_factory=OpenshiftApiControllerFactory,
            kegd_persister_factory=KegdReportPersistenceFactory, 
            keg_persister_factory=KegPersistenceFactory
    )
    app_builder.add_service(ExtendedResourceTemplateContext, 
            name_manager=NameManager
    )
    app_builder.add_service(DeploymentStrategyParser)
    app_builder.add_service(DeploymentStrategyFileReader, 
            deployment_strategy_properties=KegDeploymentStrategyProperties, 
            templating=TemplatingCapability, 
            parser=DeploymentStrategyParser
    )
    app_builder.add_service(KegdStrategyProcessor, 
            context_factory=LocationContextFactory, 
            templating=TemplatingCapability, 
            job_queue=JobQueueCapability
    )
    app_builder.add_service(KegdStrategyManager, 
            context_factory=LocationContextFactory, 
            templating=TemplatingCapability, 
            job_queue=JobQueueCapability,
            kegd_properties=KegDeploymentProperties
    )
    app_builder.add_service(KubeResourceDriverHandler, 
            resource_driver_properties=AdditionalResourceDriverProperties, 
            kegd_strategy_manager=KegdStrategyManager,
            kegd_file_reader=DeploymentStrategyFileReader, 
            render_context_service=ResourceTemplateContextCapability, 
            name_manager=NameManager
    )

    return app_builder.configure()
Esempio n. 3
0
def create_app():
    app_builder = ignition.build_resource_driver('AnsibleLifecycleDriver')
    app_builder.include_file_config_properties(default_config_path,
                                               required=False)
    # custom config file e.g. for K8s populated from Helm chart values
    app_builder.include_file_config_properties('/var/ald/ald_config.yml',
                                               required=False)
    app_builder.include_environment_config_properties('AVD_CONFIG',
                                                      required=False)

    app_builder.add_property_group(AnsibleProperties())
    app_builder.add_property_group(ProcessProperties())
    app_builder.add_property_group(AdditionalResourceDriverProperties())
    app_builder.add_service_configurator(AnsibleServiceConfigurator())
    app_builder.add_service_configurator(AnsibleDriverHandlerConfigurator())

    return app_builder.configure()
Esempio n. 4
0
def create_app():
    app_builder = ignition.build_resource_driver('AnsibleLifecycleDriver')
    app_builder.include_file_config_properties(default_config_path,
                                               required=False)
    # custom config file e.g. for K8s populated from Helm chart values
    app_builder.include_file_config_properties('/var/ald/ald_config.yml',
                                               required=False)
    app_builder.include_environment_config_properties('AVD_CONFIG',
                                                      required=False)

    # Using custom versions of some bootstrapped components
    boot_config = app_builder.property_groups.get_property_group(
        BootProperties)
    boot_config.progress_event_log.serializer_service_enabled = False

    app_builder.add_property_group(AnsibleProperties())
    app_builder.add_property_group(ProcessProperties())
    app_builder.add_property_group(AdditionalResourceDriverProperties())
    app_builder.add_service_configurator(AnsibleServiceConfigurator())
    app_builder.add_service_configurator(AnsibleDriverHandlerConfigurator())

    return app_builder.configure()