seldon-core
seldon-core copied to clipboard
How to make a container provide both transform and predict services
Describe the bug
apiVersion: machinelearning.seldon.io/v1alpha2
kind: SeldonDeployment
metadata:
name: gsrtestmodel
namespace: seldon-system
spec:
name: gsrtestmodel
predictors:
- componentSpecs:
- spec:
containers:
- name: gsrtestmodel
image: gsr/gsrtestmodel:9.1
graph:
name: gsrtestmodel
type: TRANSFORMER
children:
- name: gsrtestmodel
type: MODEL
children: []
name: modela
replicas: 1
When I request this service, I get an error
{"level":"info","ts":1655374213.173428,"logger":"entrypoint","msg":"gRPC server started"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x13e3dc5]
goroutine 173 [running]:
github.com/seldonio/seldon-core/executor/predictor.(*PredictorProcess).getPort(...)
/workspace/predictor/predictor_process.go:73
github.com/seldonio/seldon-core/executor/predictor.(*PredictorProcess).transformInput(0xc000210700, 0xc000286bb0, {0x1e7d328, 0xc0003615c0}, {0xc00005ccc0, 0x24})
/workspace/predictor/predictor_process.go:122 +0x3a5
github.com/seldonio/seldon-core/executor/predictor.(*PredictorProcess).Predict(0xc000210700, 0x0, {0x1e7d328, 0xc0003615c0})
/workspace/predictor/predictor_process.go:423 +0x78
github.com/seldonio/seldon-core/executor/predictor.(*PredictorProcess).predictChildren.func1(0x0, {{0xc000d4c2d0, 0xc}, {0x0, 0x0, 0x0}, 0xc00026a8c0, 0xc00026a8d0, 0x0, 0x0, ...}, ...)
/workspace/predictor/predictor_process.go:292 +0xd3
created by github.com/seldonio/seldon-core/executor/predictor.(*PredictorProcess).predictChildren
/workspace/predictor/predictor_process.go:291 +0x70f
If I use the configuration below, the program runs fine. Why can't we reuse the same container?
apiVersion: machinelearning.seldon.io/v1alpha2
kind: SeldonDeployment
metadata:
name: gsrtestmodel
namespace: seldon-system
spec:
name: gsrtestmodel
predictors:
- componentSpecs:
- spec:
containers:
- name: gsrtestmodel
image: gsr/gsrtestmodel:9.1
- name: gsrtestmodel1
image: gsr/gsrtestmodel:9.1
graph:
name: gsrtestmodel
type: TRANSFORMER
children:
- name: gsrtestmodel1
type: MODEL
children: []
name: modela
replicas: 1
To reproduce
Expected behaviour
Environment
Model Details
- Images of your model: [Output of:
kubectl get seldondeployment -n <yourmodelnamespace> <seldondepname> -o yaml | grep image:where<yourmodelnamespace>] - Logs of your model: [You can get the logs of your model by running
kubectl logs -n <yourmodelnamespace> <seldonpodname> <container>]
v1.31.1
This looks like a bug but the simplest solution for now would be to create a different named container with the same image. At present also transform_input and model-predict can not be performed on the same container. See here
Please see if v2 fits your needs here