genvid.toolbox.ProjectTool

Warning

This module has been deprecated. Although the code is still working for our oldest model, it is not expected to work with the new Bastion API. Please use the new genvid-sdk tool.

class genvid.toolbox.ProjectTool(**kwargs)

Bases: genvid.toolbox.consul_template.ConsulTemplateTool

Tool for managing project files.

Changed in version 1.30.0: LOGS have been moved to ClusterTool and it’s now considered deprecated.

Deprecated since version 1.33.0: Deprecated class. Use ConfigurationLoader instead.

get_project_file(dir_or_file)

Return a project file.

The argument can be either a directory or a project file. If it is a directory, the following files will be searched in this order inside the directory: genvid.hcl, genvid.json.

load_config_folder(source: typing.Union[pathlib.Path, str], *, env: typing.Union[typing.Mapping[str, str], NoneType] = None, job_template_dir: typing.Union[pathlib.Path, str, NoneType] = None, with_consul_template: bool = False) → dict

Loads the configuration file(s) (all files in a directory or a specific file) from the source and returns it.

Deprecated since version 1.33.0: See ConfigurationLoader.load_config_folder() for more information.

load_nomad_job_template(name, job_folder: typing.Union[pathlib.Path, str])

Read nomad job templates from the specific directory. Files only with extension of .nomad.tmpl are read.

Deprecated since version 1.33.0: See ConfigurationLoader.load_nomad_job_template() for more information.

load_project(dir_or_file: str, **kwargs)

Load a project file.

A project file is either a JSON or HCL file (called either genvid.json or genvid.hcl) which may or may not contain templating directives to be resolved using consul-template.

This method sets PROJECTDIR to the directory containing the project file as a side effect.

Parameters:
  • dir_or_file – The specified path is going to be recursively searched to locate a genvid.json or genvid.hcl project file.
  • kwargs – All additional keyword parameters are going to be passed directly to consul-template.

Note

The Consul server doesn’t need to run if your file doesn’t require anything from Consul. The result is parsed as either a JSON file if the extension is .json or an HCL file, otherwise.

update_config(config: dict, isLocal: bool)

Update the specified configuration.

Deprecated since version 1.33.0: See ConfigurationLoader.update_config() for more information.

update_project(project, _islocal=None) → typing.Tuple[dict, bool]

This method tries to update a project to the newer Genvid version.

Deprecated since version 1.33.0: Slightly equivalent to ConfigurationLoader.update_config()

class project.ProjectTool

Implementation of genvid.toolbox.ProjectTool