use of io.seldon.protos.DeploymentProtos.DeploymentSpec in project seldon-core by SeldonIO.
the class SeldonGrpcServer method getChannel.
/**
* Using the principal from authorization return a client gRPC channel to connect to the engine running the prediction graph.
* @return ManagedChannel
*/
public ManagedChannel getChannel() {
final String principal = getPrincipal();
if (principal == null) {
throw new SeldonAPIException(SeldonAPIException.ApiExceptionType.APIFE_GRPC_NO_PRINCIPAL_FOUND, "");
}
final DeploymentSpec deploymentSpec = deploymentStore.getDeployment(principal);
if (deploymentSpec == null) {
throw new SeldonAPIException(SeldonAPIException.ApiExceptionType.APIFE_NO_RUNNING_DEPLOYMENT, "Principal is " + principal);
}
ManagedChannel channel = channelStore.get(principal);
if (channel == null) {
throw new SeldonAPIException(SeldonAPIException.ApiExceptionType.APIFE_GRPC_NO_GRPC_CHANNEL_FOUND, "Principal is " + principal);
}
return channel;
}
use of io.seldon.protos.DeploymentProtos.DeploymentSpec in project seldon-core by SeldonIO.
the class DeploymentStore method deploymentAdded.
@Override
public void deploymentAdded(SeldonDeployment mlDep) {
final DeploymentSpec deploymentDef = mlDep.getSpec();
deploymentStore.put(deploymentDef.getOauthKey(), deploymentDef);
clientDetailsService.addClient(deploymentDef.getOauthKey(), deploymentDef.getOauthSecret());
logger.info("Succesfully added or updated deployment " + deploymentDef.getName());
}
use of io.seldon.protos.DeploymentProtos.DeploymentSpec in project seldon-core by SeldonIO.
the class DeploymentStore method deploymentRemoved.
@Override
public void deploymentRemoved(SeldonDeployment mlDep) {
final DeploymentSpec deploymentDef = mlDep.getSpec();
deploymentStore.remove(deploymentDef.getOauthKey());
clientDetailsService.removeClient(deploymentDef.getOauthKey());
logger.info("Removed deployment " + deploymentDef.getName());
}
Aggregations