netunicorn.client.remote.RemoteClient¶
- class RemoteClient(endpoint, login, password, authentication_context=None)[source]¶
Bases:
BaseClient
Remote client for Unicorn.
- Parameters:
endpoint (
str
) – netunicorn endpointlogin (
str
) – netunicorn loginpassword (
str
) – netunicorn passwordauthentication_context (
Optional
[Dict
[str
,Dict
[str
,str
]]], default:None
) – authentication context for connectors
Attributes
netunicorn installation endpoint.
netunicorn user login.
netunicorn user password.
Authentication context for connectors.
Methods
Cancel particular executors.
Cancel experiment execution.
Delete experiment from the system (to release experiment name).
Get information about all experiments that belong to the current user.
Get flag values for a particular flag of the experiment.
Return nodes currently available to the current user.
Check if the current netunicorn instance is healthy.
Set flag values for a particular flag of the experiment.
- authentication_context[source]¶
Authentication context for connectors. E.g., if a connector requires users to provide additional security tokens, it could be specified here. Format: {connector_name: {key: value}}
- healthcheck()[source]¶
Check if the current netunicorn instance is healthy.
- Returns:
bool
– True if core service is healthy
- get_nodes()[source]¶
Return nodes currently available to the current user.
- Returns:
Nodes
– Nodes object with available nodes
- delete_experiment(experiment_name)[source]¶
Delete experiment from the system (to release experiment name).
- Parameters:
experiment_name (
str
) – name of the experiment to delete- Return type:
None
- get_experiments()[source]¶
Get information about all experiments that belong to the current user.
- Returns:
Dict
[str
,ExperimentExecutionInformation
] – dictionary of {experiment-name: experiment information}
- prepare_experiment(experiment, experiment_id, deployment_context=None)[source]¶
- Prepare an Experiment. Server will start compiling and distributing the environment among nodes.You can check status of preparation by calling ‘get_experiment_status’ function and checking if it’s in “READY” status.You need to provide a per-user unique experiment name.This method is network-failure-safe: subsequent calls with the same network name will not create additional deployment processes.
- Parameters:
experiment (
Experiment
) – experiment to prepareexperiment_id (
str
) – user-wide unique experiment namedeployment_context (
Optional
[Dict
[str
,Dict
[str
,str
]]], default:None
) – deployment context for connectors specific for each connector, format: {connector_name: {key: value}, …}
- Returns:
str
– the same experiment_id if everything’s correct
- start_execution(experiment_id, execution_context=None)[source]¶
- Start execution of prepared experiment.You can check status and results of an experiment by calling ‘get_experiment_status’ function and checking if it’s in “FINISHED” status.You need to provide an experiment_id of prepared experiment to start.This method is network-failure-safe - subsequent calls with the same experiment id will not create additional start process.
- Parameters:
experiment_id (
str
) – prepared experiment idexecution_context (
Optional
[Dict
[str
,Dict
[str
,str
]]], default:None
) – execution context for connectors specific for each connector, format: {connector_name: {key: value}, …}
- Returns:
str
– the same experiment_id if execution already in progress or finished
- get_experiment_status(experiment_id)[source]¶
- Return status and results of experiment.If experiment preparation succeed, you can explore map to see what nodes are prepared for deployment.If experiment finished, you can explore results of the experiment
- Parameters:
experiment_id (
str
) – id of the experiment returned by ‘prepare_experiment’ function- Returns:
ExperimentExecutionInformation
– current status of the experiment, optionally experiment definition, optionally experiment results
- cancel_experiment(experiment_id, cancellation_context=None)[source]¶
Cancel experiment execution.
- Parameters:
experiment_id (
str
) – id of the experimentcancellation_context (
Optional
[Dict
[str
,Dict
[str
,str
]]], default:None
) – cancellation context for connectors specific for each connector, format: {connector_name: {key: value}, …}
- Returns:
str
– the same experiment_id if everything’s correct
- cancel_executors(executors, cancellation_context=None)[source]¶
Cancel particular executors.
- Parameters:
executors (
Iterable
[str
]) – list of executors to cancelcancellation_context (
Optional
[Dict
[str
,Dict
[str
,str
]]], default:None
) – cancellation context for connectors specific for each connector, format: {connector_name: {key: value}, …}
- Returns:
str
– the same experiment_id if everything’s correct
- get_flag_values(experiment_id, flag_name)[source]¶
Get flag values for a particular flag of the experiment.
- Parameters:
experiment_id (
str
) – id of the experimentflag_name (
str
) – name of the flag
- Returns:
FlagValues
– flag values (string, int, or both)
- set_flag_values(experiment_id, flag_name, flag_values)[source]¶
Set flag values for a particular flag of the experiment.
- Parameters:
experiment_id (
str
) – id of the experimentflag_name (
str
) – name of the flagflag_values (
FlagValues
) – flag values (string, int, or both)
- Return type:
None