Skip to content

Instantly share code, notes, and snippets.

@ricardozanini
Last active December 9, 2019 12:52
Show Gist options
  • Save ricardozanini/20cbc1b7768610cd86a6261f49a955b2 to your computer and use it in GitHub Desktop.
Save ricardozanini/20cbc1b7768610cd86a6261f49a955b2 to your computer and use it in GitHub Desktop.
Kogito Operator 0.6.0-rc3 launch test

Requirements

  1. Download and install crc
  2. Configure it to have at least 8 cpus and 16000 of memory available. Do not start it before setting this config.
crc config view
- cpus                                  : 8
- memory                                : 16000

Steps to test the Visa Travel App

  1. Deploy kogitocloud-operatorsource.yaml in your cluster to have 0.6.0-rc3 installed: oc apply -f kogitocloud-operatorsource.yaml

  2. Find the Kogito Operator in the "custom" channel and install it. After awhile you'll see Infinispan and Strimzi installed as well in the namespace

  3. Make sure to have Nexus installed (try Nexus Operator in the Operatorhub), since the build time will be improved a lot

  4. Change the MAVEN_MIRROR_URL environment variable in the kogito-travel-app.yaml to match your Nexus installation

  5. Deploy Infrastructure (infra.yaml), Data Index (dataindex.yaml) and the Visa Application (kogito-travel-app.yaml) with oc apply -f <file>

  6. Change the Config Map kogito-travel-app with the contents of the file in this gist

Troubleshooting

Data Index doesn't show travel or visa applications domain in GraphiQL

The config map takes time to be recognized by the Data Index service. To check if it's working, take a look at the "docs" tab and see if the domain data is there. Delete the pod and wait for the operator to recreate it, it should be fine and read the proto files after this.

