-
Notifications
You must be signed in to change notification settings - Fork 21
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 4799 cloned workflows apps fail to upgrade #4155
Ia 4799 cloned workflows apps fail to upgrade #4155
Conversation
...ain/scala/org/broadinstitute/dsde/workbench/leonardo/db/AppControlledResourceComponent.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
…tabase, create it
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4155 +/- ##
===========================================
+ Coverage 71.70% 71.74% +0.03%
===========================================
Files 154 154
Lines 14255 14287 +32
Branches 1134 1150 +16
===========================================
+ Hits 10222 10250 +28
- Misses 4033 4037 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/azureModels.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, but the change looks correct to me 👍
Question -- how will we backfill the existing records? I was assuming this PR would have a liquibase migration?
…en app is updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, some more comments above about the approach. Happy to talk with faces too.
I'm wondering if this approach would work:
- In
createOrFetch[Identity|Database]
(which is called fromcreateApp
), make sure we populateAPP_CONTROLLED_RESOURCE
for the clone and non-clone cases. This should ensure correct records for new apps going forward. - To back-populate existing apps, add some logic in
updateAndPollApp
:If it's a shared app and wsmIdentityOpt == None, retrieve the managed identity in WSM and populate the APP_CONTROLLED_RESOURCE table. If it's an X app type and doesn't have X's required databases, retrieve the databases in WSM and populate the APP_CONTROLLED_RESOURCE table.
Then the next upgrade should "fix" the APP_CONTROLLED_RESOURCE
table. Note that we also rely on that table for app deletion (to know which WSM resources to delete). So I think we're also at risk of leaking cloud resources today when we delete apps. Luckily those resources do get deleted at workspace deletion time.
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/AKSInterpreter.scala
Outdated
Show resolved
Hide resolved
That was what I was attempting to do. My confusion was with the ManagedIdentity needed to process the createOrFetchWsmDatabaseResources() which I thought would be fine to use knowing that in the update flow the tables would already be created so it would just fetch them. As I mentioned above, I will go back to considering the migration instead of trying to update old records on the fly. It does seem like the cleaner approach. I might like to discuss the optimal way to do that. |
Sounds good - thank you! Happy to discuss. |
…ONTROLLED_RESOURCE for newly created apps
@@ -941,12 +1031,18 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig, | |||
.asScala | |||
.toList | |||
) | |||
|
|||
// TODO: this currently matches on the 'name' (actually type) of database so for example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Names are unique within a workspace, and there can only be 1 shared app of a given type per workspace, so this works. Agree about thinking about future options though.
Also would be good to move away from using WSM enumerateResources
in favor of a getByName
API or something. That has implications on auth domains I think (cc @aherbst-broad )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, seems like this approach works ✅
Jira ticket: https://broadworkbench.atlassian.net/browse/IA-4799
Summary of changes
What
Why
Testing these changes
What to test
Who tested and where
jenkins retest
orjenkins multi-test
.