From d7b588ae92106be98eb3e10f887b9a98c74b7727 Mon Sep 17 00:00:00 2001 From: Andrew Scribner Date: Thu, 29 Feb 2024 16:24:13 -0500 Subject: [PATCH] add java to pmmlserver, add testing instructions --- pmmlserver/README.md | 32 ++++++++++++++++++++++++++++++++ pmmlserver/rockcraft.yaml | 10 ++++++++++ 2 files changed, 42 insertions(+) create mode 100644 pmmlserver/README.md diff --git a/pmmlserver/README.md b/pmmlserver/README.md new file mode 100644 index 0000000..7d6a667 --- /dev/null +++ b/pmmlserver/README.md @@ -0,0 +1,32 @@ +## Testing instructions + +From the [upstream usage example](https://kserve.github.io/website/master/modelserving/v1beta1/pmml/), this rock can be tested locally using: + +Launch the server with: +``` +# download the model locally +mkdir sample_model +gsutil cp -r gs://kfserving-examples/models/pmml ./sample_model/ + +# mount the model into the container at runtime +docker run -p 8080:8080 -v $(pwd)/sample_model/pmml:/mnt/models pmmlserver:0.11.2 --model_name test_model --model_dir=/mnt/models --http_port=8080 + +``` + +Test the server with: +``` +cat <> input.json +{ + "instances": [ + [5.1, 3.5, 1.4, 0.2] + ] +} +EOF + +curl -v \ + -H "Content-Type: application/json" \ + -d @./input.json \ + localhost:8080/v1/models/test_model:predict +``` + +which should return the expected output described in the docs. diff --git a/pmmlserver/rockcraft.yaml b/pmmlserver/rockcraft.yaml index 42e1a3c..ee41c2b 100644 --- a/pmmlserver/rockcraft.yaml +++ b/pmmlserver/rockcraft.yaml @@ -29,6 +29,16 @@ parts: dpkg-query --root=${CRAFT_PROJECT_DIR}/../bundles/ubuntu-22.04/rootfs/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) \ > ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query + java: + plugin: nil + build-packages: + - default-jdk + stage-packages: + - default-jdk + # Also stage the links for java executable + override-build: + ln -s /usr/lib/jvm/java-11-openjdk-amd64/bin/java $CRAFT_PART_INSTALL/usr/bin/java + python: plugin: nil source: https://github.com/kserve/kserve.git