Deployment API Reference
The Freva deployment Class
Module to run the freva deployment.
- class freva_deployment.deploy.DeployFactory(steps: Optional[list[str]] = None, config_file: Optional[Union[Path, str]] = None)[source]
Bases:
object
Apply freva deployment and its services.
- Parameters
project_name (str) – The name of the project to distinguish this instance from others.
steps (list[str], default: ["services", "core", "web"]) – The components that are going to be deployed.
config_file (os.PathLike, default: None) – Path to any existing deployment configuration file.
Examples
>>> from freva_deployment import DeployFactory as DF >>> deploy = DF(steps=["solr"]) >>> deploy.play(ask_pass=True)
- property aux_dir: Path
Directory with auxillary files.
- property chain_key_file: str
Path to the private key file.
- property db_pass: str
Create a password for the database.
- play(server_map: Optional[str] = None, ask_pass: bool = True, verbosity: int = 0) None [source]
Play the ansible playbook.
- Parameters
server_map (str, default: None) – Hostname running the service that keeps track of the server infrastructure, if None given (default) no new deployed services are added.
ask_pass (bool, default: True) – Instruct Ansible to ask for the ssh passord instead of using a ssh key
verbosity (int, default: 0) – Verbosity level, default 0
- property playbook_dir: Path
The location of all playbooks.
- property private_key_file: str
Path to the private key file.
- property public_key_file: str
Path to the public certificate file.
- property python_prefix: Path
Get the path of the new conda evnironment.
- step_order: tuple[str, ...] = ('vault', 'db', 'solr', 'core', 'web')
- property steps: list[str]
Set all the deploment steps.
The Deployment Text User Interface
The Freva deployment Text User Interface (TUI) helps to configure a deployment setup for a new instance of freva.
- class freva_deployment.ui.deployment_tui.main_window.MainApp[source]
Bases:
NPSAppManaged
- property cache_dir: Path
The user cachedir.
- config: dict[str, Any] = {}
- save_dialog(*args, **kwargs) None [source]
Create a dialoge that allows for saving the config file.
- property save_file: str
Read the file that stores the configuration from the cache.
- property steps: list[str]
Get the deploy steps.
- class freva_deployment.ui.deployment_tui.base.BaseForm(*args, **keywords)[source]
Bases:
FormMultiPageWithMenus
,FormWithMenus
Base class for forms.
- certificates: list[str] = []
The type of certificate files this step needs.
- change_forms(*args, reverse=False, **keywords) None [source]
Cycle between the deployment config forms.
- check_config(notify: bool = True) dict[str, str | dict[str, str | list | int | bool | None]] | None [source]
Check if the from entries are valid.
- input_fields: dict[str, tuple[npyscreen.wgtitlefield.TitleText, bool]] = {}
the key of the dictionary represents the name of the key in the in config toml input files. Values represent a tuple of npysceen types that display the input information on this key to the user and a boolean indicating whether or not this variable is mandatory.
- Type
Dictionary of input fileds
- property num: str
Calculate the number for enumerations of any input field.
- class freva_deployment.ui.deployment_tui.base.FileSelector(*args, file_extentions: str | list[str] = ['.toml'], **kwargs)[source]
Bases:
FileSelector
FileSelector widget that allows for filtering file extensions.
- file_extentions: list[str]
List of allowed file extensions.
- value: str
The value of this file selector.
- freva_deployment.ui.deployment_tui.base.selectFile(starting_value: str = '', *args, **keywords)[source]
- class freva_deployment.ui.deployment_tui.deploy_forms.CoreScreen(*args, **keywords)[source]
Bases:
BaseForm
Form for the core deployment configuration.
- certificates: list[str] = ['public']
The type of certificate files this step needs.
- property scheduler_systems
Define available scheduler systems.
- step: str = 'core'
Name of this step.
- class freva_deployment.ui.deployment_tui.deploy_forms.DBScreen(*args, **keywords)[source]
Bases:
BaseForm
Form for the core deployment configuration.
- step: str = 'db'
- class freva_deployment.ui.deployment_tui.deploy_forms.RunForm(display_pages=True, pages_label_color='NORMAL', *args, **keywords)[source]
Bases:
FormMultiPageAction
Definition of the form that applies the actual deployment.
- property num: str
Calculate the number for enumerations of any input field.
- class freva_deployment.ui.deployment_tui.deploy_forms.SolrScreen(*args, **keywords)[source]
Bases:
BaseForm
Form for the solr deployment configuration.
- step: str = 'solr'
- class freva_deployment.ui.deployment_tui.deploy_forms.WebScreen(*args, **keywords)[source]
Bases:
BaseForm
Form for the web deployment configuration.
- certificates: list[str] = ['public', 'private', 'chain']
The type of certificate files this step needs.
- step: str = 'web'
- freva_deployment.ui.deployment_tui.deploy_forms.get_index(values: list[str], target: str, default: int = 0) int [source]
Get the target index of item in list.
- values:
the list of values that is searched
- target:
the item the list of values that is searched for
- default:
if nothing is found return the default value
int: Index of the the target item in the list