def list_experiments(view): """ List all experiments in the configured tracking server. """ store = _get_store() view_type = ViewType.from_string(view) if view else ViewType.ACTIVE_ONLY experiments = store.list_experiments(view_type) table = [[exp.experiment_id, exp.name, exp.artifact_location if is_uri(exp.artifact_location) else os.path.abspath(exp.artifact_location)] for exp in experiments] print(tabulate(sorted(table), headers=["Experiment Id", "Name", "Artifact Location"]))
def _compute_path_value(self, user_param_value, storage_dir): if not data.is_uri(user_param_value): if not os.path.exists(user_param_value): raise ExecutionException("Got value %s for parameter %s, but no such file or " "directory was found." % (user_param_value, self.name)) return os.path.abspath(user_param_value) basename = os.path.basename(user_param_value) dest_path = os.path.join(storage_dir, basename) if dest_path != user_param_value: data.download_uri(uri=user_param_value, output_path=dest_path) return os.path.abspath(dest_path)
def list_experiments(file_store): """ List all experiment in FileStore backend. """ fs = store.FileStore(file_store) experiments = fs.list_experiments() table = [[ exp.experiment_id, exp.name, exp.artifact_location if is_uri( exp.artifact_location) else os.path.abspath(exp.artifact_location) ] for exp in experiments] print( tabulate(sorted(table), headers=["Experiment Id", "Name", "Artifact Location"]))
def _compute_uri_value(self, user_param_value): if not data.is_uri(user_param_value): raise ExecutionException("Expected URI for parameter %s but got " "%s" % (self.name, user_param_value)) return user_param_value
def test_is_uri(): assert is_uri("s3://some/s3/path") assert is_uri("dbfs:/some/dbfs/path") assert is_uri("file://some/local/path") assert not is_uri("/tmp/some/local/path")