API Documentation for nua-agent¶
Package nua.agent¶
Module nua.agent.auto_install¶
Apply automated installation detection heuristics.
detect_and_install ¶
detect_and_install(directory)
Apply automated installation detection heuristics.
Package nua.agent.detectors¶
Module nua.agent.detectors.base_detector¶
Base class for detect and install project.
BaseDetector ¶
Base class for detect and install project.
BaseDetector.priority: permits to sort the tests order (lower value is higher
priority) of each detector upon a source directory. Thus testing dual installation
(ie: python+node) before single ones.
Module nua.agent.detectors.nodejs_yarn¶
Module nua.agent.detectors.python_source¶
Module nua.agent.detectors.python_wheels¶
Package nua.agent.scripts¶
Module nua.agent.scripts.app_builder¶
Install the configured application inside the container.
- information come from a mandatory local file: “nua-config.toml|json|yaml|yml”
- origin may be a source tar.gz or a git repository, python wheel
- build locally if source is python package
AppBuilder ¶
AppBuilder()
Class to hold config and other state information during build.
collect_meta_packages ¶
collect_meta_packages()
Return meta packages collected from the nua-config requirements and
connectors required by providers.
make_custom_document_root ¶
make_custom_document_root()
If the app defines a specific document root (i.e. /var/www/html).
copy_metadata ¶
copy_metadata()
Dump the content of the nua-config file in /nua/metadata/nua- config.json.
run_build_script ¶
run_build_script(code_installed)
Process the ‘build.py’ script if exists or the ‘build’ command.
The script is run from the directory of the nua-config.toml file.
build_with_command ¶
build_with_command()
Process the ‘build’ commands.
The script is run from the source directory.
build_with_auto_detection ¶
build_with_auto_detection(code_installed, pip_installed)
Build with a auto detect/install.
detect_and_install() is launched as root (the current user),
it’s the responsability of auto installer to switch to user nua.
Module nua.agent.templates¶
Utils to fill templates at the start of the container.
Template must be filled
- after volume mounts and environment initialization,
- before application start script.
Templater
dataclass
¶
render_config_templates ¶
render_config_templates()
Find files and templates in the /nua/templates folder and fill them.
Destination files may be on Docker-mounted volumes.
This function is expected to be run as root. Files are stored with 755 rights.
Files ending with .j2 are considered as Jinja2 templates.