Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for deployment in Azure Government Cloud (Leonardo) #4813

Open
wants to merge 76 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
076a814
Replace pet Token with leo token
jsaun Jun 18, 2024
f96846a
Replace pet service account tokens with leo service account
jsaun Aug 25, 2024
480ac44
Fix build
jsaun Aug 25, 2024
7ffc656
Fix
jsaun Aug 25, 2024
2a49a1d
Test custom chart
jsaun Sep 11, 2024
c9f44e8
Update wds chart
jsaun Sep 11, 2024
da173ef
Use local helm chart
jsaun Sep 12, 2024
79ebef8
Update Dependencies.scala
jsaun Oct 7, 2024
abe660c
carry over other changes
jsaun Oct 16, 2024
59bc2ea
Update clean_install.sh
jsaun Oct 16, 2024
e70ec14
Update MonitorAtBoot.scala
jsaun Oct 16, 2024
548b753
Update AKSInterpreter.scala
jsaun Oct 16, 2024
adad799
Remove leo auth token from app charts
jsaun Oct 16, 2024
6e056b6
Update CromwellRunnerAppInstall.scala
jsaun Oct 16, 2024
f912dea
Remove auth tokens from app configs
jsaun Oct 22, 2024
a7d27af
Update LeoAppServiceInterp.scala
jsaun Oct 28, 2024
b592443
Update Dependencies.scala
jsaun Oct 28, 2024
e597b53
Update Dependencies.scala
jsaun Oct 28, 2024
b050782
Update Dependencies.scala
jsaun Oct 28, 2024
aa1586e
Update LeoAppServiceInterp.scala
jsaun Oct 30, 2024
23d6ca2
Revert "Update LeoAppServiceInterp.scala"
jsaun Oct 30, 2024
134b8ac
Get leo email from token
jsaun Oct 30, 2024
59aff84
Update reference.conf
jsaun Nov 4, 2024
58fd927
Update Dependencies.scala
bennettn4 Nov 5, 2024
7355698
Update Dependencies.scala
bennettn4 Nov 6, 2024
d1c31af
update gov servicebus and sql suffixes
bennettn4 Nov 6, 2024
83a04ac
fix import and typo
bennettn4 Nov 6, 2024
78df15b
update azure gov config
bennettn4 Nov 6, 2024
9c521d9
update storage account suffix to support azure gov
bennettn4 Nov 7, 2024
e49ce53
Fix postgres suffix in commercial
jsaun Nov 10, 2024
5f9bcfb
test cromwell version
bennettn4 Nov 14, 2024
a592658
Update CromwellAppInstall.scala
bennettn4 Nov 14, 2024
12e1ad7
with test cromwell-runner-app version
bennettn4 Nov 15, 2024
93fa992
Update reference.conf
bennettn4 Nov 15, 2024
ae97497
update tokenscope
bennettn4 Nov 15, 2024
1518e8d
update batch account suffix and re-value environment strings to match…
bennettn4 Nov 18, 2024
e9fb894
update test cromwell version
bennettn4 Nov 18, 2024
be60a6e
Update Dependencies.scala
bennettn4 Nov 18, 2024
8b4ea1f
Update AzureHostingModeConfig.scala
bennettn4 Nov 18, 2024
6bc1d1b
Update CromwellAppInstall.scala
bennettn4 Nov 18, 2024
1d7eabc
Update CromwellRunnerAppInstall.scala
bennettn4 Nov 18, 2024
a9d6b4d
Update AppDependenciesBuilder.scala
jsaun Nov 24, 2024
2bdcaa7
update relay suffix in notebook init script
bennettn4 Nov 29, 2024
fc5466c
Update AzurePubsubHandler.scala
bennettn4 Dec 2, 2024
f58c237
Update reference.conf
bennettn4 Dec 5, 2024
74bb32b
Update Dependencies.scala
jsaun Dec 17, 2024
03d1e94
Revert "Update reference.conf"
jsaun Dec 17, 2024
94b029e
Merge branch 'develop' into jsaun/leo-service-account
jsaun Dec 17, 2024
caf5465
Update reference.conf
jsaun Dec 17, 2024
666b19a
Default empty user token
jsaun Dec 17, 2024
fdfb13f
pr cleanup
jsaun Dec 17, 2024
afd724a
Fix types
jsaun Dec 18, 2024
a7fc8dd
Update WdsAppInstall.scala
jsaun Dec 20, 2024
a6c9800
Fix specs
jsaun Dec 21, 2024
64a1920
scalaFmt
jsaun Dec 21, 2024
25110ff
scalaFmt again
jsaun Dec 21, 2024
80b8afe
Merge branch 'develop' into jsaun/leo-service-account
jsaun Dec 23, 2024
53d2399
Update HailBatchAppInstallSpec.scala
bennettn4 Dec 26, 2024
a0f5a16
Update AppServiceInterpSpec.scala
bennettn4 Dec 26, 2024
3627fe6
Update AllowlistAuthProvider.scala
bennettn4 Dec 26, 2024
59e0cc6
Update AppServiceInterpSpec.scala
bennettn4 Dec 26, 2024
ae716da
update helm override specs
bennettn4 Dec 26, 2024
ef9015a
scalafmt
bennettn4 Dec 26, 2024
a29056c
update specs
bennettn4 Dec 30, 2024
50dd92b
update test specs
bennettn4 Dec 30, 2024
9f228c7
Update ConfigReaderSpec.scala
bennettn4 Dec 30, 2024
a209d3e
Address pr comments
jsaun Jan 28, 2025
df089ce
fix imports
jsaun Jan 28, 2025
64a81d7
Merge branch 'develop' into jsaun/leo-service-account
jsaun Jan 28, 2025
63f36e4
Remove placeholder cromwell image
jsaun Jan 31, 2025
5b3b326
Merge branch 'develop' into jsaun/leo-service-account
jsaun Jan 31, 2025
3363e56
Update CromwellRunnerAppInstallSpec.scala
jsaun Feb 3, 2025
1c68ff4
Update ConfigReaderSpec.scala
jsaun Feb 3, 2025
c9abbea
Update ConfigReaderSpec.scala
jsaun Feb 3, 2025
52da05d
Update ConfigReaderSpec.scala
jsaun Feb 4, 2025
c39ccc3
Update ConfigReaderSpec.scala
jsaun Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ SAMURL=$6
SAMRESOURCEID=$7
CONTENTSECURITYPOLICY_FILE=$8

