beat.web.utils.management.commands.install module

Examples

To install advanced databases, formats, libraries, algorithms, toolchains, experiments and plotters:

$ ./bin/django install -v1 advanced

To install only test databases, formats, libraries, algorithms, toolchains, experiments and plotters:

$ ./bin/django install -v1 test

Note: If you need to specify your own path to the directories containing the databases, you could just create a simple JSON file as follows:

{
  "atnt/1": "/remote/databases/atnt",
  "banca/2": "/remote/databases/banca"
}

Then just use the previous script with the option --database-root-file:

$ ./bin/django install -v1 --database-root-file=<file.json>

By default, paths to the root of all databases are set to match the Idiap Research Institute filesystem organisation.

beat.web.utils.management.commands.install.add_user(name, passwd, token_key)[source]

Adds a simple platform user

beat.web.utils.management.commands.install.add_group(name)[source]
beat.web.utils.management.commands.install.setup_environment(queue_config_filename, verbosity)[source]
beat.web.utils.management.commands.install.create_sites()[source]
beat.web.utils.management.commands.install.create_users(username, passwd)[source]
beat.web.utils.management.commands.install.get_users(username)[source]
beat.web.utils.management.commands.install.list_objects(prefix, project, category, fnfilter)[source]

Lists all objects matching a certain filter

beat.web.utils.management.commands.install.detemplatize(template, data)[source]

Loads the json file and replaces the templates

Parameters
  • template (str) – The template to de-templatize using Jinja2

  • data (dict) – A dictionary containing the values that will be available to the template resolution.

Returns

Contains the resolved template

Return type

str

beat.web.utils.management.commands.install.upload_dataformat(prefix, name, data)[source]

Uploads the dataformat template to the platform, under a certain user

Parameters
  • prefix (str) – The prefix where the dataformat template is sitting

  • name (str) – The canonical name of the dataformat

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was succesful

Return type

bool

beat.web.utils.management.commands.install.upload_protocoltemplate(prefix, name, data, new_only=False)[source]

Uploads the protocol template to the platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was successful

Return type

bool

beat.web.utils.management.commands.install.load_database_folders(filename)[source]

Simply loads the json file describing the database root folders

Parameters

filename (str) – The path to the filename to be loaded.

Returns

A dictionary, containing the JSON data. If the file does not exist, then the returned dictionary is empty.

beat.web.utils.management.commands.install.upload_database(prefix, name, data, new_only=False)[source]

Uploads the database template to the platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was succesful

Return type

bool

beat.web.utils.management.commands.install.upload_toolchain(prefix, name, data)[source]

Uploads the toolchain to the running platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was succesful

Return type

bool

beat.web.utils.management.commands.install.upload_library(prefix, name, data)[source]

Uploads the library to a running platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was successful

Return type

bool

beat.web.utils.management.commands.install.upload_algorithm(prefix, name, data)[source]

Uploads the algorithm to a running platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was succesful

Return type

bool

beat.web.utils.management.commands.install.upload_experiment(prefix, name, data)[source]

Uploads the experiment to the running platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was succesful

Return type

bool

beat.web.utils.management.commands.install.upload_plotter(prefix, name, data)[source]

Uploads the plotter to a running platform

Parameters
  • prefix (str) – The prefix where the object template is sitting

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was succesful

Return type

bool

beat.web.utils.management.commands.install.upload_dispatcher(prefix, project, type, name, data)[source]

Uploads the experiment to the running platform

Parameters
  • prefix (str) – The path leading to the project prefixes

  • project (str) – The sub-directory where the object template is sitting

  • type (str) – The type of object to upload (one of dataformats, databases, libraries, algorithms, toolchains, experiments or plot_templates)

  • name (str) – The canonical name of the object

  • data (dict) – A dictionary with template substitutions

Returns

Indicates if the operation was successful

Return type

bool

Link object versions together

beat.web.utils.management.commands.install.install_contributions(source_prefix, project, assets, template_data, db_root_file=None)[source]

Installs all contributions for a given project

Parameters
  • source_prefix (str) – The path to the base directory containing the projects where objects must be installed from.

  • project (str) – The project within the source_prefix where to install objects from.

  • assets (list) – The list of assets to install, this allows to install only a reduced number of them for testing purpose or in production systems to only add new type of asset.

  • template_data (dict) – A dictionary containing standard template data for completing template objects installed on the project.

  • db_root_file (str, Optional) – Optional path to a JSON describing the database root for databases to be inserted. Database names not present at the project directory will be ignored.

class beat.web.utils.management.commands.install.Command[source]

Bases: django.core.management.base.BaseCommand

help = 'Uploads stock contributions into the database'
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

handle(*ignored, **arguments)[source]

The actual logic of the command. Subclasses must implement this method.