forked from apache/incubator-kie-kogito-examples
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from rgdoliveira/sync_main
Sync main branch with Apache main branch
- Loading branch information
Showing
47 changed files
with
4,542 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
538 changes: 538 additions & 0 deletions
538
...examples/process-usertasks-timer-data-index-persistence-addon-quarkus/README.md
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...es/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.env | ||
svg/ | ||
persistence/ |
57 changes: 57 additions & 0 deletions
57
...s-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
146 changes: 146 additions & 0 deletions
146
...ss-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: user@kogito.org | ||
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 |
Oops, something went wrong.