Skip to content

Commit

Permalink
[NO-ISSUE] Remove MongoDB leftovers duo to ASF restrictions (apache#1732
Browse files Browse the repository at this point in the history
)

* Remove MongoDB leftovers duo to ASF restrictions

Signed-off-by: Ricardo Zanini <[email protected]>

* Removing composer references on Infinispan and MongoDB

Signed-off-by: Ricardo Zanini <[email protected]>

* Remove Inifinispan leftovers

Signed-off-by: Ricardo Zanini <[email protected]>

---------

Signed-off-by: Ricardo Zanini <[email protected]>
  • Loading branch information
ricardozanini authored and rgdoliveira committed Jan 22, 2024
1 parent a7449e6 commit 1fe9d29
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 179 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ Today we have the following Kogito Component Images:

The Data Index Service aims at capturing and indexing data produced by one more Kogito runtime services.
For more information please visit this (link)(https://docs.jboss.org/kogito/release/latest/html_single/#proc-kogito-travel-agency-enable-data-index_kogito-deploying-on-openshift).
The Data Index Service depends on a running Infinispan, MongoDB or PostgreSQL.
The Data Index Service depends on a PostgreSQL instance.
The Persistence service can be switched by using its corresponding image

- Ephemeral PostgreSQL: quay.io/kiegroup/kogito-data-index-ephemeral
Expand All @@ -639,7 +639,7 @@ $ docker run -it --env QUARKUS_DATASOURCE_JDBC_URL="jdbc:postgresql://localhost:
To enable debug just use this env while running this image:

```bash
$ docker run -it --env SCRIPT_DEBUG=true --env QUARKUS_INFINISPAN_CLIENT_HOSTS=my-infinispan-server:11222 quay.io/kiegroup/kogito-data-index-postgresql:latest
$ docker run -it --env SCRIPT_DEBUG=true quay.io/kiegroup/kogito-data-index-postgresql:latest
```
You should notice a few debug messages present in the system output.

Expand Down Expand Up @@ -675,16 +675,13 @@ docker run -it --env SCRIPT_DEBUG=true quay.io/kiegroup/kogito-jobs-service-post
You should notice a few debug messages being printed in the system output.

The ephemeral image does not have external dependencies like a backend persistence provider, it uses in-memory persistence
while working with Jobs Services `allinone`, `infinispan`, `mongodb` and `postgresql` variants, it will need to
have an Infinispan, MongoDB or PostgreSQL server, respectively, previously running.
while working with Jobs Services `postgresql` variant, it will need to have a PostgreSQL server previously running.

#### Jobs Services All-in-one

The Jobs Services All in One image provides the option to run any supported variant that we have at disposal, which are:

- PostgreSQL
- Infinispan
- MongoDB
- Ephemeral (default if no variant is specified)

There are 3 exposed environment variables that can be used to configure the behaviour, which are:
Expand Down
46 changes: 0 additions & 46 deletions contrib/jobs-service/container-compose-infinispan.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions contrib/jobs-service/container-compose-mongodb.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions contrib/jobs-service/infinispan/infinispan.xml

This file was deleted.

6 changes: 3 additions & 3 deletions kogito-jobs-service-allinone-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ labels:
- name: "io.k8s.display-name"
value: "Kogito Jobs Service All-in-One"
- name: "io.openshift.tags"
value: "kogito,jobs-service,postgresql,mongodb,infinispan,ephemeral"
value: "kogito,jobs-service,postgresql,ephemeral"
- name: "io.openshift.expose-services"
value: "8080:http"

Expand All @@ -45,8 +45,8 @@ envs:
example: "true"
description: "By default Jobs Service doesn't integrate with message systems (e.g. Kafka). Set this variable to true to enable the events add-on."
- name: "JOBS_SERVICE_PERSISTENCE"
example: "mongodb"
description: "The all in one image contains all the supported jdbc plugins for Jobs Service, ephemeral, postgresql, mongodb and infinispan, if empty, defaults to ephemeral"
example: "postgresql"
description: "The all in one image contains all the supported jdbc plugins for Jobs Service, ephemeral and postgresql, if empty, defaults to ephemeral"

packages:
manager: microdnf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ "${SCRIPT_DEBUG}" = "true" ] ; then
printenv
fi

