Skip to content

Commit

Permalink
Align example with compact architecture setup
Browse files Browse the repository at this point in the history
  • Loading branch information
martinweiler committed Jul 26, 2024
1 parent c39e9a6 commit 83bc540
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ And when using native image compilation, you will also need:
This quickstart provides a docker compose template that starts all the required services. This setup ensures that all services are connected with a default configuration.

- PostgreSQL: 5432
- Data Index: 8180
- PgAdmin: 8055
- Kogito Process Instance Migration Service: 8080

Expand Down Expand Up @@ -167,6 +166,15 @@ The response will contain information about the migration:
}
```

Alternatively, use the following endpoint to migrate just a single process instance:
```bash
curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/management/processes/simple/instances/2a507f63-9db1-4d15-b64c-9e14f922d470/migrate -d '{
"targetProcessId": "modified",
"targetProcessVersion": "1.0"
}'
```


Note that the invocation of the `migrate` endpoint is the first step of the PIM functionality. It flags the selected process instance(s) as migrated to the defined target process definition. The second step of the migration will happen the next time the process instance is unmarshalled. This would be the case when the process instance is triggered to continue its execution. If you want to test whether this unmarshalling step is successful after the migration, the following PUT call can be used without triggering the execution of the process instance:
```bash
curl -H "Content-Type: application/json" -H "Accept: application/json" -X PUT http://localhost:8080/modified/2a507f63-9db1-4d15-b64c-9e14f922d470 -d '{}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
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 Process Instance Migration Service (Only available if the example has been compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```)
- Kogito Process Instance Migration Service (Only available if the example has been compiled using the `container` mvn profile eg: ```mvn clean package -Pcontainer```)

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```.
- **infra**: Starts only the minimal infrastructure to run the example (Postgresql, pgadmin)
- **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 clean package -Pcontainer```.

> 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/).
Expand All @@ -25,7 +24,6 @@ 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 Process Instance Migration Service: 8080

## Stopping and removing volume data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,14 @@ services:
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
GUNICORN_ACCESS_LOGFILE: '/dev/null'

data-index:
container_name: data-index
image: quay.io/kiegroup/kogito-data-index-postgresql-nightly:${KOGITO_VERSION}
profiles: [ "infra", "example", "full" ]
ports:
- "8180:8080"
depends_on:
postgres:
condition: service_healthy
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"
extra_hosts:
- "${DOCKER_GATEWAY_HOST}:host-gateway"

kogito-process-instance-migration-service:
container_name: kogito-process-instance-migration-service
image: dev.local/${USER}/kogito-process-instance-migration-service:1.0-SNAPSHOT
profiles: ["example", "full"]
ports:
- "8080:8080"
depends_on:
data-index:
condition: service_started
- postgres
environment:
QUARKUS_HTTP_CORS_ORIGINS: "/.*/"
QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito"
Expand All @@ -78,6 +59,6 @@ services:
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
KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8080
extra_hosts:
- "${DOCKER_GATEWAY_HOST}:host-gateway"
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,7 @@ CREATE DATABASE kogito
TABLESPACE = pg_default
CONNECTION LIMIT = -1;

CREATE DATABASE keycloak
WITH
OWNER = "kogito-user"
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.utf8'
LC_CTYPE = 'en_US.utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;

GRANT ALL PRIVILEGES ON DATABASE postgres TO "kogito-user";
GRANT ALL PRIVILEGES ON DATABASE kogito TO "kogito-user";
GRANT ALL PRIVILEGES ON DATABASE kogito TO postgres;

GRANT ALL PRIVILEGES ON DATABASE keycloak TO "kogito-user";
GRANT ALL PRIVILEGES ON DATABASE keycloak TO postgres;
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@
<artifactId>kie-addons-quarkus-persistence-jdbc</artifactId>
</dependency>

<!-- Data Index Addon -->
<dependency>
<groupId>org.kie</groupId>
<artifactId>kogito-addons-quarkus-data-index-postgresql</artifactId>
</dependency>

<!-- Data Index Persistence -->
<dependency>
<groupId>org.kie</groupId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ kogito.service.url=http://localhost:8080
kogito.jobs-service.url=http://localhost:8080

# to be reachable from the container running job-service
kogito.dataindex.http.url=http://localhost:8180
kogito.dataindex.ws.url=ws://localhost:8180
kogito.dataindex.http.url=http://localhost:8080
kogito.dataindex.ws.url=ws://localhost:8080

# run create tables scripts
quarkus.flyway.migrate-at-start=true
Expand Down

0 comments on commit 83bc540

Please sign in to comment.