diff --git a/devops/gc/deploy/templates/deploy-redis.yaml b/devops/gc/deploy/templates/deploy-redis.yaml index 16ea13c63912b1312aadb36fc9810b144286b5b5..e14703d9ac3bab708132e90ba10eb41abbccb335 100644 --- a/devops/gc/deploy/templates/deploy-redis.yaml +++ b/devops/gc/deploy/templates/deploy-redis.yaml @@ -14,8 +14,8 @@ spec: labels: app: {{ printf "redis-%s" .Values.conf.appName | quote }} annotations: - sidecar.istio.io/proxyCPU: 10m - sidecar.istio.io/proxyMemory: 100Mi + sidecar.istio.io/proxyCPU: 5m + sidecar.istio.io/proxyMemory: 64Mi spec: containers: - args: @@ -32,6 +32,6 @@ spec: protocol: TCP resources: requests: - cpu: 10m - memory: 50Mi + cpu: 5m + memory: 20Mi {{ end }} diff --git a/devops/gc/deploy/values.yaml b/devops/gc/deploy/values.yaml index 187e633dc02c6fe63e0ace19421d104543a45f57..28d8cc2b79ce5ba74d54855f112ae222960c1aed 100644 --- a/devops/gc/deploy/values.yaml +++ b/devops/gc/deploy/values.yaml @@ -22,8 +22,8 @@ data: defaultLegalTag: "default-data-tag" dataPartitionId: "" # deployments - requestsCpu: "10m" - requestsMemory: "650Mi" + requestsCpu: "7m" + requestsMemory: "450Mi" limitsCpu: "1" limitsMemory: "3G" bootstrapImage: "" @@ -48,9 +48,9 @@ conf: storageRedisSecretName: "storage-redis-secret" istio: - proxyCPU: "10m" + proxyCPU: "5m" proxyCPULimit: "200m" - proxyMemory: "100Mi" + proxyMemory: "50Mi" proxyMemoryLimit: "256Mi" - bootstrapProxyCPU: "10m" - bootstrapProxyCPULimit: "100m" + bootstrapProxyCPU: "5m" + bootstrapProxyCPULimit: "50m" diff --git a/provider/storage-gc/docs/anthos/README.md b/provider/storage-gc/docs/anthos/README.md index b0b1b4ed7464e85654f539aed0d52b2ebe1196fd..93ba287cb1eabb0898bedae6c4557c1ced9f7383 100644 --- a/provider/storage-gc/docs/anthos/README.md +++ b/provider/storage-gc/docs/anthos/README.md @@ -405,7 +405,7 @@ This is its cardinal difference from other implementations that use PUSH-subscri choice when choosing brokers. When using PULL-subscribers, there is a need to restore Storage service subscribers at the start of Storage service. -This magic happens in the `OqmSubscriberManager.java` class from `core-lib-gcp` in the @PostConstruct method. +This magic happens in the `OqmSubscriberManager.java` class from `OQM` in the @PostConstruct method. ## Keycloak configuration diff --git a/provider/storage-gc/pom.xml b/provider/storage-gc/pom.xml index fbe94f8efe8e67b8a5267e5cb4b4fc7a32cd45a2..9827efc72a920e3742e969a85a881e0f64d55eeb 100644 --- a/provider/storage-gc/pom.xml +++ b/provider/storage-gc/pom.xml @@ -15,195 +15,227 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> <groupId>org.opengroup.osdu</groupId> - <artifactId>storage-gc</artifactId> + <artifactId>os-storage</artifactId> <version>0.21.0-SNAPSHOT</version> - <description>Google cloud related implementation staff.</description> - <packaging>jar</packaging> - - <properties> - <java.version>1.8</java.version> - <maven.compiler.target>1.8</maven.compiler.target> - <maven.compiler.source>1.8</maven.compiler.source> - <log4j.version>2.17.1</log4j.version> - <spring-webmvc.version>5.3.22</spring-webmvc.version> - </properties> + <relativePath>../../pom.xml</relativePath> + </parent> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>com.google.cloud</groupId> - <artifactId>libraries-bom</artifactId> - <version>26.10.0</version> - <type>pom</type> - <scope>import</scope> - </dependency> - <!--for MinIO--> - <!--TODO: move next 4 dependencies to core-lib-gcp. Related to mappers--> - <dependency> - <groupId>org.jetbrains.kotlin</groupId> - <artifactId>kotlin-stdlib</artifactId> - <version>1.6.0</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>com.squareup.okio</groupId> - <artifactId>okio</artifactId> - <version>2.7.0</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>okhttp</artifactId> - <version>4.9.2</version> - <scope>compile</scope> - </dependency> - </dependencies> - </dependencyManagement> + <artifactId>storage-gc</artifactId> + <version>0.21.0-SNAPSHOT</version> + <description>Google cloud related implementation staff.</description> + <packaging>jar</packaging> - <parent> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-storage</artifactId> - <version>0.21.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> + <properties> + <java.version>1.8</java.version> + <maven.compiler.target>1.8</maven.compiler.target> + <maven.compiler.source>1.8</maven.compiler.source> + <log4j.version>2.17.1</log4j.version> + <spring-webmvc.version>5.3.22</spring-webmvc.version> + </properties> + <dependencyManagement> <dependencies> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-gc</artifactId> - <version>0.21.0-rc1</version> - </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - <version>0.20.0-rc3</version> - </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>storage-core</artifactId> - <version>0.21.0-SNAPSHOT</version> - <exclusions> - <exclusion> - <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> - </exclusion> - <exclusion> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>ch.qos.logback.contrib</groupId> - <artifactId>logback-json-classic</artifactId> - <version>0.1.5</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-config</artifactId> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${spring-webmvc.version}</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> - <!-- Testing packages --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito2</artifactId> - <version>2.0.9</version> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + <version>${log4j.version}</version> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-to-slf4j</artifactId> + <version>${log4j.version}</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-dependencies</artifactId> + <version>2.7.10</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>com.google.cloud</groupId> + <artifactId>libraries-bom</artifactId> + <version>26.10.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>2.9.1</version> + </dependency> + <!--for MinIO--> + <!--TODO: move next 4 dependencies to core-lib-gcp. Related to mappers--> + <dependency> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-stdlib</artifactId> + <version>1.6.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.squareup.okio</groupId> + <artifactId>okio</artifactId> + <version>2.7.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>okhttp</artifactId> + <version>4.9.2</version> + <scope>compile</scope> + </dependency> </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>os-core-common</artifactId> + <version>0.21.0-rc4</version> + </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>core-lib-gc</artifactId> + <version>0.21.0-rc4</version> + </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>osm</artifactId> + <version>0.21.0-rc3</version> + </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>oqm</artifactId> + <version>0.21.0-rc3</version> + </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>obm</artifactId> + <version>0.21.0-rc2</version> + </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>storage-core</artifactId> + <version>0.21.0-SNAPSHOT</version> + <exclusions> + <exclusion> + <groupId>org.mockito</groupId> + <artifactId>mockito-all</artifactId> + </exclusion> + <exclusion> + <groupId>org.powermock</groupId> + <artifactId>powermock-api-mockito</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>ch.qos.logback.contrib</groupId> + <artifactId>logback-json-classic</artifactId> + <version>0.1.5</version> + </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-config</artifactId> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>${spring-webmvc.version}</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + <!-- Testing packages --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.powermock</groupId> + <artifactId>powermock-api-mockito2</artifactId> + <version>2.0.9</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>2.7.4</version> + <configuration> + <profiles> + <profile> + <id>local</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <spring.profiles.active>local</spring.profiles.active> + </properties> + </profile> + <profile> + <id>dev</id> + <properties> + <spring.profiles.active>dev</spring.profiles.active> + </properties> + </profile> + </profiles> + </configuration> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + <configuration> + <classifier>spring-boot</classifier> + <mainClass> + org.opengroup.osdu.storage.provider.gcp.StorageApplicationGCP + </mainClass> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>0.7.7.201606060606</version> + <executions> + <execution> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + </executions> + </plugin> - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> - <configuration> - <profiles> - <profile> - <id>local</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <properties> - <spring.profiles.active>local</spring.profiles.active> - </properties> - </profile> - <profile> - <id>dev</id> - <properties> - <spring.profiles.active>dev</spring.profiles.active> - </properties> - </profile> - </profiles> - </configuration> - <executions> - <execution> - <goals> - <goal>repackage</goal> - </goals> - <configuration> - <classifier>spring-boot</classifier> - <mainClass> - org.opengroup.osdu.storage.provider.gcp.StorageApplicationGCP - </mainClass> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-war-plugin</artifactId> - <configuration> - <failOnMissingWebXml>false</failOnMissingWebXml> - </configuration> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>0.7.7.201606060606</version> - <executions> - <execution> - <goals> - <goal>prepare-agent</goal> - </goals> - </execution> - <execution> - <id>report</id> - <phase>prepare-package</phase> - <goals> - <goal>report</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> + </plugins> + </build> </project> diff --git a/provider/storage-gc/src/main/java/org/opengroup/osdu/storage/provider/gcp/web/cache/CacheConfig.java b/provider/storage-gc/src/main/java/org/opengroup/osdu/storage/provider/gcp/web/cache/CacheConfig.java index 4a0a07bb3d75f27859b15fa90917d7f39b15fd8d..231bb6c9aa6ed61e38c54a6e34bbec247eff7b4b 100644 --- a/provider/storage-gc/src/main/java/org/opengroup/osdu/storage/provider/gcp/web/cache/CacheConfig.java +++ b/provider/storage-gc/src/main/java/org/opengroup/osdu/storage/provider/gcp/web/cache/CacheConfig.java @@ -20,8 +20,10 @@ package org.opengroup.osdu.storage.provider.gcp.web.cache; import lombok.RequiredArgsConstructor; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.cache.RedisCache; +import org.opengroup.osdu.core.common.cache.VmCache; import org.opengroup.osdu.core.common.model.entitlements.Groups; import org.opengroup.osdu.core.common.model.storage.Schema; +import org.opengroup.osdu.core.common.partition.PartitionInfo; import org.opengroup.osdu.core.gcp.cache.RedisCacheBuilder; import org.opengroup.osdu.storage.provider.gcp.web.config.GcpAppServiceConfig; import org.springframework.context.annotation.Bean; @@ -65,4 +67,9 @@ public class CacheConfig { Schema.class ); } + + @Bean + public ICache<String, PartitionInfo> partitionInfoCache() { + return new VmCache<>(600, 2000); + } } diff --git a/provider/storage-gc/src/main/resources/application.properties b/provider/storage-gc/src/main/resources/application.properties index bd0665cbd31093dcfb4081d4e363e75c3babacba..1d1b4634127cc8e112195ff98e1bc2a68f058f28 100644 --- a/provider/storage-gc/src/main/resources/application.properties +++ b/provider/storage-gc/src/main/resources/application.properties @@ -25,6 +25,7 @@ pubsub-search-topic=records-changed storage-service-account-email=${STORAGE_SERVICE_ACCOUNT_EMAIL} # External services config +propertyResolver.strategy=partition REDIS_GROUP_PORT=6379 REDIS_STORAGE_PORT=6379