API Reference
- class firexapp.application.ExitSignalHandler(app: FireXBaseApp)[source]
Bases:
object
- first_warning = '\nExiting due to signal %s'
- last_warning = "\nFINE! We'll stop. But you might have leaked a celery instance or a broker instance."
- second_warning = '\nWe know! Have a little patience for crying out loud!'
- firexapp.application.import_microservices(plugins_files=None, imports: tuple | None = None) [] [source]
- class firexapp.celery_manager.CeleryManager(plugins=None, logs_dir=None, worker_log_level='debug', cap_concurrency=None, app='firexapp.engine', env=None, broker=None)[source]
Bases:
object
- property celery_bin
- celery_bin_name = 'celery'
- property celery_logs_dir
- property celery_pids_dir
- classmethod get_pid(logs_dir, workername, hostname='runner-j1aldqxs-project-33192579-concurrent-0')[source]
- classmethod get_pid_file(logs_dir, workername, hostname='runner-j1aldqxs-project-33192579-concurrent-0')[source]
- start(workername, queues=None, wait=True, timeout=900, concurrency=None, worker_log_level=None, app=None, cap_concurrency=None, cwd=None, soft_time_limit=None, autoscale: tuple | None = None, detach: bool = True)[source]
- property workers_logs_dir
- class firexapp.discovery.PkgVersionInfo(pkg=None, version=None, commit=None)[source]
Bases:
PkgVersionInfo
- firexapp.discovery.get_firex_dependant_package_versions() [<class 'firexapp.discovery.PkgVersionInfo'>] [source]
- firexapp.discovery.get_firex_tracking_services_entry_points() [<class 'entrypoints.EntryPoint'>] [source]
- firexapp.discovery.prune_duplicate_module_entry_points(entry_points) [<class 'entrypoints.EntryPoint'>] [source]
- class firexapp.plugins.CommaDelimitedListAction(option_strings, dest, nargs=None, **kwargs)[source]
Bases:
Action
- firexapp.plugins.identify_duplicate_tasks(all_tasks, priority_modules: list) [[]] [source]
Returns a list of substitution. Each substitution is a list of microservices. The last will be the ‘dominant’ one. It will be the one used.
- firexapp.plugins.merge_plugins(*plugin_lists) [] [source]
Merge comma delimited lists of plugins into a single list. Right-handed most significant plugin
- class firexapp.submit.arguments.InputConverter[source]
Bases:
object
This class uses a singleton object design to store converters which parse the cli arguments. Converter functions are stored into the singleton InputConverter object by adding the @register decorator to the top of each desired function.
- classmethod convert(pre_load=None, **kwargs) dict [source]
Activates conversion. kwargs provided are passed to any registered converter. This function should be called twice, and only twice. Once with initially loaded converters, and then with the secondary ones.
- Parameters:
pre_load – Used for testing. preload is defaulted to None and will auto populate
- pre_load_was_run = False
- classmethod register(*args)[source]
Registers a callable object to be run during conversion. The callable should take in kwargs, and return a dict with any changes to the input arguments, or None if no changes are necessary.
- Example single argument converter:
@InputConverter.register @SingleArgDecorator(‘something’) def convert_something(arg_value):
arg_value = arg_value.upper() return arg_value
- Optionally, dependencies can defined at registration:
@InputConverter.register(‘other_converter’, ‘and_another_converter’) @SingleArgDecorator(‘something’) def convert_something(arg_value):
arg_value = arg_value.upper() return arg_value
Conversion occurs on two occasions, before microservices are loaded, or after. You can explicitly mark a converter to run pre-loading or post-loading of the ALL microservices by passing True (pre) or False (post) during registration. This design is used in the spirit of failing fast, providing early failure of runs before the bulk of microservices are imported. If bool is not provided, it will register to run pre unless loading has already occurred.
@InputConverter.register(‘other_converter’, False) @SingleArgDecorator(‘something’) def convert_something(arg_value):
… return arg_value
When a conversion fails the given function can simply call raise to instruct the user how to correct their inputs.
- firexapp.submit.arguments.convert_booleans(kwargs)[source]
Converts standard true/false/none values to bools and None
- firexapp.submit.arguments.find_unused_arguments(chain_args: {}, ignore_list: [], all_tasks: [])[source]
Function to detect any arguments that are not explicitly consumed by any microservice.
- Note:
This should be run AFTER all microservices have been loaded.
- Parameters:
chain_args (dict) – The dictionary of chain args to check
ignore_list (list) – A list of exception arguments that are acceptable. This usually includes application args.
all_tasks – A list of all microservices. Usually app.tasks
- Returns:
A dictionary of un-applicable arguments
- firexapp.submit.arguments.get_chain_args(other_args: [])[source]
This function converts a flat list of –key value pairs into a dictionary
- firexapp.submit.arguments.whitelist_arguments(argument_list: str | list)[source]
Function for adding argument keys to the global argument whitelist. Used during validation of input arguments
:param argument_list:List of argument keys to whitelist. :type argument_list: list
- class firexapp.submit.console.FireXColoredConsoleFormatter(*args, **kwargs)[source]
Bases:
TTYColoredFormatter
- firexapp.submit.console.setup_console_logging(module=None, stdout_logging_level=20, console_logging_formatter=None, console_datefmt='%H:%M:%S', stderr_logging_level=40, module_logger_logging_level=None)[source]
- class firexapp.submit.reporting.ReportGenerator[source]
Bases:
ABC
- formatters = ()
- firexapp.submit.reporting.report(key_name=None, priority=-1, **formatters)[source]
Use this decorator to indicate what returns to include in the report and how to format it
- class firexapp.submit.submit.AdjustCeleryConcurrency(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]
Bases:
Action
- exception firexapp.submit.submit.FireXReturnCodeException(error_msg, firex_returncode)[source]
Bases:
Exception
- class firexapp.submit.submit.JsonFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]
Bases:
Action
- class firexapp.submit.submit.OptionalBoolean(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]
Bases:
Action
- class firexapp.submit.submit.SubmitBaseApp(submission_tmp_file=None)[source]
Bases:
object
- DEFAULT_MICROSERVICE = None
- SUBMISSION_LOGGING_FORMATTER = '[%(asctime)s %(levelname)s] %(message)s'
- static error_banner(err_msg, banner_title='ERROR', logf=<bound method Logger.error of <Logger firexapp.submit.submit (WARNING)>>)[source]
- install_configs: FireXInstallConfigs
- firexapp.submit.submit.safe_create_completed_run_json(uid, chain_result, run_revoked, chain_args)[source]
- class firexapp.submit.tracking_service.TrackingService[source]
Bases:
ABC
- get_pkg_version_info() PkgVersionInfo | None [source]
- install_configs: FireXInstallConfigs
- firexapp.submit.tracking_service.get_service_name(service: TrackingService) str [source]
- firexapp.submit.tracking_service.get_tracking_services() tuple[TrackingService] | None [source]
- firexapp.submit.tracking_service.get_tracking_services_versions() list[PkgVersionInfo] [source]
- class firexapp.submit.uid.FireXIdParts(user: str, timestamp: datetime.datetime, random_int: int)[source]
Bases:
object
- random_int: int
- timestamp: datetime
- user: str
- class firexapp.submit.uid.Uid(identifier=None, firex_requester=None)[source]
Bases:
object
- property base_logging_dir
- property debug_dir
- debug_dirname = 'firex_internal'
- property logs_dir
- property logs_url
- property resources_dir
- property run_data
- property viewers
- firexapp.submit.uid.get_firex_id_parts(maybe_firex_id: str) FireXIdParts | None [source]
- class firexapp.testing.config_base.FlowTestConfiguration[source]
Bases:
object
- property name
- run_data: FireXRunData | None
- class firexapp.testing.config_base.InterceptFlowTestConfiguration[source]
Bases:
FlowTestConfiguration
- class firexapp.testing.config_interpreter.ConfigInterpreter[source]
Bases:
object
- execution_directory = None
- static is_instance_of_intercept(test_config: FlowTestConfiguration)[source]
- static is_submit_command(test_config: FlowTestConfiguration)[source]
- tmp_json_file: str | None