allowed_jobs_service_flavors=("ephemeral" "mongodb" "infinispan" "postgresql")
allowed_jobs_service_flavors=("ephemeral" "postgresql")
jobs_service_flavor="ephemeral"
if [[ ! "${allowed_jobs_service_flavors[*]}" =~ ${JOBS_SERVICE_PERSISTENCE,,} ]]; then
log_warning "${JOBS_SERVICE_PERSISTENCE,,} is not supported, the allowed flavors are [${allowed_jobs_service_flavors[*]}], defaulting to ${jobs_service_flavor}"
Expand Down
10 changes: 0 additions & 10 deletions modules/kogito-jobs-service-all-in-one/configure
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ SCRIPT_DIR=$(dirname "${0}")
ADDED_DIR="${SCRIPT_DIR}"/added

unzip "${SOURCES_DIR}"/jobs-service-inmemory-quarkus-app.zip -d "${KOGITO_HOME}"/bin/ephemeral
unzip "${SOURCES_DIR}"/jobs-service-infinispan-quarkus-app.zip -d "${KOGITO_HOME}"/bin/infinispan
unzip "${SOURCES_DIR}"/jobs-service-mongodb-quarkus-app.zip -d "${KOGITO_HOME}"/bin/mongodb
unzip "${SOURCES_DIR}"/jobs-service-postgresql-quarkus-app.zip -d "${KOGITO_HOME}"/bin/postgresql


