Commit d3938a27 authored by Kishore Battula's avatar Kishore Battula
Browse files

Merge branch 'haaggarw/UsingOpendesPartition' into 'master'

Haaggarw/using opendes partition

See merge request !17
parents de6d1d04 c6274ec8
Pipeline #12251 passed with stages
in 13 minutes and 46 seconds
......@@ -3,7 +3,7 @@ variables:
AZURE_BUILD_SUBDIR: provider/wks-azure
AZURE_TEST_SUBDIR: testing/wks-test-core
AZURE_DEPLOYMENTS_SUBDIR: deployments/scripts/azure
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=https;AccountName=${AZURE_BASE}sa;AccountKey=${AZURE_STORAGE_KEY};EndpointSuffix=core.windows.net
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=https;AccountName=${AZURE_BASE}data;AccountKey=${AZURE_STORAGE_KEY};EndpointSuffix=core.windows.net
STORAGE_CONTAINER: osdu-wks-mappings
include:
......
......@@ -24,7 +24,6 @@ The following software have components provided under the terms of this license:
- ASM Core (from )
- ASM based accessors helper used by json-smart (from )
- Adapter: RxJava (from )
- Android Support Library Annotations (from http://developer.android.com/tools/extras/support-library.html)
- Apache Commons BeanUtils (from http://commons.apache.org/proper/commons-beanutils/)
- Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/)
- Apache Commons Collections (from http://commons.apache.org/proper/commons-collections/)
......@@ -636,3 +635,5 @@ The following software have components provided under the terms of this license:
- org.junit.platform:junit-platform-commons (from http://junit.org/junit5/)
- org.junit.platform:junit-platform-engine (from http://junit.org/junit5/)
- org.junit.vintage:junit-vintage-engine (from http://junit.org/junit5/)
......@@ -50,55 +50,42 @@ spec:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_KEYVAULT
- name: AZURE_TENANT_ID
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_TENANT_ID
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: clientid
key: clientid
name: active-directory
key: principal-clientid
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: clientpassword
key: clientpassword
name: active-directory
key: principal-clientpassword
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: tenantid
- name: aad_client_id
valueFrom:
secretKeyRef:
name: appid
key: appid
name: active-directory
key: application-appid
- name: AZURE_APP_RESOURCE_ID
valueFrom:
secretKeyRef:
name: appid
key: appid
name: active-directory
key: application-appid
- name: appinsights_key
valueFrom:
secretKeyRef:
name: appinsights
name: central-logging
key: appinsights
- name: cosmosdb_database
value: osdu-db
- name: servicebus_namespace_name
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_SERVICEBUS_NAMESPACE
- name: servicebus_connection_string
valueFrom:
secretKeyRef:
name: servicebus
key: servicebus
- name: servicebus_topic_name
value: {{ .Values.azure.servicebusTopic }}
- name: storage_account
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_STORAGE_ACCOUNT
value: {{ .Values.azure.storageAccount }}
- name: servicebus_topic_subscription
value: {{ .Values.azure.servicebusSubscription }}
- name: storage_container
......@@ -108,8 +95,8 @@ spec:
- name: storage_service_endpoint
value: "http://storage/api/storage/v2"
- name: max_concurrent_calls
value: "1"
value: "8"
- name: executor_n_threads
value: "2"
value: "8"
- name: max_lock_renew_duration_seconds
value: "120"
......@@ -16,6 +16,7 @@ azure:
servicebusSubscription: wkssubscription
servicebusTopic: recordstopic
storageContainer: osdu-wks-mappings
storageAccount: osdumvpdp1glabky7vdata
image:
branch: master
tag: latest
......
......@@ -52,55 +52,42 @@ spec:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_KEYVAULT
- name: AZURE_TENANT_ID
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_TENANT_ID
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: clientid
key: clientid
name: active-directory
key: principal-clientid
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: clientpassword
key: clientpassword
name: active-directory
key: principal-clientpassword
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: tenantid
- name: aad_client_id
valueFrom:
secretKeyRef:
name: appid
key: appid
name: active-directory
key: application-appid
- name: AZURE_APP_RESOURCE_ID
valueFrom:
secretKeyRef:
name: appid
key: appid
name: active-directory
key: application-appid
- name: appinsights_key
valueFrom:
secretKeyRef:
name: appinsights
name: central-logging
key: appinsights
- name: cosmosdb_database
value: osdu-db
- name: servicebus_namespace_name
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_SERVICEBUS_NAMESPACE
- name: servicebus_connection_string
valueFrom:
secretKeyRef:
name: servicebus
key: servicebus
- name: servicebus_topic_name
value: recordstopic
- name: storage_account
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_STORAGE_ACCOUNT
value: osdumvpdp1glabky7vdata
- name: servicebus_topic_subscription
value: wkssubscription
- name: storage_container
......@@ -108,11 +95,11 @@ spec:
- name: server_port
value: "80"
- name: storage_service_endpoint
value: "http://osdu-flux-storage/api/storage/v2"
value: "http://storage/api/storage/v2"
- name: max_concurrent_calls
value: "1"
value: "8"
- name: executor_n_threads
value: "2"
value: "8"
- name: max_lock_renew_duration_seconds
value: "120"
---
......
......@@ -33,7 +33,6 @@ public class AzureBootstrapConfig {
@Value("${azure.servicebus.topic-name}")
private String serviceBusTopic;
@Value("${azure.servicebus.connection-string}")
private String serviceBusConnectionString;
@Value("${azure.servicebus.topic-subscription}")
......@@ -93,13 +92,13 @@ public class AzureBootstrapConfig {
@Bean
@Named("COSMOS_ENDPOINT")
public String cosmosEndpoint(SecretClient kv) {
return getKeyVaultSecret(kv, "cosmos-endpoint");
return getKeyVaultSecret(kv, "opendes-cosmos-endpoint");
}
@Bean
@Named("COSMOS_KEY")
public String cosmosKey(SecretClient kv) {
return getKeyVaultSecret(kv, "cosmos-primary-key");
return getKeyVaultSecret(kv, "opendes-cosmos-primary-key");
}
@Bean
......@@ -108,8 +107,9 @@ public class AzureBootstrapConfig {
}
@Bean
public SubscriptionClient subscriptionClient() {
public SubscriptionClient subscriptionClient(SecretClient kv) {
String entityPath = serviceBusTopic + "/subscriptions/" + serviceBusTopicSubscription;
serviceBusConnectionString = getKeyVaultSecret(kv, "opendes-sb-connection");
ConnectionStringBuilder connectionStringBuilder = new ConnectionStringBuilder(
serviceBusConnectionString,
entityPath
......
......@@ -34,7 +34,6 @@ azure.storage.container-name=${storage_container}
# Azure Service Bus configuration
azure.servicebus.topic-name=${servicebus_topic_name}
azure.servicebus.connection-string=${servicebus_connection_string}
azure.servicebus.topic-subscription=${servicebus_topic_subscription}
# Azure App Insights configuration
......
......@@ -53,20 +53,20 @@ public class AzureBootstrapConfigTest {
@Test
public void configReturnsCorrectSecretCosmosKey() {
doReturn("cosmos-key-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-primary-key");
doReturn("opendes-cosmos-key-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("opendes-cosmos-primary-key");
String secretValue = bootstrapConfig.cosmosKey(kv);
assertEquals( "cosmos-key-secret", secretValue);
assertEquals( "opendes-cosmos-key-secret", secretValue);
}
@Test
public void configReturnsCorrectSecretCosmosEndpoint() {
doReturn("cosmos-endpoint-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-endpoint");
doReturn("opendes-cosmos-endpoint-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("opendes-cosmos-endpoint");
String secretValue = bootstrapConfig.cosmosEndpoint(kv);
assertEquals( "cosmos-endpoint-secret", secretValue);
assertEquals( "opendes-cosmos-endpoint-secret", secretValue);
}
@Test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment