From fbf9336d9a2966d828ac8b09fbbdd1af3064a10b Mon Sep 17 00:00:00 2001 From: "Rustam Lotsmanenko (EPAM)" <rustam_lotsmanenko@epam.com> Date: Tue, 5 Nov 2024 20:39:08 +0000 Subject: [PATCH] Elasticsearch java client migration to 8.15 --- devops/gc/deploy/values.yaml | 2 +- provider/search-gc/docs/baremetal/README.md | 5 ----- provider/search-gc/docs/gc/README.md | 5 ----- provider/search-gc/src/main/resources/application.properties | 2 ++ search-core-plus/docs/baremetal/README.md | 5 ----- search-core/pom.xml | 4 ++-- .../osdu/search/util/CloudConnectedOuterServicesBuilder.java | 2 +- 7 files changed, 6 insertions(+), 19 deletions(-) diff --git a/devops/gc/deploy/values.yaml b/devops/gc/deploy/values.yaml index f5c2a3c1d..327724867 100644 --- a/devops/gc/deploy/values.yaml +++ b/devops/gc/deploy/values.yaml @@ -30,7 +30,7 @@ data: conf: appName: "search" - elasticSecretName: "search-elastic-secret" + elasticSecretName: "search-elastic-secret-8" searchRedisSecretName: "search-redis-secret" replicas: 2 diff --git a/provider/search-gc/docs/baremetal/README.md b/provider/search-gc/docs/baremetal/README.md index 81d150b2b..8b3348c4b 100644 --- a/provider/search-gc/docs/baremetal/README.md +++ b/provider/search-gc/docs/baremetal/README.md @@ -149,10 +149,6 @@ You will need to have the following environment variables defined. | name | value | description | sensitive? | source | |--------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------------------|-----------------------------------------|-------------------------------------| -| `ELASTIC_PASSWORD` | `********` | Password for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_USER_NAME` | `********` | User name for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_HOST` | ex `elastic.domain.com` | Host Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment | | `INDEXER_HOST` | ex `https://os-indexer-dot-opendes.appspot.com/api/indexer/v2/` | Indexer API endpoint | no | output of infrastructure deployment | | `DATA_GROUP` | `opendes` | The service account to this group and substitute | no | - | | `GROUP_ID` | ex `opendes-gc.projects.com` | OSDU R2 to run tests under | no | - | @@ -160,7 +156,6 @@ You will need to have the following environment variables defined. | `DEFAULT_DATA_PARTITION_ID_TENANT2` | ex `not-exist` | HTTP Header 'Data-Partition-ID' with not existing tenant | no | - | | `SEARCH_HOST` | ex `http://localhost:8080/api/search/v2/` | Endpoint of search service | no | - | | `LEGAL_TAG` | ex `my-legal-tag` | a valid legal tag | no | - | -| `SECURITY_HTTPS_CERTIFICATE_TRUST` | ex `false` | Elastic client connection uses TrustSelfSignedStrategy(), if it is 'true' | false | output of infrastructure deployment | | `TEST_OPENID_PROVIDER_CLIENT_ID` | `********` | Client Id for `$INTEGRATION_TESTER` | yes | -- | | `TEST_OPENID_PROVIDER_CLIENT_SECRET` | `********` | | Client secret for `$INTEGRATION_TESTER` | -- | | `TEST_OPENID_PROVIDER_URL` | `https://keycloak.com/auth/realms/osdu` | OpenID provider url | yes | -- | diff --git a/provider/search-gc/docs/gc/README.md b/provider/search-gc/docs/gc/README.md index f92413cb3..1c247d548 100644 --- a/provider/search-gc/docs/gc/README.md +++ b/provider/search-gc/docs/gc/README.md @@ -142,10 +142,6 @@ You will need to have the following environment variables defined. | name | value | description | sensitive? | source | |-------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------------------|------------|--------------------------------------------------------------| | `ENTITLEMENTS_HOST` | ex `https://entitlements.com/entitlements/v1` | Entitlements API endpoint | no | output of infrastructure deployment | -| `ELASTIC_PASSWORD` | `********` | Password for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_USER_NAME` | `********` | User name for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_HOST` | ex `elastic.domain.com` | Host Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment | | `GCLOUD_PROJECT` | ex `opendes` | Google Cloud Project Id | no | output of infrastructure deployment | | `INDEXER_HOST` | ex `https://os-indexer-dot-opendes.appspot.com/api/indexer/v2/` | Indexer API endpoint | no | output of infrastructure deployment | | `DATA_GROUP` | `opendes` | The service account to this group and substitute | no | - | @@ -155,7 +151,6 @@ You will need to have the following environment variables defined. | `SEARCH_INTEGRATION_TESTER` | `ewogICJ0....` or `tmp/service-acc.json` | Service account for API calls as Base64 string or path to a file | yes | <https://console.cloud.google.com/iam-admin/serviceaccounts> | | `SEARCH_HOST` | ex `http://localhost:8080/api/search/v2/` | Endpoint of search service | no | - | | `LEGAL_TAG` | ex `my-legal-tag` | a valid legal tag | no | - | -| `SECURITY_HTTPS_CERTIFICATE_TRUST` | ex `false` | Elastic client connection uses TrustSelfSignedStrategy(), if it is 'true' | false | output of infrastructure deployment | **Entitlements configuration for integration accounts** diff --git a/provider/search-gc/src/main/resources/application.properties b/provider/search-gc/src/main/resources/application.properties index f77e36db9..e73c509ac 100644 --- a/provider/search-gc/src/main/resources/application.properties +++ b/provider/search-gc/src/main/resources/application.properties @@ -75,3 +75,5 @@ management.health.probes.enabled=true #Collaboration context feature flag name : properties specific collaborations-enabled=false + +elasticsearch-properties-prefix=elasticsearch.8 diff --git a/search-core-plus/docs/baremetal/README.md b/search-core-plus/docs/baremetal/README.md index 4e25845d3..8d7640b8d 100644 --- a/search-core-plus/docs/baremetal/README.md +++ b/search-core-plus/docs/baremetal/README.md @@ -148,10 +148,6 @@ You will need to have the following environment variables defined. | name | value | description | sensitive? | source | |--------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------------------|-----------------------------------------|-------------------------------------| -| `ELASTIC_PASSWORD` | `********` | Password for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_USER_NAME` | `********` | User name for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_HOST` | ex `elastic.domain.com` | Host Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment | | `INDEXER_HOST` | ex `https://os-indexer-dot-opendes.appspot.com/api/indexer/v2/` | Indexer API endpoint | no | output of infrastructure deployment | | `DATA_GROUP` | `opendes` | The service account to this group and substitute | no | - | | `GROUP_ID` | ex `opendes-gc.projects.com` | OSDU R2 to run tests under | no | - | @@ -159,7 +155,6 @@ You will need to have the following environment variables defined. | `DEFAULT_DATA_PARTITION_ID_TENANT2` | ex `not-exist` | HTTP Header 'Data-Partition-ID' with not existing tenant | no | - | | `SEARCH_HOST` | ex `http://localhost:8080/api/search/v2/` | Endpoint of search service | no | - | | `LEGAL_TAG` | ex `my-legal-tag` | a valid legal tag | no | - | -| `SECURITY_HTTPS_CERTIFICATE_TRUST` | ex `false` | Elastic client connection uses TrustSelfSignedStrategy(), if it is 'true' | false | output of infrastructure deployment | | `TEST_OPENID_PROVIDER_CLIENT_ID` | `********` | Client Id for `$INTEGRATION_TESTER` | yes | -- | | `TEST_OPENID_PROVIDER_CLIENT_SECRET` | `********` | | Client secret for `$INTEGRATION_TESTER` | -- | | `TEST_OPENID_PROVIDER_URL` | `https://keycloak.com/auth/realms/osdu` | OpenID provider url | yes | -- | diff --git a/search-core/pom.xml b/search-core/pom.xml index d3002108c..d52a434d3 100644 --- a/search-core/pom.xml +++ b/search-core/pom.xml @@ -154,12 +154,12 @@ <dependency> <groupId>co.elastic.clients</groupId> <artifactId>elasticsearch-java</artifactId> - <version>7.17.22</version> + <version>8.15.2</version> </dependency> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-client</artifactId> - <version>7.17.22</version> + <version>8.15.2</version> </dependency> <!--Required for Geo shape queries--> <dependency> diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/CloudConnectedOuterServicesBuilder.java b/search-core/src/main/java/org/opengroup/osdu/search/util/CloudConnectedOuterServicesBuilder.java index af5cd2f15..f89091ddb 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/CloudConnectedOuterServicesBuilder.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/CloudConnectedOuterServicesBuilder.java @@ -95,7 +95,7 @@ public class CloudConnectedOuterServicesBuilder implements ConnectedOuterService return ConnectedOuterService.builder() .name(NAME_PREFIX + partitionId) - .version(client.info().version().luceneVersion()) + .version(client.info().version().number()) .build(); } catch (AppException e) { log.error("Can't create elastic client", e.getOriginalException()); -- GitLab