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: ...@@ -3,7 +3,7 @@ variables:
AZURE_BUILD_SUBDIR: provider/wks-azure AZURE_BUILD_SUBDIR: provider/wks-azure
AZURE_TEST_SUBDIR: testing/wks-test-core AZURE_TEST_SUBDIR: testing/wks-test-core
AZURE_DEPLOYMENTS_SUBDIR: deployments/scripts/azure 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 STORAGE_CONTAINER: osdu-wks-mappings
include: include:
......
...@@ -24,7 +24,6 @@ The following software have components provided under the terms of this license: ...@@ -24,7 +24,6 @@ The following software have components provided under the terms of this license:
- ASM Core (from ) - ASM Core (from )
- ASM based accessors helper used by json-smart (from ) - ASM based accessors helper used by json-smart (from )
- Adapter: RxJava (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 BeanUtils (from http://commons.apache.org/proper/commons-beanutils/)
- Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/) - Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/)
- Apache Commons Collections (from http://commons.apache.org/proper/commons-collections/) - 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: ...@@ -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-commons (from http://junit.org/junit5/)
- org.junit.platform:junit-platform-engine (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/) - org.junit.vintage:junit-vintage-engine (from http://junit.org/junit5/)
...@@ -50,55 +50,42 @@ spec: ...@@ -50,55 +50,42 @@ spec:
configMapKeyRef: configMapKeyRef:
name: osdu-svc-properties name: osdu-svc-properties
key: ENV_KEYVAULT key: ENV_KEYVAULT
- name: AZURE_TENANT_ID
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_TENANT_ID
- name: AZURE_CLIENT_ID - name: AZURE_CLIENT_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: clientid name: active-directory
key: clientid key: principal-clientid
- name: AZURE_CLIENT_SECRET - name: AZURE_CLIENT_SECRET
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: clientpassword name: active-directory
key: clientpassword key: principal-clientpassword
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: tenantid
- name: aad_client_id - name: aad_client_id
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: appid name: active-directory
key: appid key: application-appid
- name: AZURE_APP_RESOURCE_ID - name: AZURE_APP_RESOURCE_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: appid name: active-directory
key: appid key: application-appid
- name: appinsights_key - name: appinsights_key
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: appinsights name: central-logging
key: appinsights key: appinsights
- name: cosmosdb_database - name: cosmosdb_database
value: osdu-db 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 - name: servicebus_topic_name
value: {{ .Values.azure.servicebusTopic }} value: {{ .Values.azure.servicebusTopic }}
- name: storage_account - name: storage_account
valueFrom: value: {{ .Values.azure.storageAccount }}
configMapKeyRef:
name: osdu-svc-properties
key: ENV_STORAGE_ACCOUNT
- name: servicebus_topic_subscription - name: servicebus_topic_subscription
value: {{ .Values.azure.servicebusSubscription }} value: {{ .Values.azure.servicebusSubscription }}
- name: storage_container - name: storage_container
...@@ -108,8 +95,8 @@ spec: ...@@ -108,8 +95,8 @@ spec:
- name: storage_service_endpoint - name: storage_service_endpoint
value: "http://storage/api/storage/v2" value: "http://storage/api/storage/v2"
- name: max_concurrent_calls - name: max_concurrent_calls
value: "1" value: "8"
- name: executor_n_threads - name: executor_n_threads
value: "2" value: "8"
- name: max_lock_renew_duration_seconds - name: max_lock_renew_duration_seconds
value: "120" value: "120"
...@@ -16,6 +16,7 @@ azure: ...@@ -16,6 +16,7 @@ azure:
servicebusSubscription: wkssubscription servicebusSubscription: wkssubscription
servicebusTopic: recordstopic servicebusTopic: recordstopic
storageContainer: osdu-wks-mappings storageContainer: osdu-wks-mappings
storageAccount: osdumvpdp1glabky7vdata
image: image:
branch: master branch: master
tag: latest tag: latest
......
...@@ -52,55 +52,42 @@ spec: ...@@ -52,55 +52,42 @@ spec:
configMapKeyRef: configMapKeyRef:
name: osdu-svc-properties name: osdu-svc-properties
key: ENV_KEYVAULT key: ENV_KEYVAULT
- name: AZURE_TENANT_ID
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_TENANT_ID
- name: AZURE_CLIENT_ID - name: AZURE_CLIENT_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: clientid name: active-directory
key: clientid key: principal-clientid
- name: AZURE_CLIENT_SECRET - name: AZURE_CLIENT_SECRET
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: clientpassword name: active-directory
key: clientpassword key: principal-clientpassword
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: tenantid
- name: aad_client_id - name: aad_client_id
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: appid name: active-directory
key: appid key: application-appid
- name: AZURE_APP_RESOURCE_ID - name: AZURE_APP_RESOURCE_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: appid name: active-directory
key: appid key: application-appid
- name: appinsights_key - name: appinsights_key
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: appinsights name: central-logging
key: appinsights key: appinsights
- name: cosmosdb_database - name: cosmosdb_database
value: osdu-db 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 - name: servicebus_topic_name
value: recordstopic value: recordstopic
- name: storage_account - name: storage_account
valueFrom: value: osdumvpdp1glabky7vdata
configMapKeyRef:
name: osdu-svc-properties
key: ENV_STORAGE_ACCOUNT
- name: servicebus_topic_subscription - name: servicebus_topic_subscription
value: wkssubscription value: wkssubscription
- name: storage_container - name: storage_container
...@@ -108,11 +95,11 @@ spec: ...@@ -108,11 +95,11 @@ spec:
- name: server_port - name: server_port
value: "80" value: "80"
- name: storage_service_endpoint - name: storage_service_endpoint
value: "http://osdu-flux-storage/api/storage/v2" value: "http://storage/api/storage/v2"
- name: max_concurrent_calls - name: max_concurrent_calls
value: "1" value: "8"
- name: executor_n_threads - name: executor_n_threads
value: "2" value: "8"
- name: max_lock_renew_duration_seconds - name: max_lock_renew_duration_seconds
value: "120" value: "120"
--- ---
......
...@@ -33,7 +33,6 @@ public class AzureBootstrapConfig { ...@@ -33,7 +33,6 @@ public class AzureBootstrapConfig {
@Value("${azure.servicebus.topic-name}") @Value("${azure.servicebus.topic-name}")
private String serviceBusTopic; private String serviceBusTopic;
@Value("${azure.servicebus.connection-string}")
private String serviceBusConnectionString; private String serviceBusConnectionString;
@Value("${azure.servicebus.topic-subscription}") @Value("${azure.servicebus.topic-subscription}")
...@@ -93,13 +92,13 @@ public class AzureBootstrapConfig { ...@@ -93,13 +92,13 @@ public class AzureBootstrapConfig {
@Bean @Bean
@Named("COSMOS_ENDPOINT") @Named("COSMOS_ENDPOINT")
public String cosmosEndpoint(SecretClient kv) { public String cosmosEndpoint(SecretClient kv) {
return getKeyVaultSecret(kv, "cosmos-endpoint"); return getKeyVaultSecret(kv, "opendes-cosmos-endpoint");
} }
@Bean @Bean
@Named("COSMOS_KEY") @Named("COSMOS_KEY")
public String cosmosKey(SecretClient kv) { public String cosmosKey(SecretClient kv) {
return getKeyVaultSecret(kv, "cosmos-primary-key"); return getKeyVaultSecret(kv, "opendes-cosmos-primary-key");
} }
@Bean @Bean
...@@ -108,8 +107,9 @@ public class AzureBootstrapConfig { ...@@ -108,8 +107,9 @@ public class AzureBootstrapConfig {
} }
@Bean @Bean
public SubscriptionClient subscriptionClient() { public SubscriptionClient subscriptionClient(SecretClient kv) {
String entityPath = serviceBusTopic + "/subscriptions/" + serviceBusTopicSubscription; String entityPath = serviceBusTopic + "/subscriptions/" + serviceBusTopicSubscription;
serviceBusConnectionString = getKeyVaultSecret(kv, "opendes-sb-connection");
ConnectionStringBuilder connectionStringBuilder = new ConnectionStringBuilder( ConnectionStringBuilder connectionStringBuilder = new ConnectionStringBuilder(
serviceBusConnectionString, serviceBusConnectionString,
entityPath entityPath
......
...@@ -34,7 +34,6 @@ azure.storage.container-name=${storage_container} ...@@ -34,7 +34,6 @@ azure.storage.container-name=${storage_container}
# Azure Service Bus configuration # Azure Service Bus configuration
azure.servicebus.topic-name=${servicebus_topic_name} azure.servicebus.topic-name=${servicebus_topic_name}
azure.servicebus.connection-string=${servicebus_connection_string}
azure.servicebus.topic-subscription=${servicebus_topic_subscription} azure.servicebus.topic-subscription=${servicebus_topic_subscription}
# Azure App Insights configuration # Azure App Insights configuration
......
...@@ -53,20 +53,20 @@ public class AzureBootstrapConfigTest { ...@@ -53,20 +53,20 @@ public class AzureBootstrapConfigTest {
@Test @Test
public void configReturnsCorrectSecretCosmosKey() { public void configReturnsCorrectSecretCosmosKey() {
doReturn("cosmos-key-secret").when(secret).getValue(); doReturn("opendes-cosmos-key-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-primary-key"); doReturn(secret).when(kv).getSecret("opendes-cosmos-primary-key");
String secretValue = bootstrapConfig.cosmosKey(kv); String secretValue = bootstrapConfig.cosmosKey(kv);
assertEquals( "cosmos-key-secret", secretValue); assertEquals( "opendes-cosmos-key-secret", secretValue);
} }
@Test @Test
public void configReturnsCorrectSecretCosmosEndpoint() { public void configReturnsCorrectSecretCosmosEndpoint() {
doReturn("cosmos-endpoint-secret").when(secret).getValue(); doReturn("opendes-cosmos-endpoint-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-endpoint"); doReturn(secret).when(kv).getSecret("opendes-cosmos-endpoint");
String secretValue = bootstrapConfig.cosmosEndpoint(kv); String secretValue = bootstrapConfig.cosmosEndpoint(kv);
assertEquals( "cosmos-endpoint-secret", secretValue); assertEquals( "opendes-cosmos-endpoint-secret", secretValue);
} }
@Test @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