RELAY_SUFFIX=${21:-".servicebus.windows.net"}

# Envs for welder
WELDER_WSM_URL=${9:-localhost}
WORKSPACE_ID="${10:-dummy}" # Additionally used for welder
Expand All @@ -126,11 +128,11 @@ WORKSPACE_STORAGE_CONTAINER_URL="${17:-dummy}"
SERVER_APP_BASE_URL="/${RELAY_CONNECTION_NAME}/"
SERVER_APP_ALLOW_ORIGIN="*"
HCVAR='\$hc'
SERVER_APP_WEBSOCKET_URL="wss://${RELAY_NAME}.servicebus.windows.net/${HCVAR}/${RELAY_CONNECTION_NAME}"
SERVER_APP_WEBSOCKET_HOST="${RELAY_NAME}.servicebus.windows.net"
SERVER_APP_WEBSOCKET_URL="wss://${RELAY_NAME}${RELAY_SUFFIX}/${HCVAR}/${RELAY_CONNECTION_NAME}"
SERVER_APP_WEBSOCKET_HOST="${RELAY_NAME}${RELAY_SUFFIX}"

# Relay listener configuration
RELAY_CONNECTIONSTRING="Endpoint=sb://${RELAY_NAME}.servicebus.windows.net/;SharedAccessKeyName=listener;SharedAccessKey=${RELAY_CONNECTION_POLICY_KEY};EntityPath=${RELAY_CONNECTION_NAME}"
RELAY_CONNECTIONSTRING="Endpoint=sb://${RELAY_NAME}${RELAY_SUFFIX}/;SharedAccessKeyName=listener;SharedAccessKey=${RELAY_CONNECTION_POLICY_KEY};EntityPath=${RELAY_CONNECTION_NAME}"

# Relay listener configuration - setDateAccessed listener
LEONARDO_URL="${18:-dummy}"
Expand All @@ -143,6 +145,7 @@ echo "RELAY_NAME = ${RELAY_NAME}"
echo "RELAY_CONNECTION_NAME = ${RELAY_CONNECTION_NAME}"
echo "RELAY_TARGET_HOST = ${RELAY_TARGET_HOST}"
echo "RELAY_CONNECTION_POLICY_KEY = ${RELAY_CONNECTION_POLICY_KEY}"
echo "RELAY_SUFFIX = ${RELAY_SUFFIX}"
echo "LISTENER_DOCKER_IMAGE = ${LISTENER_DOCKER_IMAGE}"
echo "SAMURL = ${SAMURL}"
echo "SAMRESOURCEID = ${SAMRESOURCEID}"
Expand Down
2 changes: 1 addition & 1 deletion http/src/main/resources/leo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ azure {
# If true, it is assumed that Leo is hosted on Azure and will use Azure managed identity for authentication.
enabled = ${?AZURE_HOSTING_MODE_ENABLED}
# valid values are AZURE (Azure Commercial), AZURE_US_GOVERNMENT and AZURE_CHINA
azure-environment = ${?AZURE_HOSTING_ENVIRONMENT}
azure-environment = ${?AZURE_ENVIRONMENT}
managed-identity-auth-config{
token-scope = ${?AZURE_MI_TOKEN_SCOPE}
token-acquisition-timeout = ${?AZURE_MI_TOKEN_ACQUISITION_TIMEOUT}
Expand Down
4 changes: 2 additions & 2 deletions http/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ azure {
type = "CustomScript",
version = "2.1",
minor-version-auto-upgrade = true,
file-uris = ["https://raw.githubusercontent.com/DataBiosphere/leonardo/8390d25ccd761fb206cf388560a571be77a42bbd/http/src/main/resources/init-resources/azure_vm_init_script.sh"]
file-uris = ["https://raw.githubusercontent.com/DataBiosphere/leonardo/f58c237b4dc235cd1c24c6dfc7500c07bdbd5bc3/http/src/main/resources/init-resources/azure_vm_init_script.sh"]
}
# [IA-4997] to support CHIPS by setting partitioned cookies
# listener-image = "terradevacrpublic.azurecr.io/terra-azure-relay-listeners:474f157"
Expand Down Expand Up @@ -374,7 +374,7 @@ azure {
cromwell-runner-app-config {
instrumentation-enabled = false
chart-name = "terra-helm/cromwell-runner-app"
chart-version = "0.197.0"
chart-version = "0.198.0"
release-name-suffix = "cra-rls"
namespace-name-suffix = "cra-ns"
ksa-name = "cra-ksa"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import org.broadinstitute.dsde.workbench.leonardo.app.AppInstall.getAzureDatabaseName
import org.broadinstitute.dsde.workbench.leonardo.{AppContext, WsmControlledDatabaseResource}
import org.broadinstitute.dsde.workbench.leonardo.app.Database.ControlledDatabase
import org.broadinstitute.dsde.workbench.leonardo.config.CoaAppConfig
import org.broadinstitute.dsde.workbench.leonardo.auth.SamAuthProvider
import org.broadinstitute.dsde.workbench.leonardo.config.{AzureEnvironmentConverter, CoaAppConfig}
import org.broadinstitute.dsde.workbench.leonardo.dao._
import org.broadinstitute.dsde.workbench.leonardo.http._
import org.broadinstitute.dsde.workbench.leonardo.util.AppCreationException
Expand All @@ -25,7 +26,8 @@
cromwellDao: CromwellDAO[F],
cbasDao: CbasDAO[F],
azureBatchService: AzureBatchService[F],
azureApplicationInsightsService: AzureApplicationInsightsService[F]
azureApplicationInsightsService: AzureApplicationInsightsService[F],
authProvider: SamAuthProvider[F]
)(implicit
F: Async[F]
) extends AppInstall[F] {
Expand Down Expand Up @@ -69,10 +71,15 @@

// Get the pet userToken
tokenOpt <- samDao.getCachedArbitraryPetAccessToken(params.app.auditInfo.creator)
userToken <- F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))
)
userToken <- ConfigReader.appConfig.azure.hostingModeConfig.enabled match {
case false =>
F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))

Check warning on line 78 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellAppInstall.scala#L78

Added line #L78 was not covered by tests
)
case true =>
F.pure("") // No pet user token in Azure.

Check warning on line 81 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellAppInstall.scala#L81

Added line #L81 was not covered by tests
}

values = List(
// azure resources configs
Expand All @@ -85,13 +92,22 @@
raw"config.subscriptionId=${params.cloudContext.subscriptionId.value}",
raw"config.region=${params.landingZoneResources.region}",
raw"config.applicationInsightsConnectionString=${applicationInsightsComponent.connectionString()}",
raw"config.azureEnvironment=${ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment}",
raw"config.azureManagementTokenScope=${AzureEnvironmentConverter
.fromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)
.getResourceManagerEndpoint}.default",
raw"config.batchAccountSuffix=${AzureEnvironmentConverter
.batchAccountSuffixFromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)}",

// relay configs
raw"relay.path=${params.relayPath.renderString}",

// persistence configs
raw"persistence.storageResourceGroup=${params.cloudContext.managedResourceGroupName.value}",
raw"persistence.storageAccount=${params.landingZoneResources.storageAccountName.value}",
raw"persistence.storageAccountSuffix=${AzureEnvironmentConverter
.fromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)
.getStorageEndpointSuffix}",
raw"persistence.blobContainer=${storageContainer.name.value}",
raw"persistence.leoAppInstanceName=${params.app.appName.value}",
raw"persistence.workspaceManager.url=${params.config.wsmConfig.uri.renderString}",
Expand Down Expand Up @@ -124,7 +140,8 @@

// Database configs
raw"postgres.podLocalDatabaseEnabled=false",
raw"postgres.host=${postgresServer.name}.postgres.database.azure.com",
raw"postgres.host=${postgresServer.name}.postgres${AzureEnvironmentConverter
.postgresSuffixFromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)}",
raw"postgres.pgbouncer.enabled=${postgresServer.pgBouncerEnabled}",
// convention is that the database user is the same as the service account name
raw"postgres.user=${params.ksaName.value}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.broadinstitute.dsde.workbench.leonardo.app.AppInstall.getAzureDatabaseName
import org.broadinstitute.dsde.workbench.leonardo.app.Database.{ControlledDatabase, ReferenceDatabase}
import org.broadinstitute.dsde.workbench.leonardo.auth.SamAuthProvider
import org.broadinstitute.dsde.workbench.leonardo.config.{CromwellRunnerAppConfig, SamConfig}
import org.broadinstitute.dsde.workbench.leonardo.config.{AzureEnvironmentConverter, CromwellRunnerAppConfig, SamConfig}
import org.broadinstitute.dsde.workbench.leonardo.dao.{BpmApiClientProvider, CromwellDAO, SamDAO}
import org.broadinstitute.dsde.workbench.leonardo.http._
import org.broadinstitute.dsde.workbench.leonardo.util.AppCreationException
Expand Down Expand Up @@ -80,11 +80,6 @@
)

// Get the pet userToken
tokenOpt <- samDao.getCachedArbitraryPetAccessToken(params.app.auditInfo.creator)
userToken <- F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))
)

leoAuth <- authProvider.getLeoAuthToken

Expand All @@ -99,6 +94,18 @@
.map(v => raw"config.concurrentJobLimit=${v}")
}

// Get the pet userToken
tokenOpt <- samDao.getCachedArbitraryPetAccessToken(params.app.auditInfo.creator)
userToken <- ConfigReader.appConfig.azure.hostingModeConfig.enabled match {
case false =>
F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))

Check warning on line 103 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellRunnerAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellRunnerAppInstall.scala#L103

Added line #L103 was not covered by tests
)
case true =>
F.pure("") // No pet user token in Azure.

Check warning on line 106 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellRunnerAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/CromwellRunnerAppInstall.scala#L106

Added line #L106 was not covered by tests
}

values = List(
// azure resources configs
raw"config.resourceGroup=${params.cloudContext.managedResourceGroupName.value}",
Expand All @@ -110,12 +117,21 @@
raw"config.subscriptionId=${params.cloudContext.subscriptionId.value}",
raw"config.region=${params.landingZoneResources.region}",
raw"config.applicationInsightsConnectionString=${applicationInsightsComponent.connectionString()}",
raw"config.azureEnvironment=${ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment}",
raw"config.azureManagementTokenScope=${AzureEnvironmentConverter
.fromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)
.getResourceManagerEndpoint}.default",
raw"config.batchAccountSuffix=${AzureEnvironmentConverter
.batchAccountSuffixFromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)}",

// relay configs
raw"relay.path=${params.relayPath.renderString}",

// persistence configs
raw"persistence.storageAccount=${params.landingZoneResources.storageAccountName.value}",
raw"persistence.storageAccountSuffix=${AzureEnvironmentConverter
.fromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)
.getStorageEndpointSuffix}",
raw"persistence.blobContainer=${storageContainer.name.value}",
raw"persistence.leoAppInstanceName=${params.app.appName.value}",
raw"persistence.workspaceManager.url=${params.config.wsmConfig.uri.renderString}",
Expand All @@ -138,7 +154,8 @@

// database configs
raw"postgres.podLocalDatabaseEnabled=false",
raw"postgres.host=${postgresServer.name}.postgres.database.azure.com",
raw"postgres.host=${postgresServer.name}.postgres${AzureEnvironmentConverter
.postgresSuffixFromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)}",
raw"postgres.pgbouncer.enabled=${postgresServer.pgBouncerEnabled}",
// convention is that the database user is the same as the service account name
raw"postgres.user=${params.ksaName.value}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import cats.effect.Async
import cats.mtl.Ask
import cats.syntax.all._
import org.broadinstitute.dsde.workbench.leonardo.AppContext
import org.broadinstitute.dsde.workbench.leonardo.config.HailBatchAppConfig
import org.broadinstitute.dsde.workbench.leonardo.config.{AzureEnvironmentConverter, HailBatchAppConfig}
import org.broadinstitute.dsde.workbench.leonardo.dao.HailBatchDAO
import org.broadinstitute.dsde.workbench.leonardo.http.ConfigReader
import org.broadinstitute.dsde.workbench.leonardo.util.AppCreationException
import org.broadinstitute.dsp.Values
import org.http4s.Uri
Expand Down Expand Up @@ -34,7 +35,9 @@ class HailBatchAppInstall[F[_]](config: HailBatchAppConfig, hailBatchDao: HailBa
raw"persistence.workspaceManager.url=${params.config.wsmConfig.uri.renderString}",
raw"persistence.workspaceManager.workspaceId=${params.workspaceId.value}",
raw"persistence.workspaceManager.containerResourceId=${storageContainer.resourceId.value.toString}",
raw"persistence.workspaceManager.storageContainerUrl=https://${params.landingZoneResources.storageAccountName.value}.blob.core.windows.net/${storageContainer.name.value}",
raw"persistence.workspaceManager.storageContainerUrl=https://${params.landingZoneResources.storageAccountName.value}.blob${AzureEnvironmentConverter
.fromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)
.getStorageEndpointSuffix}/${storageContainer.name.value}",
raw"persistence.leoAppName=${params.app.appName.value}",

// identity configs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import cats.syntax.all._
import org.broadinstitute.dsde.workbench.azure.AzureApplicationInsightsService
import org.broadinstitute.dsde.workbench.leonardo.app.Database.ControlledDatabase
import org.broadinstitute.dsde.workbench.leonardo.config.WdsAppConfig
import org.broadinstitute.dsde.workbench.leonardo.auth.SamAuthProvider
import org.broadinstitute.dsde.workbench.leonardo.config.{AzureEnvironmentConverter, WdsAppConfig}
import org.broadinstitute.dsde.workbench.leonardo.dao._
import org.broadinstitute.dsde.workbench.leonardo.http._
import org.broadinstitute.dsde.workbench.leonardo.util.AppCreationException
Expand All @@ -23,7 +24,8 @@
tdrConfig: TdrConfig,
samDao: SamDAO[F],
wdsDao: WdsDAO[F],
azureApplicationInsightsService: AzureApplicationInsightsService[F]
azureApplicationInsightsService: AzureApplicationInsightsService[F],
authProvider: SamAuthProvider[F]
)(implicit
F: Async[F]
) extends AppInstall[F] {
Expand Down Expand Up @@ -54,15 +56,22 @@
)

