Track¶
orion.storage.track
– Track Storage Protocol¶
-
class
orion.storage.track.
Track
(uri)[source]¶ Implement a generic protocol to allow Orion to communicate using different storage backend
Parameters: - uri: str
- Track backend to use for storage; the format is as follow
protocol://[username:password@]host1[:port1][,…hostN[:portN]]][/[database][?options]]
Attributes: - instance
Methods
count_broken_trials
(experiment)Count the number of broken trials count_completed_trials
(experiment)Count the number of completed trials create_experiment
(config)Insert a new experiment inside the database delete_experiment
([experiment, uid])Delete matching experiments from the database delete_trials
([experiment, uid, where])Delete matching trials from the database fetch_experiments
(query[, selection])Fetch all experiments that match the query fetch_lost_trials
(experiment)Fetch all trials that have a heartbeat older than some given time delta (5 minutes by default) fetch_noncompleted_trials
(experiment)Fetch all non completed trials fetch_pending_trials
(experiment)See fetch_pending_trials()
fetch_trials
([experiment, uid])See fetch_trials()
fetch_trials_by_status
(experiment, status)Fetch all trials with the given status get_trial
([trial, uid])See get_trials()
push_trial_results
(trial)Push the trial’s results to the database register_lie
(trial)Register a fake trial created by the strategist. register_trial
(trial)Create a new trial to be executed reserve_trial
(experiment)Select a pending trial and reserve it for the worker retrieve_result
(trial, *args, **kwargs)Fetch the result from a given medium (file, db, socket, etc..) for a given trial and insert it into the trial object set_trial_status
(trial, status[, heartbeat])Update the trial status and the heartbeat update_experiment
([experiment, uid, where])See update_experiment()
update_heartbeat
(trial)Update trial’s heartbeat update_trial
([trial, uid])Update the fields of a given trials update_trials
([experiment, uid, where])See update_trials()
-
fetch_lost_trials
(experiment)[source]¶ Fetch all trials that have a heartbeat older than some given time delta (5 minutes by default)
-
register_lie
(trial)[source]¶ Register a fake trial created by the strategist.
The main difference between fake trial and original ones is the addition of a fake objective result, and status being set to completed. The id of the fake trial is different than the id of the original trial, but the original id can be computed using the hashcode on parameters of the fake trial. See mod:
orion.core.worker.strategy
for more information and the Strategist object and generation of fake trials.Parameters: - trial: `Trial` object
Fake trial to register in the database
-
retrieve_result
(trial, *args, **kwargs)[source]¶ Fetch the result from a given medium (file, db, socket, etc..) for a given trial and insert it into the trial object
-
set_trial_status
(trial, status, heartbeat=None)[source]¶ Update the trial status and the heartbeat
Raises: - FailedUpdate
The exception is raised if the status of the trial object does not match the status in the database
-
class
orion.storage.track.
TrialAdapter
(storage_trial, orion_trial=None, objective=None)[source]¶ Mock Trial, see
Trial
Parameters: - storage_trial
Track trial object
- orion_trial
Orion trial object
- objective: str
objective key
Attributes: Methods
to_dict
()See Trial
-
heartbeat
¶ Trial Heartbeat