Expand All @@ -35,14 +33,6 @@ mv "${KOGITO_HOME}"/bin/ephemeral/quarkus-app/lib/* "${KOGITO_HOME}"/bin/shared-
rm -rf "${KOGITO_HOME}"/bin/ephemeral/quarkus-app/lib
ln -s "${KOGITO_HOME}"/bin/shared-libs "${KOGITO_HOME}"/bin/ephemeral/quarkus-app/lib

cp -r "${KOGITO_HOME}"/bin/infinispan/quarkus-app/lib/* "${KOGITO_HOME}"/bin/shared-libs/
rm -rf "${KOGITO_HOME}"/bin/infinispan/quarkus-app/lib
ln -s "${KOGITO_HOME}"/bin/shared-libs "${KOGITO_HOME}"/bin/infinispan/quarkus-app/lib

cp -r "${KOGITO_HOME}"/bin/mongodb/quarkus-app/lib/* "${KOGITO_HOME}"/bin/shared-libs/
rm -rf "${KOGITO_HOME}"/bin/mongodb/quarkus-app/lib
ln -s "${KOGITO_HOME}"/bin/shared-libs "${KOGITO_HOME}"/bin/mongodb/quarkus-app/lib

cp -r "${KOGITO_HOME}"/bin/postgresql/quarkus-app/lib/* "${KOGITO_HOME}"/bin/shared-libs/
rm -rf "${KOGITO_HOME}"/bin/postgresql/quarkus-app/lib
ln -s "${KOGITO_HOME}"/bin/shared-libs "${KOGITO_HOME}"/bin/postgresql/quarkus-app/lib
Expand Down
4 changes: 0 additions & 4 deletions modules/kogito-jobs-service-all-in-one/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ version: "999-SNAPSHOT"
artifacts:
- path: /tmp/build/jobs-service-inmemory-all-in-one/jobs-service-inmemory-quarkus-app.zip
name: jobs-service-inmemory-quarkus-app.zip
- path: /tmp/build/jobs-service-mongodb-all-in-one/jobs-service-mongodb-quarkus-app.zip
name: jobs-service-mongodb-quarkus-app.zip
- path: /tmp/build/jobs-service-infinispan-all-in-one/jobs-service-infinispan-quarkus-app.zip
name: jobs-service-infinispan-quarkus-app.zip
- path: /tmp/build/jobs-service-postgresql-all-in-one/jobs-service-postgresql-quarkus-app.zip
name: jobs-service-postgresql-quarkus-app.zip

Expand Down
2 changes: 0 additions & 2 deletions scripts/build-kogito-apps-components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ case ${imageName} in
"kogito-jobs-service-allinone")
extended_context="-all-in-one"
contextDir="jobs-service/jobs-service-inmemory"
contextDir="${contextDir} jobs-service/jobs-service-infinispan"
contextDir="${contextDir} jobs-service/jobs-service-postgresql"
contextDir="${contextDir} jobs-service/jobs-service-mongodb"
;;
"kogito-jit-runner")
contextDir="jitexecutor/jitexecutor-runner"
Expand Down
36 changes: 2 additions & 34 deletions tests/features/jobs-service/kogito-jobs-service-all-in-one.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ Feature: Kogito-jobs-service-all-in-one feature.
And the image should contain label io.openshift.expose-services with value 8080:http
And the image should contain label io.k8s.description with value Runtime image for Kogito Jobs Service with all available jdbc providers
And the image should contain label io.k8s.display-name with value Kogito Jobs Service All-in-One
And the image should contain label io.openshift.tags with value kogito,jobs-service,postgresql,mongodb,infinispan,ephemeral
And the image should contain label io.openshift.tags with value kogito,jobs-service,postgresql,ephemeral

Scenario: Verify if all jobs-service flavors are in the image
When container is started with command bash
Then file /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar should exist
And file /home/kogito/bin/infinispan/quarkus-app/quarkus-run.jar should exist
And file /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar should exist
And file /home/kogito/bin/mongodb/quarkus-app/quarkus-run.jar should exist

Scenario: Verify if the debug is correctly enabled with the ephemeral jar
When container is started with env
Expand All @@ -24,43 +22,13 @@ Feature: Kogito-jobs-service-all-in-one feature.
And container log should contain started in
And container log should not contain Application failed to start

Scenario: Infinispan - verify if auth is correctly set
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| JOBS_SERVICE_PERSISTENCE | infinispan |
| QUARKUS_INFINISPAN_CLIENT_HOSTS | 172.18.0.1:11222 |
| QUARKUS_INFINISPAN_CLIENT_USE_AUTH | true |
| QUARKUS_INFINISPAN_CLIENT_USERNAME | IamNotExist |
| QUARKUS_INFINISPAN_CLIENT_PASSWORD | hard2guess |
| QUARKUS_INFINISPAN_CLIENT_AUTH_REALM | SecretRealm |
| QUARKUS_INFINISPAN_CLIENT_SASL_MECHANISM | COOLGSSAPI |
Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/infinispan/quarkus-app/quarkus-run.jar
And container log should contain QUARKUS_INFINISPAN_CLIENT_HOSTS=172.18.0.1:11222
And container log should contain QUARKUS_INFINISPAN_CLIENT_USE_AUTH=true
And container log should contain QUARKUS_INFINISPAN_CLIENT_PASSWORD=hard2guess
And container log should contain QUARKUS_INFINISPAN_CLIENT_USERNAME=IamNotExist
And container log should contain QUARKUS_INFINISPAN_CLIENT_AUTH_REALM=SecretReal
And container log should contain QUARKUS_INFINISPAN_CLIENT_SASL_MECHANISM=COOLGSSAPI
And container log should not contain Application failed to start

Scenario: verify if the container is correctly started with mongo parameters
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| JOBS_SERVICE_PERSISTENCE | mongodb |
| QUARKUS_MONGODB_CONNECTION_STRING | mongodb://user:password@localhost:27017/admin |
| QUARKUS_MONGODB_DATABASE | kogito |
Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/mongodb/quarkus-app/quarkus-run.jar
And container log should not contain Application failed to start

Scenario: verify if the container is started with invalid jobs-service flavor
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| JOBS_SERVICE_PERSISTENCE | something |
Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar
And container log should contain something is not supported, the allowed flavors are [ephemeral mongodb infinispan postgresql], defaulting to ephemeral
And container log should contain something is not supported, the allowed flavors are [ephemeral postgresql], defaulting to ephemeral

Scenario: verify if container starts as expected
When container is started with env
Expand Down

0 comments on commit 1fe9d29

Please sign in to comment.