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

[IA-4681] Update terra-common-lib #4732

Merged
merged 43 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2e94172
[IA-4681] Update terra-common-lib
lucymcnatt Aug 1, 2024
6f76284
Update Kubernetes methods
lucymcnatt Aug 12, 2024
379bfd1
false not true ugh
lucymcnatt Aug 12, 2024
8956b52
remove spring configuration
lucymcnatt Aug 12, 2024
cb032bf
chage merge strategy
lucymcnatt Aug 14, 2024
3256ef2
trying diff string matching...
lucymcnatt Aug 14, 2024
eaced2f
trying concat strat
lucymcnatt Aug 14, 2024
8c3d059
exclude telem from tcl
lucymcnatt Aug 14, 2024
decfa7d
update wblibs
lucymcnatt Aug 14, 2024
2005d64
update wblibs
lucymcnatt Aug 14, 2024
b345bac
Merge branch 'develop' into IA-4681-update-tcl
lucymcnatt Aug 14, 2024
9df2cc5
exclude spring from opentelem
lucymcnatt Aug 15, 2024
da27815
another name I guess
lucymcnatt Aug 15, 2024
e3df51f
change Merging file!
lucymcnatt Aug 15, 2024
ef70d24
add liquibase changelog file arg
lucymcnatt Aug 16, 2024
81245a8
fix commandscope
lucymcnatt Aug 16, 2024
af89049
ughh
lucymcnatt Aug 16, 2024
b364842
add url
lucymcnatt Aug 16, 2024
646d8b5
exclude liquibase
lucymcnatt Aug 16, 2024
4b13c86
remove commandscope
lucymcnatt Aug 16, 2024
ce21b28
remove comment
lucymcnatt Aug 16, 2024
8209671
fix test code
lucymcnatt Aug 16, 2024
fab67b4
fmt
lucymcnatt Aug 16, 2024
61cea4b
Merge branch 'develop' into IA-4681-update-tcl
LizBaldo Aug 20, 2024
06097aa
Merge branch 'develop' into IA-4681-update-tcl
LizBaldo Aug 20, 2024
5604e41
Merge branch 'develop' into IA-4681-update-tcl
LizBaldo Aug 20, 2024
292b44b
Merge branch 'develop' into IA-4681-update-tcl
LizBaldo Aug 20, 2024
79992f6
fix command in the response
LizBaldo Aug 22, 2024
0cbc563
Merge branch 'develop' into IA-4681-update-tcl
LizBaldo Aug 22, 2024
4d3af4a
cleaning up log messages
LizBaldo Aug 22, 2024
bc0c806
final clean up
LizBaldo Aug 22, 2024
db40dd1
Merge branch 'develop' of github.com:DataBiosphere/leonardo into IA-4…
LizBaldo Aug 22, 2024
67391ee
Merge branch 'IA-4681-update-tcl' of github.com:DataBiosphere/leonard…
LizBaldo Aug 22, 2024
9b09da6
testing if workbenchlibs is the issue
LizBaldo Aug 26, 2024
3b6e1db
actually committing the correct file...
LizBaldo Aug 26, 2024
f1f1e46
revert workbenchlib rollback
LizBaldo Aug 26, 2024
7d16e53
downgrading tcl to where k8s client was upgraded
LizBaldo Aug 26, 2024
32fe609
downgrade to the tcl using the kubernetes legacy api
LizBaldo Aug 26, 2024
9e6942f
cleanup
LizBaldo Aug 26, 2024
5be87a3
leave comment regarding the use of legacy kubernetes api
LizBaldo Aug 26, 2024
f3e4e15
Merge branch 'develop' into IA-4681-update-tcl
LizBaldo Aug 26, 2024
7c8c08f
revert workbenchlib again because of opentelemetry issue
LizBaldo Aug 26, 2024
f2a5358
exclude opentelemetry from tcl
LizBaldo Aug 27, 2024
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 @@ -33,6 +33,7 @@ object DbReference extends LazyLogging {
changelogParameters.foreach { case (key, value) => liquibase.setChangeLogParameter(key, value) }

liquibase.update(new Contexts(), new LabelExpression())
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved

} catch {
case e: SQLTimeoutException =>
val isCertProblem = Throwables.getRootCause(e).isInstanceOf[SunCertPathBuilderException]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,19 +365,7 @@ class LeoMetricsMonitor[F[_]](config: LeoMetricsMonitorConfig,
val labelSelector = s"leoAppName=${app.appName.value}"
for {
pods <- F.blocking(
client.listNamespacedPod(namespace.value,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method was changed so that the arguments are now setter functions

null,
null,
null,
null,
labelSelector,
null,
null,
null,
null,
null,
null
)
client.listNamespacedPod(namespace.value).labelSelector(labelSelector).execute()
)
res = pods.getItems.asScala.flatMap { pod =>
pod.getMetadata.getLabels.asScala.get("leoServiceName").toList.flatMap { service =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,13 @@
ctx <- ev.ask
call =
F.blocking(
client.listNamespacedPod(namespace.name.value,
"true",
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
)
client.listNamespacedPod(namespace.name.value).pretty("true").execute()

Check warning on line 83 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala#L83

Added line #L83 was not covered by tests
)

response <- withLogging(
call,
Some(ctx.traceId),
s"io.kubernetes.client.apis.CoreV1Api.listNamespacedPod(${namespace.name.value}, true, null, null, null, null, null, null, null, null)"
s"io.kubernetes.client.apis.CoreV1Api.listNamespacedPod(${namespace.name.value})"
)

listPodStatus: List[PodStatus] = response.getItems.asScala.toList.flatMap(v1Pod =>
Expand All @@ -115,12 +103,10 @@
ctx <- ev.ask
call = F
.blocking(
client.createNamespace(new V1Namespace().metadata(new V1ObjectMeta().name(namespace.name.value)),
"true",
null,
null,
null
)
client
.createNamespace(new V1Namespace().metadata(new V1ObjectMeta().name(namespace.name.value)))
.pretty("true")
.execute()

Check warning on line 109 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala#L109

Added line #L109 was not covered by tests
)
.void
_ <- withLogging(
Expand All @@ -138,15 +124,7 @@
call =
recoverF(
F.blocking(
client.deleteNamespace(
namespace.name.value,
"true",
null,
null,
null,
null,
null
)
client.deleteNamespace(namespace.name.value).pretty("true").execute()

Check warning on line 127 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala#L127

Added line #L127 was not covered by tests
).void
.recoverWith {
case e: com.google.gson.JsonSyntaxException
Expand Down Expand Up @@ -179,9 +157,7 @@
ctx <- ev.ask
call =
recoverF(
F.blocking(
client.listNamespace("true", false, null, null, null, null, null, null, null, null, false)
),
F.blocking(client.listNamespace().pretty("true").allowWatchBookmarks(false).watch(false).execute()),

Check warning on line 160 in http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala

View check run for this annotation

Codecov / codecov/patch

http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/KubernetesInterpreter.scala#L160

Added line #L160 was not covered by tests
whenStatusCode(409)
)
v1NamespaceList <- withLogging(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import org.broadinstitute.dsde.workbench.leonardo.{
import org.broadinstitute.dsde.workbench.model.{IP, TraceId}
import org.broadinstitute.dsde.workbench.model.google.GoogleProject
import org.mockito.ArgumentMatchers.{any, anyString}
import org.mockito.Mockito.when
import org.mockito.Mockito.{mock, when}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatestplus.mockito.MockitoSugar

Expand Down Expand Up @@ -750,6 +750,8 @@ class LeoMetricsMonitorSpec extends AnyFlatSpec with LeonardoTestSuite with Test
val spec = mock[V1PodSpec]
val container = mock[V1Container]
val kube = mock[KubernetesAlgebra[IO]]

val mockRequest = mock[client.APIlistNamespacedPodRequest]
when {
container.getResources
} thenReturn new V1ResourceRequirements()
Expand All @@ -772,8 +774,14 @@ class LeoMetricsMonitorSpec extends AnyFlatSpec with LeonardoTestSuite with Test
podList.getItems
} thenReturn List(pod).asJava
when {
client.listNamespacedPod(any, any, any, any, any, any, any, any, any, any, any, any)
mockRequest.execute()
} thenReturn podList
when {
mockRequest.labelSelector(any[String])
} thenReturn mockRequest
when {
client.listNamespacedPod(any[String])
} thenReturn mockRequest
when {
kube.createAzureClient(any, any[String].asInstanceOf[AKSClusterName])(any)
} thenReturn IO.pure(client)
Expand Down
15 changes: 10 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ object Dependencies {
val munitCatsEffectV = "1.0.7"
val pact4sV = "0.10.0"

private val workbenchLibsHash = "9138393"
private val workbenchLibsHash = "3cea4eb"
val serviceTestV = s"5.0-$workbenchLibsHash"
val workbenchModelV = s"0.20-$workbenchLibsHash"
val workbenchGoogleV = s"0.32-$workbenchLibsHash"
val workbenchGoogle2V = s"0.36-$workbenchLibsHash"
val workbenchOpenTelemetryV = s"0.8-$workbenchLibsHash"
val workbenchOauth2V = s"0.7-$workbenchLibsHash"
val workbenchAzureV = s"0.7-$workbenchLibsHash"
val workbenchAzureV = s"0.8-$workbenchLibsHash"

val helmScalaSdkV = "0.0.8.5"

Expand Down Expand Up @@ -108,7 +108,9 @@ object Dependencies {
val workbenchAzureTest: ModuleID = "org.broadinstitute.dsde.workbench" %% "workbench-azure" % workbenchAzureV % "test" classifier "tests"
val workbenchOpenTelemetry: ModuleID = "org.broadinstitute.dsde.workbench" %% "workbench-opentelemetry" % workbenchOpenTelemetryV excludeAll (
excludeIoGrpc,
excludeGuava)
excludeGuava
)

val workbenchOpenTelemetryTest: ModuleID = "org.broadinstitute.dsde.workbench" %% "workbench-opentelemetry" % workbenchOpenTelemetryV % Test classifier "tests" excludeAll (excludeGuava)

val helmScalaSdk: ModuleID = "org.broadinstitute.dsp" %% "helm-scala-sdk" % helmScalaSdkV
Expand All @@ -134,7 +136,7 @@ object Dependencies {
val okHttp = "com.squareup.okhttp3" % "okhttp" % "4.12.0"

val workSpaceManagerV = "0.254.1127-SNAPSHOT"
val terraCommonLibV = "0.0.94-SNAPSHOT"
val terraCommonLibV = "1.1.17-SNAPSHOT"
val bpmV = "0.1.548-SNAPSHOT"

def excludeJakartaActivationApi = ExclusionRule("jakarta.activation", "jakarta.activation-api")
Expand All @@ -149,9 +151,12 @@ object Dependencies {
def excludeBroadWorkbench = ExclusionRule("org.broadinstitute.dsde.workbench")
def excludePostgresql = ExclusionRule("org.postgresql", "postgresql")
def excludeSnakeyaml = ExclusionRule("org.yaml", "snakeyaml")
def excludeLiquibase = ExclusionRule("org.liquibase", "liquibase-core")


// [IA-4939] commons-text:1.9 is unsafe
def excludeCommonsText = ExclusionRule("org.apache.commons", "commons-text")
def tclExclusions(m: ModuleID): ModuleID = m.excludeAll(excludeSpringBoot, excludeSpringAop, excludeSpringData, excludeSpringFramework, excludeOpenCensus, excludeGoogleFindBugs, excludeBroadWorkbench, excludePostgresql, excludeSnakeyaml, excludeSlf4j, excludeCommonsText)
def tclExclusions(m: ModuleID): ModuleID = m.excludeAll(excludeSpringBoot, excludeSpringAop, excludeSpringData, excludeSpringFramework, excludeOpenCensus, excludeGoogleFindBugs, excludeBroadWorkbench, excludePostgresql, excludeSnakeyaml, excludeSlf4j, excludeCommonsText, excludeLiquibase)
val workspaceManager = excludeJakarta("bio.terra" % "workspace-manager-client" % workSpaceManagerV)
val bpm = excludeJakarta("bio.terra" % "billing-profile-manager-client" % bpmV)
val terraCommonLib = tclExclusions(excludeJakarta("bio.terra" % "terra-common-lib" % terraCommonLibV classifier "plain"))
Expand Down
1 change: 1 addition & 0 deletions project/Merging.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import sbtassembly.{MergeStrategy, PathList}

object Merging {
def customMergeStrategy(oldStrategy: (String) => MergeStrategy): (String => MergeStrategy) = {
case PathList("META-INF", "spring-configuration-metadata.json") => MergeStrategy.first
// For the following error:
// [error] Deduplicate found different file contents in the following:
// [error] Jar name = auto-value-1.10.1.jar, jar org = com.google.auto.value, entry target = META-INF/kotlin-stdlib.kotlin_module
Expand Down
Loading