Пример #1
0
    def DangerouslyDeleteBento(self, request, context=None):
        try:
            # TODO: validate request
            bento_pb = self.bento_metadata_store.get(request.bento_name,
                                                     request.bento_version)
            if not bento_pb:
                msg = (
                    f"BentoService {request.bento_name}:{request.bento_version} "
                    f"has already been deleted")
                return DangerouslyDeleteBentoResponse(
                    status=Status.ABORTED(msg))

            logger.debug('Deleting BentoService %s:%s', request.bento_name,
                         request.bento_version)
            self.bento_metadata_store.dangerously_delete(
                request.bento_name, request.bento_version)
            self.repo.dangerously_delete(request.bento_name,
                                         request.bento_version)
            return DangerouslyDeleteBentoResponse(status=Status.OK())
        except BentoMLException as e:
            logger.error("RPC ERROR DangerouslyDeleteBento: %s", e)
            return DangerouslyDeleteBentoResponse(status=e.status_proto)
        except Exception as e:
            logger.error("RPC ERROR DangerouslyDeleteBento: %s", e)
            return DangerouslyDeleteBentoResponse(status=Status.INTERNAL())
Пример #2
0
 def DangerouslyDeleteBento(self, request, context=None):
     try:
         # TODO: validate request
         self.bento_metadata_store.dangerously_delete(
             request.bento_name, request.bento_version
         )
         self.repo.dangerously_delete(request.bento_name, request.bento_version)
         return DangerouslyDeleteBentoResponse(status=Status.OK())
     except BentoMLException as e:
         logger.error("RPC ERROR DangerouslyDeleteBento: %s", e)
         return DangerouslyDeleteBentoResponse(status=e.status_proto)
Пример #3
0
 def DangerouslyDeleteBento(self, request, context=None):
     try:
         # TODO: validate request
         self.bento_metadata_store.dangerously_delete(
             request.bento_name, request.bento_version
         )
     except BentoMLException as e:
         logger.error("INTERNAL ERROR: %s", e)
         return DangerouslyDeleteBentoResponse(status=Status.INTERNAL(str(e)))