now.common.utils module#

now.common.utils.common_get_flow_env_dict(finetune_settings, encoder_uses, encoder_with, encoder_uses_with, pre_trained_embedding_size, indexer_uses, indexer_resources, user_input, tags)[source]#

Returns dictionary for the environments variables for the clip & music flow.yml files.

now.common.utils.common_setup(app_instance, user_input, dataset, encoder_uses, encoder_uses_with, indexer_uses, pre_trained_embedding_size, kubectl_path, encoder_with={}, indexer_resources={})[source]#
Return type

Dict

now.common.utils.get_email()[source]#
now.common.utils.get_indexer_config(num_indexed_samples, elastic=False, kubectl_path=None, deployment_type=None)[source]#

Depending on the number of samples, which will be indexed, indexer and its resources are determined.

Parameters
  • num_indexed_samples (int) – number of samples which will be indexed; should incl. chunks for e.g. text-to-video app

  • elastic (Optional[bool]) – hack to use ElasticIndexer, should be changed in future.

  • kubectl_path (Optional[str]) – path to kubectl binary

  • deployment_type (Optional[str]) – deployment type, e.g. ‘remote’ or ‘local’

Return type

Dict

Returns

dict with indexer and its resource config

now.common.utils.setup_elastic_service(kubectl_path)[source]#

Setup ElasticSearch service and return a connection string to connect to the service with.

Parameters

kubectl_path (str) – path to kubectl binary

Return type

str

Returns

connection string for connecting to the ElasticSearch service.