Note : The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see Seldon CLI .
Copy import os
os . environ [ "NAMESPACE" ] = "seldon-mesh"
Copy MESH_IP = !kubectl get svc seldon - mesh - n $ { NAMESPACE } - o jsonpath = ' {.status.loadBalancer.ingress[0].ip} '
MESH_IP = MESH_IP [ 0 ]
import os
os . environ [ 'MESH_IP' ] = MESH_IP
MESH_IP
Custom Server with Capabilities
The capabilities
field replaces the capabilities from the ServerConfig.
Copy cat ./servers/custom-mlserver-capabilities.yaml
Copy apiVersion : mlops.seldon.io/v1alpha1
kind : Server
metadata :
name : mlserver-134
spec :
serverConfig : mlserver
capabilities :
- mlserver-1.3.4
podSpec :
containers :
- image : seldonio/mlserver:1.3.4
name : mlserver
Copy kubectl create -f ./servers/custom-mlserver-capabilities.yaml -n ${NAMESPACE}
Copy server.mlops.seldon.io/mlserver-134 created
Copy kubectl wait --for condition=ready --timeout=300s server --all -n ${NAMESPACE}
Copy server.mlops.seldon.io/mlserver condition met
server.mlops.seldon.io/mlserver-134 condition met
server.mlops.seldon.io/triton condition met
Copy cat ./models/iris-custom-requirements.yaml
Copy apiVersion : mlops.seldon.io/v1alpha1
kind : Model
metadata :
name : iris
spec :
storageUri : "gs://seldon-models/mlserver/iris"
requirements :
- mlserver-1.3.4
Copy kubectl create -f ./models/iris-custom-requirements.yaml -n ${NAMESPACE}
Copy model.mlops.seldon.io/iris created
Copy kubectl wait --for condition=ready --timeout=300s model --all -n ${NAMESPACE}
Copy model.mlops.seldon.io/iris condition met
Copy seldon model infer iris --inference-host ${MESH_IP} :80 \
'{"inputs": [{"name": "predict", "shape": [1, 4], "datatype": "FP32", "data": [[1, 2, 3, 4]]}]}'
Copy {
"model_name" : "iris_1" ,
"model_version" : "1" ,
"id" : "057ae95c-e6bc-4f57-babf-0817ff171729" ,
"parameters" : {} ,
"outputs" : [
{
"name" : "predict" ,
"shape" : [
1 ,
1
] ,
"datatype" : "INT64" ,
"parameters" : {
"content_type" : "np"
} ,
"data" : [
2
]
}
]
}
Copy kubectl delete -f ./models/iris-custom-server.yaml -n ${NAMESPACE}
Copy model.mlops.seldon.io "iris" deleted
Copy kubectl delete -f ./servers/custom-mlserver.yaml -n ${NAMESPACE}
Copy server.mlops.seldon.io "mlserver-134" deleted
The extraCapabilities
field extends the existing list from the ServerConfig.
Copy cat ./servers/custom-mlserver.yaml
Copy apiVersion : mlops.seldon.io/v1alpha1
kind : Server
metadata :
name : mlserver-134
spec :
serverConfig : mlserver
extraCapabilities :
- mlserver-1.3.4
podSpec :
containers :
- image : seldonio/mlserver:1.3.4
name : mlserver
Copy kubectl create -f ./servers/custom-mlserver.yaml -n ${NAMESPACE}
Copy server.mlops.seldon.io/mlserver-134 created
Copy kubectl wait --for condition=ready --timeout=300s server --all -n ${NAMESPACE}
Copy server.mlops.seldon.io/mlserver condition met
server.mlops.seldon.io/mlserver-134 condition met
server.mlops.seldon.io/triton condition met
Copy cat ./models/iris-custom-server.yaml
Copy apiVersion : mlops.seldon.io/v1alpha1
kind : Model
metadata :
name : iris
spec :
storageUri : "gs://seldon-models/mlserver/iris"
server : mlserver-134
Copy kubectl create -f ./models/iris-custom-server.yaml -n ${NAMESPACE}
Copy model.mlops.seldon.io/iris created
Copy kubectl wait --for condition=ready --timeout=300s model --all -n ${NAMESPACE}
Copy model.mlops.seldon.io/iris condition met
Copy seldon model infer iris --inference-host ${MESH_IP} :80 \
'{"inputs": [{"name": "predict", "shape": [1, 4], "datatype": "FP32", "data": [[1, 2, 3, 4]]}]}'
Copy {
"model_name" : "iris_1" ,
"model_version" : "1" ,
"id" : "a3e17c6c-ee3f-4a51-b890-6fb16385a757" ,
"parameters" : {} ,
"outputs" : [
{
"name" : "predict" ,
"shape" : [
1 ,
1
] ,
"datatype" : "INT64" ,
"parameters" : {
"content_type" : "np"
} ,
"data" : [
2
]
}
]
}
Copy kubectl delete -f ./models/iris-custom-server.yaml -n ${NAMESPACE}
Copy model.mlops.seldon.io "iris" deleted
Copy kubectl delete -f ./servers/custom-mlserver.yaml -n ${NAMESPACE}
Copy server.mlops.seldon.io "mlserver-134" deleted