Skip to content

Commit

Permalink
Merge pull request #8 from rgdoliveira/sync_main
Browse files Browse the repository at this point in the history
Sync main branch with Apache main branch
  • Loading branch information
rgdoliveira authored Feb 5, 2024
2 parents 08787d8 + 79dc112 commit 4b0fad2
Show file tree
Hide file tree
Showing 47 changed files with 4,542 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ quarkus.log.level=INFO

mp.messaging.outgoing.kogito_outgoing_stream.connector=quarkus-http
mp.messaging.outgoing.kogito_outgoing_stream.url=http://0.0.0.0:8181

kogito.addon.messaging.outgoing.cloudEventMode=structured
1 change: 1 addition & 0 deletions kogito-quarkus-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<module>process-usertasks-quarkus-with-console</module>
<module>process-usertasks-quarkus</module>
<module>process-usertasks-timer-quarkus-with-console</module>
<module>process-usertasks-timer-data-index-persistence-addon-quarkus</module>
<module>process-usertasks-with-security-oidc-quarkus-with-console</module>
<module>process-usertasks-with-security-oidc-quarkus</module>
<module>process-usertasks-with-security-quarkus</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ quarkus.http.test-port=8282
quarkus.log.level=INFO

mp.messaging.outgoing.kogito_outgoing_stream.url=http://0.0.0.0:8181

kogito.addon.messaging.outgoing.cloudEventMode=structured

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
svg/
persistence/
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Kogito and Infrastructure services

To allow a quick setup of all services required to run this demo, we provide a docker compose template that starts the following services:
- Postgresql
- PgAdmin
- Kogito Data Index
- Kogito Example Service (Only available if the example has been compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```)
- Kogito Management Console
- Kogito Task Console
- Keycloak

The docker compose template provides three profiles to enable starting only the set of services you want to use. The profiles are:
- **infra**: Starts only the minimal infrastructure to run the example (Postgresql, pgadmin, Kogito Data Index)
- **example**: Starts the services in *infra* profile and the Kogito Example Service. Requires the example to be compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```.
- **full** (default): includes all the above and also starts the **Management Console**, **Task Console** and a **Keycloak** to handle the consoles authentication. Requires the example to be compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```.

> NOTE: In order to use it, please ensure you have Docker Compose installed on your machine, otherwise follow the instructions available
in [here](https://docs.docker.com/compose/install/).

## Starting the services

Use the `startServices.sh` passing the docker profile you want to use as an argument. If no profile is provided the script will default to **full**.

Eg:
```shell
sh startServices.sh example
```

Once the services are started (depending on the profile), the following ports will be assigned on your local machine:
- Postgresql: 5432
- PgAdmin: 8055
- Kogito Data Index: 8180
- Kogito Example Service: 8080
- Kogito Management Console: 8280
- Kogito Task Console: 8380
- Keycloak: 8480

## Stopping and removing volume data

To stop all services, simply run:

```shell
docker compose stop
```
or

```shell
docker compose down
```
to stop the services and remove the containers
docker-compose -f docker-compose-postgresql.yml stop

For more details please check the Docker Compose documentation.

```shell
docker-compose --help
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
version: '3'

services:
postgres:
container_name: postgres
image: postgres:16.1-alpine3.19
profiles: [ "infra", "example", "full" ]
ports:
- "5432:5432"
volumes:
- ./sql:/docker-entrypoint-initdb.d:Z
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "kogito", "-U", "kogito-user" ]
timeout: 45s
interval: 10s
retries: 50
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:8.2
profiles: [ "infra", "example", "full" ]
ports:
- 8055:80
depends_on:
- postgres
volumes:
- ./pgadmin/servers.json:/pgadmin4/servers.json
- ./pgadmin/pgpass:/pgadmin4/pgpass
entrypoint: >
/bin/sh -c "
cp -f /pgadmin4/pgpass /var/lib/pgadmin/;
chmod 600 /var/lib/pgadmin/pgpass;
/entrypoint.sh
"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: pass
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'

data-index:
container_name: data-index
image: quay.io/kiegroup/kogito-data-index-postgresql:${KOGITO_VERSION}
profiles: [ "infra", "example", "full" ]
ports:
- "8180:8080"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./persistence:/home/kogito/data/protobufs/
environment:
QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito"
QUARKUS_DATASOURCE_USERNAME: kogito-user
QUARKUS_DATASOURCE_PASSWORD: kogito-pass
QUARKUS_HTTP_CORS_ORIGINS: "/.*/"
KOGITO_DATA_INDEX_QUARKUS_PROFILE: "http-events-support"
KOGITO_DATA_INDEX_PROPS: -Dkogito.protobuf.folder=/home/kogito/data/protobufs/
extra_hosts:
- "${DOCKER_GATEWAY_HOST}:host-gateway"

kogito-example-service:
container_name: kogito-example-service
image: dev.local/${USER}/kogito-example-service:1.0-SNAPSHOT
profiles: ["example", "full"]
ports:
- "8080:8080"
depends_on:
data-index:
condition: service_started
environment:
QUARKUS_HTTP_CORS_ORIGINS: "/.*/"
QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito"
QUARKUS_DATASOURCE_REACTIVE_URL: "postgresql://postgres:5432/kogito"
QUARKUS_DATASOURCE_USERNAME: kogito-user
QUARKUS_DATASOURCE_PASSWORD: kogito-pass
QUARKUS_DATASOURCE_DB_KIND: postgresql
KOGITO_JOBS_SERVICE_URL: http://${DOCKER_GATEWAY_HOST}:8080
KOGITO_SERVICE_URL: http://${DOCKER_GATEWAY_HOST}:8080
KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8180
extra_hosts:
- "${DOCKER_GATEWAY_HOST}:host-gateway"

keycloak:
container_name: keycloak
image: quay.io/keycloak/keycloak:legacy
profiles: ["full"]
ports:
- "8480:8080"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./keycloak/kogito-realm.json:/tmp/kogito-realm.json
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/auth/realms/kogito" ]
interval: 2s
timeout: 1s
retries: 50
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: kogito-user
DB_SCHEMA: public
DB_PASSWORD: kogito-pass
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_IMPORT: /tmp/kogito-realm.json

management-console:
container_name: management-console
image: quay.io/kiegroup/kogito-management-console:${KOGITO_VERSION}
profiles: ["full"]
ports:
- 8280:8080
depends_on:
data-index:
condition: service_started
keycloak:
condition: service_healthy
volumes:
- ./svg/:/home/kogito/data/svg/
environment:
KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:8180/graphql
QUARKUS_HTTP_CORS_ORIGINS: "/.*/"
KOGITO_MANAGEMENT_CONSOLE_PROPS: -Dkogito.consoles.keycloak.config.url=http://localhost:8480/auth -Dkogito.consoles.keycloak.config.health-check-url=http://localhost:8480/auth/realms/kogito/.well-known/openid-configuration -Dkogito.svg.folder.path=/home/kogito/data/svg

task-console:
container_name: task-console
image: quay.io/kiegroup/kogito-task-console:${KOGITO_VERSION}
profiles: ["full"]
ports:
- 8380:8080
depends_on:
data-index:
condition: service_started
keycloak:
condition: service_healthy
environment:
KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:8180/graphql
QUARKUS_HTTP_CORS_ORIGINS: "/.*/"
KOGITO_TASK_CONSOLE_PROPS: -Dkogito.consoles.keycloak.config.url=http://localhost:8480/auth -Dkogito.consoles.keycloak.config.health-check-url=http://localhost:8480/auth/realms/kogito/.well-known/openid-configuration
Loading

0 comments on commit 4b0fad2

Please sign in to comment.