コード例 #1
0
ファイル: gateway.py プロジェクト: openkim/openkim-pipeline
    def new(self, itemid, status='approved', priority='normal', force=False):
        """ New KIM object submitted to web-app """
        priority = network.transform_priority(priority)
        leader = database.get_leader(itemid).lower()
        approved = (status == 'approved')

        self.rsync_kimid(itemid, approved=approved)

        # insert this object into the database
        if database.isuuid(itemid):
            mongodb.insert_one_result(leader, itemid)
        else:
            mongodb.insert_one_object(itemid)

        # pass the message along to the director
        msg = network.director_update_message(
            itemid=itemid, status=status, priority=priority, force=force
        )
        self.send_job('pipeline.tasks.director_run', kwargs=msg)
コード例 #2
0
ファイル: gateway.py プロジェクト: openkim/openkim-pipeline
    def result(self, jobid, uuid, status='approved', priority='normal', force=False):
        # got an update request internally, a result or error has come in
        priority = network.transform_priority(priority)
        self.logger.debug("processing jobid %r" % jobid)
        leader = database.uuid_type(uuid)

        # insert the test result into the mongo database
        mongodb.insert_one_result(leader, uuid)

        # sync this test result / error to the webapp
        if not cf.GATEWAY_DISABLE_WRITE_RESULT:
            rsync_tools.gateway_write_result(leader, uuid)
            rsync_tools.ssh_touch_done(leader, uuid)

        # automatically recycle the result back into updates queue to
        # trigger dependency runs by the director (this it not the
        # same as the webapp queue!)
        if leader == 'tr':
            msg = network.director_update_message(
                itemid=uuid, status='approved', priority=priority, force=force
            )
            self.send_job('pipeline.tasks.director_run', kwargs=msg)