In order to run this test, you have to setup your environment with java, mvn, docker and docker-compose. Tested with
openjdk 11.0.6 2020-01-14
apache-maven-3.6.3
Docker version 20.10.3, build 48d30b5
docker-compose version 1.25.2, build 698e2846
.
- Clone the repositories kiegroup/kogito-runtimes, kiegroup/kogito-apps and kiegroup/kogito-examples. In addition to that, checkout to the release branch: for example if the release is
1.8.x
, then run
git clone -b 1.8.x git@github.com:kiegroup/kogito-runtimes.git
git clone -b 1.8.x git@github.com:kiegroup/kogito-apps.git
git clone -b 1.8.x git@github.com:kiegroup/kogito-examples.git
- Compile kogito-runtimes and kogito-apps
mvn clean install -Dquickly -f kogito-runtimes/pom.xml
mvn clean install -DskipTests -f kogito-apps/pom.xml
- Ensure that explainability, trusty and trusty-ui images have been created with the command
docker images
the output should look like
REPOSITORY TAG IMAGE ID CREATED SIZE
org.kie.kogito/trusty-ui 1.8.0-SNAPSHOT fdeea29feca3 53 seconds ago 302MB
org.kie.kogito/trusty-service-infinispan 1.8.0-SNAPSHOT 49f8e61ddab6 4 minutes ago 291MB
org.kie.kogito/explainability-service-messaging 1.8.0-SNAPSHOT 391cd64555bb 7 minutes ago 312MB
- Compile and build the docker image for the kogito-example
dmn-tracing-quarkus
with
mvn clean package -Dquickly -f kogito-examples/kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml
docker build -t quay.io/test/dmn-tracing-quarkus:1.0.0 kogito-examples/dmn-tracing-quarkus/
-
Edit the file
kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
and replace thekogito-app
,explainability
,trusty
andtrusty-ui
images with the images you've just created. -
In the file
kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
, add the following env variable under thetrusty-service
spec:
TRUSTY_EXPLAINABILITY_ENABLED: "true"
Remember to replace in the following commands the release tag according to the release you are testing
sed -i 's/quay.io\/kiegroup\/kogito-explainability.*/org.kie.kogito\/explainability-service-messaging:1.8.0-SNAPSHOT/g' kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
sed -i 's/quay.io\/kiegroup\/kogito-trusty-infinispan.*/org.kie.kogito\/trusty-service-infinispan:1.8.0-SNAPSHOT/g' kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
sed -i '/QUARKUS_INFINISPAN_CLIENT_USE_AUTH.*/a \ TRUSTY_EXPLAINABILITY_ENABLED: "true"' kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
sed -i 's/quay.io\/kiegroup\/kogito-trusty-ui.*/org.kie.kogito\/trusty-ui:1.8.0-SNAPSHOT/g' kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
sed -i 's/KOGITO_TRUSTY_ENDPOINT/KOGITO_TRUSTY_HTTP_URL/g' kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
sed -i 's/<your_namespace>/test/g' kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml
- Run
docker-compose
docker-compose -f kogito-examples/trusty-demonstration/docker-compose/docker-compose.yml up
- Wait until the applications are deployed. Ensure that
trusty
,trusty-ui
,exaplainability
anddmn-tracing-quarkus
applications are up and running with
docker ps
the ouput should contain
40178dfef614 org.kie.kogito/trusty-ui:1.8.0-SNAPSHOT "java -Djava.util.lo…" 2 minutes ago Up 2 minutes 8778/tcp, 9779/tcp, 0.0.0.0:1338->8080/tcp
c390af97142b org.kie.kogito/explainability-service-messaging:1.8.0-SNAPSHOT "java -Djava.util.lo…" 2 minutes ago Up 2 minutes 8778/tcp, 9779/tcp, 0.0.0.0:1336->8080/tcp
fbdb71b52ec6 quay.io/test/dmn-tracing-quarkus:1.0.0 "/usr/local/s2i/run" 2 minutes ago Up 2 minutes 0.0.0.0:8080->8080/tcp
552551c42e6d org.kie.kogito/trusty-service-infinispan:1.8.0-SNAPSHOT "java -Djava.util.lo…" About a minute ago Up Less than a second 8778/tcp, 9779/tcp, 0.0.0.0:1337->8080/tcp
- Execute a decision
curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d \
'{
"Credit Score": 600,
"Loan Amount": 300000,
"Appraised Value": 500000,
"Best Rate": 0.03,
"Borrower": {
"Monthly Income": 10000,
"Monthly Other Debt": 1000
}
}' http://localhost:8080/Prequalification
- Open
http://localhost:1338/
and
- check that the execution is present in the list
- check that the outcomes of the decision are set
- check that the explainability graph is present
- check that the inputs are properly set in the UI
- check that the model section is showing the model properly
- Once you are done, you can do a bit of cleanup with
rm -rf kogito-examples kogito-runtimes kogito-apps
docker rmi -f $(docker images | grep '1.8.0-SNAPSHOT' | awk '{str = sprintf("%s:%s", $1, $2)} END {print str}')
Note that the command above will remove all the docker images that contain 1.8.0-SNAPSHOT
in the name. If you have any docker image that matches that and that you'd like to keep, don't use that command!
I found
mvn clean install -Dquickly -f kogito-apps/pom.xml
did not generate any docker images.I ran with
mvn clean install -DskipTests
within thekogito-apps
folder and everything was OK.