示例#1
0
文件: db.py 项目: yaronha/mlrun
    def _find_functions(self, session, name, project, uid, labels):
        query = self._query(session, Function, name=name, project=project)
        if uid:
            query = query.filter(Function.uid == uid)

        labels = label_set(labels)
        return self._add_labels_filter(session, query, Function, labels)
示例#2
0
文件: db.py 项目: zhuohuwu0603/mlrun
 def _find_runs(self, session, uid, project, labels, state):
     labels = label_set(labels)
     query = self._query(session,
                         Run,
                         uid=uid,
                         project=project,
                         state=state)
     return self._add_labels_filter(session, query, Run, labels)
示例#3
0
文件: db.py 项目: zhuohuwu0603/mlrun
    def _find_artifacts(self, session, project, uid, labels, since, until):
        labels = label_set(labels)
        query = self._query(session, Artifact, project=project)
        if uid != "*":
            if uid == "latest":
                query = self._latest_uid_filter(session, query)
            else:
                query = query.filter(Artifact.uid == uid)

        query = self._add_labels_filter(session, query, Artifact, labels)

        if since or until:
            since = since or datetime.min
            until = until or datetime.max
            query = query.filter(
                and_(Artifact.updated >= since, Artifact.updated <= until))

        return query