<jupyter_start><jupyter_text>R IRIS Model * Wrap an R decision-tree model (using the ```rpart``` library) for use as a prediction microservice in seldon-core   * Run locally on Docker to test   * Deploy on seldon-core running on minikube  Dependencies * [Helm](https://github.com/kubernetes/helm) * [Minikube](https://github.com/kubernetes/minikube) * [S2I](https://github.com/openshift/source-to-image) * R```bashpip install seldon-core``` Train locally<jupyter_code>!Rscript train.R<jupyter_output><empty_output><jupyter_text>Wrap model using s2i<jupyter_code>!s2i build . seldonio/seldon-core-s2i-r:0.1 r-iris:0.1
!docker run --name "iris_predictor" -d --rm -p 5000:5000 r-iris:0.1<jupyter_output>89dde681c929faae32ffa2ddd603399ec2ca725134efc9e8395f4cda28ee6698<jupyter_text>Send some random features that conform to the contract<jupyter_code>!seldon-core-tester contract.json 0.0.0.0 5000 -p
!docker rm iris_predictor --force<jupyter_output>iris_predictor<jupyter_text>Test using Minikube**Due to a [minikube/s2i issue](https://github.com/SeldonIO/seldon-core/issues/253) you will need [s2i >= 1.1.13](https://github.com/openshift/source-to-image/releases/tag/v1.1.13)**<jupyter_code>!minikube start --memory 4096
!kubectl create clusterrolebinding kube-system-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
!helm init
!kubectl rollout status deploy/tiller-deploy -n kube-system
!helm install ../../../helm-charts/seldon-core-operator --name seldon-core --set usageMetrics.enabled=true --namespace seldon-system
!kubectl rollout status statefulset.apps/seldon-operator-controller-manager -n seldon-system<jupyter_output>partitioned roll out complete: 1 new pods have been updated...<jupyter_text>Setup IngressThere are gRPC issues with the latest Ambassador, so we rewcommend 0.40.2 until these are fixed.<jupyter_code>!helm install stable/ambassador --name ambassador --set crds.keep=false
!kubectl rollout status deployment.apps/ambassador<jupyter_output>Waiting for deployment "ambassador" rollout to finish: 0 of 3 updated replicas are available...
Waiting for deployment "ambassador" rollout to finish: 1 of 3 updated replicas are available...
Waiting for deployment "ambassador" rollout to finish: 2 of 3 updated replicas are available...
deployment "ambassador" successfully rolled out<jupyter_text>Wrap Model and Test<jupyter_code>!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-r:0.1 r-iris:0.1
!kubectl create -f r_iris_deployment.json
!kubectl rollout status deploy/r-iris-deployment-r-iris-predictor-0cbaec2
!seldon-core-api-tester contract.json `minikube ip` `kubectl get svc ambassador -o jsonpath='{.spec.ports[0].nodePort}'` \
    seldon-deployment-example --namespace default -p
!minikube delete<jupyter_output>🔥  Deleting "minikube" from virtualbox ...
💔  The "minikube" cluster has been deleted.
{'fraction_non_alphanumeric': 0.11529083942877047, 'fraction_numerical': 0.034482758620689655, 'mean_word_length': 5.557077625570776, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 21, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '109691', 'license': 'Apache-2.0', 'n_tokens_mistral': 1078, 'n_tokens_neox': 994, 'n_words': 241, 'path': 'examples/models/r_iris/r_iris.ipynb', 'repo_name': 'Diffblue-benchmarks/Mjlodge-seldon-core', 'size': '2871'}