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

[AN-146] Emit VM cost for GCP Batch #7582

Merged
merged 14 commits into from
Dec 9, 2024
Merged

Conversation

lucymcnatt
Copy link
Contributor

@lucymcnatt lucymcnatt commented Nov 19, 2024

Description

AN-146

Adds BatchPollResultMonitorActor.extractVmInfoFromRunState so that the /cost endpoint functions correctly for workflows run on GCP Batch

Release Notes Confirmation

CHANGELOG.md

  • I updated CHANGELOG.md in this PR
  • I assert that this change shouldn't be included in CHANGELOG.md because it doesn't impact community users

Terra Release Notes

  • I added a suggested release notes entry in this Jira ticket
  • I assert that this change doesn't need Jira release notes because it doesn't impact Terra users

@lucymcnatt lucymcnatt changed the title [AN-146] Calculate VM cost for GCP Batch [AN-146] Emit VM cost for GCP Batch Nov 20, 2024
@lucymcnatt lucymcnatt marked this pull request as ready for review November 21, 2024 15:23
@lucymcnatt lucymcnatt requested a review from a team as a code owner November 21, 2024 15:23
@lucymcnatt lucymcnatt marked this pull request as draft November 21, 2024 19:53
@lucymcnatt
Copy link
Contributor Author

putting it back in draft while I supply the vmInfo

@lucymcnatt lucymcnatt marked this pull request as ready for review December 3, 2024 19:34
Copy link
Collaborator

@jgainerdewar jgainerdewar left a comment

Choose a reason for hiding this comment

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

This is awesome, nice job diving into a new area and not making a mess 😄

The unit tests look great, was this also manually tested end-to-end? That is, can we run a Batch workflow and get a correct-looking response from the /cost API endpoint?


val allocationPolicy = AllocationPolicy
.newBuilder()
.setLocation(LocationPolicy.newBuilder().addAllowedLocations("regions/us-central1"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be useful to have some tests checking how we handle unexpected location values - I'm nervous any time we're depending on Google not to change the way they generate a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeahhh makes sense, I can add another

@@ -627,7 +628,8 @@ object Dependencies {
"org.scalatest" %% "scalatest" % scalatestV,
// Use mockito Java DSL directly instead of the numerous and often hard to keep updated Scala DSLs.
// See also scaladoc in common.mock.MockSugar and that trait's various usages.
"org.mockito" % "mockito-core" % mockitoV
"org.mockito" % "mockito-core" % mockitoV,
"org.mockito" % "mockito-inline" % mockitoInlineV
Copy link
Contributor Author

Choose a reason for hiding this comment

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

necessary in order to mock a final method in the gcp BatchServiceClient

@jgainerdewar
Copy link
Collaborator

Approved pending test fixes and (probably?) removal of that log message.

@lucymcnatt lucymcnatt force-pushed the AN-146-batch-vm-cost branch 2 times, most recently from e3c77f6 to b4e437b Compare December 9, 2024 15:54
undo accidental delete

fix

another fix

formatting

remove extra log
@lucymcnatt lucymcnatt force-pushed the AN-146-batch-vm-cost branch from 757ffae to 3134ed3 Compare December 9, 2024 15:59
@lucymcnatt lucymcnatt enabled auto-merge (squash) December 9, 2024 16:00
@lucymcnatt lucymcnatt merged commit 33cb56b into develop Dec 9, 2024
35 of 37 checks passed
@lucymcnatt lucymcnatt deleted the AN-146-batch-vm-cost branch December 9, 2024 17:07
lucymcnatt added a commit that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants