diff --git a/http/src/main/resources/reference.conf b/http/src/main/resources/reference.conf index 7738a89ab14..ef57cc4c4d0 100644 --- a/http/src/main/resources/reference.conf +++ b/http/src/main/resources/reference.conf @@ -513,7 +513,7 @@ gke { # Templated by firecloud-develop postgres.password = "replace-me" orchUrl = "https://firecloud-orchestration.dsde-dev.broadinstitute.org/api/" - drsUrl = "https://drshub.dsde-dev.broadinstitute.org/api/v4/drs/resolve" + drsUrl = ${drs.url} minMemoryGb = 5 minNumOfCpus = 3 } @@ -946,3 +946,7 @@ app-service { # Defaults to true, but disabled for fiab runs enable-custom-app-check = true } + +drs { + url = "https://drshub.dsde-dev.broadinstitute.org/api/v4/drs/resolve" +} diff --git a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/Boot.scala b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/Boot.scala index 0fdaae63da3..c82a8c6d87f 100644 --- a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/Boot.scala +++ b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/Boot.scala @@ -606,7 +606,8 @@ object Boot extends IOApp { ConfigReader.appConfig.azure.appRegistration, samConfig, appMonitorConfig, - ConfigReader.appConfig.azure.wsm + ConfigReader.appConfig.azure.wsm, + ConfigReader.appConfig.drs ), helmClient, azureContainerService, diff --git a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReader.scala b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReader.scala index 54361d0f1ad..633b71da449 100644 --- a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReader.scala +++ b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReader.scala @@ -39,11 +39,14 @@ final case class AadPodIdentityConfig(namespace: Namespace, values: Values ) +final case class DrsConfig(url: String) + // Note: pureconfig supports reading kebab case into camel case in code by default // More docs see https://pureconfig.github.io/docs/index.html final case class AppConfig( terraAppSetupChart: TerraAppSetupChartConfig, persistentDisk: PersistentDiskConfig, azure: AzureConfig, - oidc: OidcAuthConfig + oidc: OidcAuthConfig, + drs: DrsConfig ) diff --git a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala index 598d40c34e6..fe347513474 100644 --- a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala +++ b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala @@ -303,7 +303,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig, // TODO (TOAZ-241): pass correct information for TES running in a Terra workspace raw"config.batchAccountName=${landingZoneResources.batchAccountName.value}", raw"config.batchNodesSubnetId=${landingZoneResources.batchNodesSubnetName.value}", - raw"config.drsUrl=???", + raw"config.drsUrl=${config.drsConfig.url}", // relay configs raw"relay.path=$relayEndpoint", @@ -315,7 +315,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig, raw"persistence.leoAppInstanceName=${appName.value}", raw"persistence.workspaceManager.url=${config.wsmConfig.uri.renderString}", raw"persistence.workspaceManager.workspaceId=${workspaceId.value}", - raw"persistence.workspaceManager.workspaceContainerId=${storageContainer.resourceId.value.toString}", + raw"persistence.workspaceManager.containerResourceId=${storageContainer.resourceId.value.toString}", // identity configs raw"identity.name=${petManagedIdentity.name()}", @@ -679,5 +679,6 @@ final case class AKSInterpreterConfig( appRegistrationConfig: AzureAppRegistrationConfig, samConfig: SamConfig, appMonitorConfig: AppMonitorConfig, - wsmConfig: HttpWsmDaoConfig + wsmConfig: HttpWsmDaoConfig, + drsConfig: DrsConfig ) diff --git a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReaderSpec.scala b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReaderSpec.scala index 16433d5dfd1..53ceea1440c 100644 --- a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReaderSpec.scala +++ b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/http/ConfigReaderSpec.scala @@ -98,6 +98,9 @@ class ConfigReaderSpec extends AnyFlatSpec with Matchers { org.broadinstitute.dsde.workbench.oauth2.ClientId("fakeClientId"), Some(org.broadinstitute.dsde.workbench.oauth2.ClientSecret("fakeClientSecret")), org.broadinstitute.dsde.workbench.oauth2.ClientId("legacyClientSecret") + ), + DrsConfig( + "https://drshub.dsde-dev.broadinstitute.org/api/v4/drs/resolve" ) ) diff --git a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreterSpec.scala b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreterSpec.scala index f3d2ab3e20d..974768361d6 100644 --- a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreterSpec.scala +++ b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreterSpec.scala @@ -56,7 +56,8 @@ class AKSInterpreterSpec extends AnyFlatSpecLike with TestComponent with Leonard ConfigReader.appConfig.azure.appRegistration, SamConfig("https://sam"), appMonitorConfig, - ConfigReader.appConfig.azure.wsm + ConfigReader.appConfig.azure.wsm, + ConfigReader.appConfig.drs ) val mockSamDAO = setUpMockSamDAO @@ -136,14 +137,14 @@ class AKSInterpreterSpec extends AnyFlatSpecLike with TestComponent with Leonard "config.resourceGroup=mrg," + "config.batchAccountName=batch," + "config.batchNodesSubnetId=subnet1," + - "config.drsUrl=???," + + s"config.drsUrl=${ConfigReader.appConfig.drs.url}," + "relay.path=https://relay.com/app," + "persistence.storageAccount=storage," + "persistence.blobContainer=sc-container," + "persistence.leoAppInstanceName=app," + s"persistence.workspaceManager.url=${ConfigReader.appConfig.azure.wsm.uri.renderString}," + s"persistence.workspaceManager.workspaceId=${workspaceId.value}," + - s"persistence.workspaceManager.workspaceContainerId=${storageContainer.resourceId.value.toString}," + + s"persistence.workspaceManager.containerResourceId=${storageContainer.resourceId.value.toString}," + "identity.name=identity-name," + "identity.resourceId=identity-id," + "identity.clientId=identity-client-id," + diff --git a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSManualTest.scala b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSManualTest.scala index 39da72ce192..82ee2c4ab32 100644 --- a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSManualTest.scala +++ b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSManualTest.scala @@ -149,7 +149,8 @@ object AKSManualTest { appRegConfig, SamConfig("https://sam.dsde-dev.broadinstitute.org/"), appMonitorConfig, - ConfigReader.appConfig.azure.wsm + ConfigReader.appConfig.azure.wsm, + ConfigReader.appConfig.drs ) // TODO Sam and Cromwell should not be using mocks } yield new AKSInterpreter(