Skip to content

Commit

Permalink
Add test for xgboost
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Gonzalez-Martin committed Sep 22, 2020
1 parent 998cc0b commit 7a8e9f2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
15 changes: 15 additions & 0 deletions testing/resources/iris-xgboost-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: machinelearning.seldon.io/v1alpha2
kind: SeldonDeployment
metadata:
name: xgboost
spec:
name: iris
protocol: kfserving
predictors:
- graph:
children: []
implementation: XGBOOST_SERVER
modelUri: gs://seldon-models/xgboost/iris
name: classifier
name: default
replicas: 1
30 changes: 28 additions & 2 deletions testing/scripts/test_prepackaged_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
rest_request,
log_sdep_logs,
)
from e2e_utils.v2_protocol import inference_request
from e2e_utils import v2_protocol
from conftest import SELDON_E2E_TESTS_USE_EXECUTOR

skipif_engine = pytest.mark.skipif(
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_sklearn_v2(self, namespace):
time.sleep(1)

logging.warning("Initial request")
r = inference_request(
r = v2_protocol.inference_request(
model_name="sklearn",
namespace=namespace,
payload={
Expand Down Expand Up @@ -117,6 +117,32 @@ def test_xgboost(self, namespace):
logging.warning("Success for test_prepack_xgboost")
run(f"kubectl delete -f {spec} -n {namespace}", shell=True)

@skipif_engine
def test_xgboost_v2(self, namespace):
spec = "../resources/iris-xgboost-v2.yaml"
retry_run(f"kubectl apply -f {spec} -n {namespace}")
wait_for_status("xgboost", namespace)
wait_for_rollout("xgboost", namespace)
time.sleep(1)

logging.warning("Initial request")
r = v2_protocol.inference_request(
model_name="xgboost",
namespace=namespace,
payload={
"inputs": [
{
"name": "input-0",
"shape": [4],
"datatype": "FP32",
"data": [[0.1, 0.2, 0.3, 0.4]],
}
],
},
)
assert r.status_code == 200
run(f"kubectl delete -f {spec} -n {namespace}", shell=True)

# Test prepackaged server for MLflow
@skipif_engine
def test_mlflow(self, namespace):
Expand Down

0 comments on commit 7a8e9f2

Please sign in to comment.