// Get the pet userToken
tokenOpt <- samDao.getCachedArbitraryPetAccessToken(params.app.auditInfo.creator)
userToken <- F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))
)

// Get Vpa enabled tag
vpaEnabled <- F.pure(params.landingZoneResources.aksCluster.tags.getOrElse("aks-cost-vpa-enabled", false))

// Get the pet userToken
tokenOpt <- samDao.getCachedArbitraryPetAccessToken(params.app.auditInfo.creator)
userToken <- ConfigReader.appConfig.azure.hostingModeConfig.enabled match {
case false =>
F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))

Check warning on line 69 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WdsAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WdsAppInstall.scala#L69

Added line #L69 was not covered by tests
)
case true =>
F.pure("") // No pet user token in Azure.

Check warning on line 72 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WdsAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WdsAppInstall.scala#L72

Added line #L72 was not covered by tests
}

valuesList =
List(
// pass enviiroment information to wds so it can properly pick its config
Expand Down Expand Up @@ -96,7 +105,8 @@
raw"provenance.sourceWorkspaceId=${params.app.sourceWorkspaceId.map(_.value).getOrElse("")}",

// database configs
raw"postgres.host=${postgresServer.name}.postgres.database.azure.com",
raw"postgres.host=${postgresServer.name}.postgres${AzureEnvironmentConverter
.postgresSuffixFromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)}",
raw"postgres.pgbouncer.enabled=${postgresServer.pgBouncerEnabled}",
raw"postgres.dbname=$dbName",
// convention is that the database user is the same as the service account name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.broadinstitute.dsde.workbench.leonardo.{AppContext, WsmControlledDatabaseResource}
import org.broadinstitute.dsde.workbench.leonardo.app.AppInstall.getAzureDatabaseName
import org.broadinstitute.dsde.workbench.leonardo.app.Database.ControlledDatabase
import org.broadinstitute.dsde.workbench.leonardo.config.WorkflowsAppConfig
import org.broadinstitute.dsde.workbench.leonardo.config.{AzureEnvironmentConverter, WorkflowsAppConfig}
import org.broadinstitute.dsde.workbench.leonardo.dao._
import org.broadinstitute.dsde.workbench.leonardo.http._
import org.broadinstitute.dsde.workbench.leonardo.util.AppCreationException
Expand Down Expand Up @@ -69,10 +69,15 @@

// Get the pet userToken
tokenOpt <- samDao.getCachedArbitraryPetAccessToken(params.app.auditInfo.creator)
userToken <- F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))
)
userToken <- ConfigReader.appConfig.azure.hostingModeConfig.enabled match {
case false =>
F.fromOption(
tokenOpt,
AppCreationException(s"Pet not found for user ${params.app.auditInfo.creator}", Some(ctx.traceId))

Check warning on line 76 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WorkflowsAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WorkflowsAppInstall.scala#L76

Added line #L76 was not covered by tests
)
case true =>
F.pure("") // No pet user token in Azure.

Check warning on line 79 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WorkflowsAppInstall.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/app/WorkflowsAppInstall.scala#L79

Added line #L79 was not covered by tests
}

values =
List(
Expand Down Expand Up @@ -111,7 +116,8 @@

// database configs
raw"postgres.podLocalDatabaseEnabled=false",
raw"postgres.host=${postgresServer.name}.postgres.database.azure.com",
raw"postgres.host=${postgresServer.name}.postgres${AzureEnvironmentConverter
.postgresSuffixFromString(ConfigReader.appConfig.azure.hostingModeConfig.azureEnvironment)}",
raw"postgres.pgbouncer.enabled=${postgresServer.pgBouncerEnabled}",
// convention is that the database user is the same as the service account name
raw"postgres.user=${params.ksaName.value}",
Expand Down
Loading
Loading