def test_seldon_xgboost_model_yaml(expected): m = Model( name="test-iris-xgboost", runtime=SeldonKubernetesRuntime(), platform=ModelFramework.XGBoost, uri="gs://seldon-models/xgboost/iris", local_folder="", ) assert m.to_k8s_yaml() == expected
def test_seldon_sklearn_model_yaml(expected): m = Model( name="test-iris-sklearn", runtime=SeldonKubernetesRuntime(), platform=ModelFramework.SKLearn, uri="gs://seldon-models/sklearn/iris", local_folder="", ) assert m.to_k8s_yaml() == expected
def test_deploy_yaml(): rt = SeldonDeployRuntime( host="http://34.105.136.157/seldon-deploy/api/v1alpha1", user="******", password="******", k8s_options=KubernetesOptions(namespace="seldon"), ) sklearn_model = Model( name="test-iris-sklearn", runtime=rt, platform=ModelFramework.SKLearn, uri="gs://seldon-models/sklearn/iris", local_folder=os.getcwd() + "/sklearn", ) srt = SeldonKubernetesRuntime(k8s_options=KubernetesOptions(namespace="seldon")) sklearn_model.set_runtime(srt) expected = sklearn_model.to_k8s_yaml() sklearn_model.set_runtime(rt) assert sklearn_model.to_k8s_yaml() == expected