apiVersion: v1
items:
- apiVersion: app.kiegroup.org/v1alpha1
kind: KogitoDataIndex
metadata:
name: kogito-data-index
spec:
image: quay.io/kiegroup/kogito-data-index:0.5.1
infinispan:
useKogitoInfra: true
kafka:
instance: kogito-kafka
replicas: 1
kind: List
metadata:
resourceVersion: ""
selfLink: ""
apiVersion: v1
items:
- apiVersion: app.kiegroup.org/v1alpha1
kind: KogitoInfra
metadata:
name: kogito-infra
spec:
installInfinispan: true
installKafka: true
kind: List
metadata:
resourceVersion: ""
selfLink: ""
kind: ConfigMap
apiVersion: v1
metadata:
annotations:
org.kie.kogito/managed-by: Kogito Operator
org.kie.kogito/operator-crd: KogitoDataIndex
name: kogito-data-index-protobufs
namespace: kogito
ownerReferences:
- apiVersion: app.kiegroup.org/v1alpha1
kind: KogitoDataIndex
name: kogito-data-index
controller: true
blockOwnerDeletion: true
labels:
app: kogito-data-index
data:
travels.proto: |-
syntax = "proto2";
package org.acme.travels.travels;
import "kogito-index.proto";
import "kogito-types.proto";
option kogito_model = "Travels";
option kogito_id = "travels";
/* @Indexed */
message Address {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string city = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string country = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string street = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string zipCode = 4;
}
/* @Indexed */
message Flight {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional kogito.Date arrival = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional kogito.Date departure = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string flightNumber = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string gate = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string seat = 5;
}
/* @Indexed */
message Hotel {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional Address address = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string bookingNumber = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string name = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string phone = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string room = 5;
}
/* @Indexed */
message Traveller {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional Address address = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string email = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string firstName = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string lastName = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string nationality = 5;
}
/* @Indexed */
message Travels {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional Flight flight = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional Hotel hotel = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string id = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional Traveller traveller = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional Trip trip = 5;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional VisaApplication visaApplication = 6;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
repeated org.kie.kogito.index.model.ProcessInstanceMeta processInstances = 7;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
repeated org.kie.kogito.index.model.UserTaskInstanceMeta userTasks = 8;
}
/* @Indexed */
message Trip {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional kogito.Date begin = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string city = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string country = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional kogito.Date end = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional bool visaRequired = 5;
}
/* @Indexed */
message VisaApplication {
option java_package = "org.acme.travels.travels";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional bool approved = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string city = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string country = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional int32 duration = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string firstName = 5;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string lastName = 6;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string nationality = 7;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string passportNumber = 8;
}
visaApplications.proto: |-
syntax = "proto2";
package org.acme.travels.visaApplications;
import "kogito-index.proto";
import "kogito-types.proto";
option kogito_model = "VisaApplications";
option kogito_id = "visaApplications";
/* @Indexed */
message VisaApplication {
option java_package = "org.acme.travels.visaApplications";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional bool approved = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string city = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string country = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional int32 duration = 4;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string firstName = 5;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string lastName = 6;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string nationality = 7;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string passportNumber = 8;
}
/* @Indexed */
message VisaApplications {
option java_package = "org.acme.travels.visaApplications";
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional string id = 1;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
optional VisaApplication visaApplication = 2;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
repeated org.kie.kogito.index.model.ProcessInstanceMeta processInstances = 3;
/* @Field(store = Store.YES, analyze = Analyze.YES) */
repeated org.kie.kogito.index.model.UserTaskInstanceMeta userTasks = 4;
}
apiVersion: v1
items:
- apiVersion: app.kiegroup.org/v1alpha1
kind: KogitoApp
metadata:
name: kogito-travel-agency
spec:
build:
env:
- name: MAVEN_MIRROR_URL
value: http://nexus3-nexus.apps-crc.testing/repository/maven-public/
gitSource:
contextDir: 05-kogito-travel-agency
reference: override-bootstrap
uri: https://github.com/ricardozanini/kogito-travel-agency-tutorial
imageRuntime:
imageStreamTag: 0.6.0-rc3
imageS2I:
imageStreamTag: 0.6.0-rc3
resources: {}
env:
- name: MP_MESSAGING_INCOMING_VISASAPPROVED_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_INCOMING_VISASREJECTED_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_VISAAPPLICATIONS_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_KOGITO_PROCESSINSTANCES_EVENTS_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_KOGITO_USERTASKINSTANCES_EVENTS_BOOTSTRAP_SERVERS
- name: JAVA_OPTIONS
value: -Dquarkus.log.level=DEBUG -Dquarkus.log.console.level=DEBUG -Dquarkus.log.category."org.apache.kafka".level=INFO
infra:
installInfinispan: Always
installKafka: Always
resources: {}
runtime: quarkus
service: {}
- apiVersion: app.kiegroup.org/v1alpha1
kind: KogitoApp
metadata:
name: kogito-visas
spec:
build:
env:
- name: MAVEN_MIRROR_URL
value: http://nexus3-nexus.apps-crc.testing/repository/maven-public/
gitSource:
contextDir: 05-kogito-visas
reference: override-bootstrap
uri: https://github.com/ricardozanini/kogito-travel-agency-tutorial
imageRuntime:
imageStreamTag: 0.6.0-rc3
imageS2I:
imageStreamTag: 0.6.0-rc3
resources: {}
env:
- name: MP_MESSAGING_INCOMING_VISAAPPLICATIONS_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_VISASAPPROVED_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_VISASREJECTED_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_KOGITO_PROCESSINSTANCES_EVENTS_BOOTSTRAP_SERVERS
- name: MP_MESSAGING_OUTGOING_KOGITO_USERTASKINSTANCES_EVENTS_BOOTSTRAP_SERVERS
- name: JAVA_OPTIONS
value: -Dquarkus.log.level=DEBUG -Dquarkus.log.console.level=DEBUG -Dquarkus.log.category."org.apache.kafka".level=INFO
infra:
installInfinispan: Always
installKafka: Always
resources: {}
runtime: quarkus
service: {}
kind: List
metadata:
resourceVersion: ""
selfLink: ""
apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
name: kogitocloud-operator
namespace: openshift-marketplace
spec:
type: appregistry
endpoint: https://quay.io/cnr
registryNamespace: kiegroup
displayName: "Kogito Cloud Operators"
publisher: "Red Hat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment