Developper Guide

The goal of this chapter is to provide information on how POPPy works in the inside. It can be useful to add features to the framework.

Workflow

../_images/launch_workflow.svg

Fig. 4 Workflow of the launching of a POPPy pipeline

The pipeline is launched through a poppy.pop.scripts.scripts.main() function starting the generation of the commands with the dedicated command module and then launches the good command according to the content of the CLI. A representation of the process is given in Fig. 4.

For details on the process:

  1. The poppy.core.command.CommandManager starts generating the commands. It sends the poppy.core.command.CommandManager.generation_start signal to inform connected objects that a generation started. A setup function as been connected at the import of the module to the command manager and is called before the generation.
  2. In the poppy.pop.scripts.scripts.setup() function, the available plugins are loaded from the settings.py file where activated plugins are inserted. This file is in the pipeline root directory.
  3. Since we introduce new code in the pipeline through plugins, we need to add our handlers of the logs into the loggers defined by the plugins (poppy.pop.scripts.scripts.setLogger()).
  4. Plugins are loaded if we can import them correctly, and if the process of loading a plugin into the pipeline worked. See plugins.
  5. All slots of the signal have been treated it, so the main function says to the rgts_library.tools.command.CommandManager to launch the command from the informations provided in the CLI. A signal rgts_library.tools.command.CommandManager.run_start with the parsed CLI arguments in argument of the signal is emitted. An poppy.pop.scripts.scripts.pipeline_init() function has already been connected to this signal at module importation.
  6. The init of the pipeline starts by loading the configuration file selected on the CLI or at the default path and read the data inside it. It checks that the configuration file is valid against the schema.
  7. From information inside the configuration file, the databases are loaded (rgts_library.tools.database.load_databases()).
  8. Finally, the descriptor is also loaded. With it, the pipeline can access all information on versions for softwares as needed.

Then the selected command takes the control and run.

API

poppy.pop.scripts.scripts.main(argv=None)[source]

The main function, called when the pop program is running.

poppy.pop.scripts.scripts.setup(options)[source]

Responsible of the setup before the generation of commands.

poppy.pop.scripts.scripts.load_config(config_path, schema_path)[source]

Load the data in the configuration file and set it in the class.

poppy.pop.scripts.scripts.load_descriptor(path, schema_path)[source]

Load the data in the descriptor file and set it in the class.

poppy.pop.scripts.scripts.set_config(args)[source]

Set the file name where are stored the configuration parameters.

poppy.pop.scripts.scripts.set_descriptor(args)[source]

Set the file name where are stored the descriptors.

poppy.pop.scripts.scripts.pipeline_init(args)[source]

Used to init some things in the pipeline, without interacting with it directly, allowing to reuse the commands defined for the pipeline from an other environment where the databases, configuration, etc are already set.

poppy.pop.scripts.scripts.pipeline_init(args)[source]

Used to init some things in the pipeline, without interacting with it directly, allowing to reuse the commands defined for the pipeline from an other environment where the databases, configuration, etc are already set.

poppy.pop.scripts.scripts.setup(options)[source]

Responsible of the setup before the generation of commands.