예제 #1
0
                        type=str,
                        default=os.environ.get(PARAMETERS_ENV_NAME, "[]"))
    args = parser.parse_args()

    parameters = parse_parameters(json.loads(args.parameters))

    if parameters.get(DEBUG_PARAMETER):
        parameters.pop(DEBUG_PARAMETER)
        DEBUG = True

    interface_file = importlib.import_module(args.interface_name)
    user_class = getattr(interface_file, args.interface_name)

    if args.persistence:
        user_object = persistence.restore(user_class, parameters, debug=DEBUG)
        persistence.persist(user_object, parameters.get("push_frequency"))
    else:
        user_object = user_class(**parameters)

    if args.service_type == "MODEL":
        import model_microservice as seldon_microservice
    elif args.service_type == "ROUTER":
        import router_microservice as seldon_microservice
    elif args.service_type == "TRANSFORMER":
        import transformer_microservice as seldon_microservice
    elif args.service_type == "OUTLIER_DETECTOR":
        import outlier_detector_microservice as seldon_microservice

    port = int(os.environ.get(SERVICE_PORT_ENV_NAME, DEFAULT_PORT))

    if args.api_type == "REST":
예제 #2
0
 def __exit__(self, exc_type, exc_val, exc_tb):
     self._assert_locked()
     if self.persist:
         # TODO should this be done async? we must dump state before releasing the lock, however
         persistence.persist(self)
예제 #3
0
 def __exit__(self, *_):
     if self.persist:
         # TODO should this be done async? we must dump state before releasing the lock, however
         persistence.persist(self)
     self.lock.release()
예제 #4
0
 def __exit__(self, exc_type, exc_val, exc_tb):
     self._assert_locked()
     if self.persist:
         # TODO should this be done async? we must dump state before releasing the lock, however
         persistence.persist(self)