def test_undeploy_docker(sklearn_model: Model, docker_runtime: SeldonDockerRuntime): sklearn_model.deploy() time.sleep(2) sklearn_model.undeploy() with pytest.raises(docker.errors.NotFound): docker_runtime._get_container(sklearn_model.details)
def test_deploy_docker(sklearn_model: Model, docker_runtime: SeldonDockerRuntime): sklearn_model.deploy() time.sleep(2) container = docker_runtime._get_container(sklearn_model.details) assert container.status == "running" sklearn_model.undeploy()
def test_sklearn_docker(sklearn_model: Model, x_input): sklearn_model.deploy() time.sleep(2) y_pred = sklearn_model(x_input) np.testing.assert_allclose(y_pred, [[0, 0, 0.99]], atol=1e-2) sklearn_model.undeploy()
def k8s_sklearn_model(sklearn_model: Model, k8s_runtime: SeldonKubernetesRuntime) -> Generator[Model, None, None]: sklearn_model.runtime = k8s_runtime sklearn_model.deploy() sklearn_model.wait_ready(timeout_secs=60) yield sklearn_model sklearn_model.undeploy()
def k8s_sklearn_model( sklearn_model: Model, k8s_runtime: SeldonKubernetesRuntime) -> Generator[Model, None, None]: sklearn_model._runtime = k8s_runtime sklearn_model.deploy() time.sleep(40) yield sklearn_model sklearn_model.undeploy()