Track¶
Track Storage Protocol¶
Implement a storage protocol to allow Orion to use track as a storage method.
- 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]]
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
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
orion.storage.base.BaseStorageProtocol.fetch_pending_trials()
fetch_trials
([experiment, uid, where])fetch_trials_by_status
(experiment, status)Fetch all trials with the given status
get_trial
([trial, uid])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, was])Update the trial status and the heartbeat
update_experiment
([experiment, uid, where])See
orion.storage.base.BaseStorageProtocol.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])- fetch_lost_trials(experiment)[source]¶
Fetch all trials that have a heartbeat older than some given time delta (5 minutes by default)
- fetch_pending_trials(experiment)[source]¶
See
orion.storage.base.BaseStorageProtocol.fetch_pending_trials()
- 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, was=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
- update_experiment(experiment=None, uid=None, where=None, **kwargs)[source]¶
See
orion.storage.base.BaseStorageProtocol.update_experiment()
- update_trial(trial=None, uid=None, **kwargs)[source]¶
Update the fields of a given trials
- Parameters
- trial: Trial
Trial object to update
- where: Optional[dict]
constraint trial must respect
- kwargs: dict
a dictionary of fields to update
- Returns
- returns 1 if the underlying storage was updated else 0
- 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
- property heartbeat¶
Trial Heartbeat