-
Notifications
You must be signed in to change notification settings - Fork 375
WX-1595 GCP Batch backend refactor to include the PAPI request manager #7412
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
Merged
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
ff8543c
Refactor GCP Batch request manager
AlexITC 5cca13a
Rename PAPI stuff from BatchApiRequestManager
AlexITC 0823351
Fix scalafmt
AlexITC 0f5ab24
Temporary disable CI
AlexITC 94d1aaf
Add missing test to GcpBatchAsyncBackendJobExecutionActorSpec
AlexITC af6b42d
Missing rename from PAPI to Batch in BatchApiRunCreationClient
AlexITC fdb5c24
draft
AlexITC ff23056
draft
AlexITC ecc28d1
Yet another draft
AlexITC 2afef28
Code compiles! tests are pending to be fixed
AlexITC a249835
Implement abort operation
AlexITC 7ef43da
Get has been implemented
AlexITC 71daebe
Tests are compiling
AlexITC 1e8bcef
Complete the PAPIv2 migration to batch
AlexITC ad51153
Fix GcpBatchGroupedRequests
AlexITC 476a923
Enable tests
AlexITC f92974b
Clean up unnecessary code + batch abort request bugfix
AlexITC 0bf7a90
Handle JobAbortedException
AlexITC 94ce5cd
Handle GCP errors
AlexITC 76bb726
Refactor to run batch requests in parallel through futures
AlexITC dbd6d24
Refactor GcpBatchGroupedRequests to be immutable
AlexITC e619ef0
Enable commented tests
AlexITC 057ee14
Huge refactor on batch RunStatus
AlexITC 6fe1518
Tag the PipelinesApiAsyncBackendJobExecutionActorSpec tests that are …
AlexITC 0412a9d
Clean up + enable missing telemetry entries for batch
AlexITC d71751d
Add more tests
AlexITC 3ccc34d
Add more tests that seem to reproduce a bug
AlexITC 810a061
Minor fixes
AlexITC 9acc240
Add TODO
AlexITC 7a4db8c
Add note about google sdk on AbortRequestHandler
AlexITC 2db7ce0
Add tests to LoadConfigSpec
AlexITC 62129c9
Refactor the abort workflow
AlexITC 26603c8
Refactor GcpBatchGroupedRequests to be a data holder only
AlexITC 29f3c4f
Add missing files
AlexITC 778c83a
Implement event list mapping
AlexITC 7becc27
Clean up RunStatus from unnecessary data
AlexITC 38eb051
Remove TODOs
AlexITC 64510cf
Fix minor bug in BatchRequestExecutor
AlexITC be118f5
Clean up BatchApiRequestWorker
AlexITC b4a1b30
Further clean up
AlexITC e8a61f1
Migrate missing details from papi to batch
AlexITC d9c362a
Run centaurGcpBatch tests only
AlexITC 11a02bb
Try setting requestsAbortAndDiesImmediately=true
AlexITC 1e2661b
Draft
AlexITC 290f065
Add debug option
AlexITC 50517e4
Enable tests again
AlexITC a333f65
Remove unnecessary comments from GcpBatchAsyncBackendJobExecutionActo…
AlexITC bfd9dd1
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 54c152d
Fix scalafmt
AlexITC 59c9675
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 83891cf
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 0cf2ba0
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 526447d
Clean up
AlexITC 8d7c618
Fix scalafmt + add a new test
AlexITC fa18a3c
Add tests to BatchApiRequestWorker
AlexITC f872fee
Further clean up
AlexITC 0e30684
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC c08b09b
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 23650c0
Further cleanup
AlexITC 35dce53
More cleanup
AlexITC cee36d9
Minor tweaks
AlexITC 6119047
Set requestsAbortAndDiesImmediately=false
AlexITC f4511b9
Revert temporal flag change
AlexITC b30be69
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 8f16dbc
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 28a62ef
Fix merge errors
AlexITC 0e4ddcb
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC f1a83ff
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC dca1420
Set requestsAbortAndDiesImmediately=false
AlexITC eca754f
Improve abort job handler
AlexITC 0095a87
Remove customPollStatusFailure
AlexITC 837f86e
Fix compile errors
AlexITC dcd0efe
Fix abort from BatchApiRequestManager
AlexITC 3c9d020
Try fixing preemption errors from GCP
AlexITC e261cb9
Rollback the preemption fixes
AlexITC 1050850
Final cleanup
AlexITC 75acee0
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC 387e399
Yet another cleanup
AlexITC 5f01bc9
Run scalafmt
AlexITC 37e5fde
Merge branch 'develop' into gcp-batch-request-manager-refactor-v2
AlexITC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
...le/batch/src/main/scala/cromwell/backend/google/batch/actors/BatchApiFetchJobClient.scala
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...tch/src/main/scala/cromwell/backend/google/batch/actors/BatchApiStatusRequestClient.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| package cromwell.backend.google.batch.actors | ||
|
|
||
| import akka.actor.{Actor, ActorLogging, ActorRef} | ||
| import com.google.cloud.batch.v1.JobName | ||
| import cromwell.backend.google.batch.api.BatchApiRequestManager.{BatchApiStatusQueryFailed, BatchStatusPollRequest} | ||
| import cromwell.backend.google.batch.api.GcpBatchRequestFactory | ||
| import cromwell.backend.google.batch.models.RunStatus | ||
| import cromwell.backend.google.batch.monitoring.BatchInstrumentation | ||
| import cromwell.backend.standard.StandardAsyncJob | ||
| import cromwell.core.WorkflowId | ||
|
|
||
| import scala.concurrent.{Future, Promise} | ||
| import scala.util.{Failure, Success, Try} | ||
|
|
||
| /** | ||
| * Allows fetching a job status | ||
| */ | ||
| trait BatchApiStatusRequestClient { this: Actor with ActorLogging with BatchInstrumentation => | ||
|
|
||
| private var pollingActorClientPromise: Option[Promise[RunStatus]] = None | ||
|
|
||
| def pollingActorClientReceive: Actor.Receive = { | ||
| case status: RunStatus => | ||
| log.debug(s"Polled status received: $status") | ||
| pollSuccess() | ||
| completePromise(Success(status)) | ||
| case BatchApiStatusQueryFailed(query, e) => | ||
| log.error(e, s"Poll status failed for job ${query.jobId}: ${e.getMessage}") | ||
| completePromise(Failure(e)) | ||
| } | ||
|
|
||
| private def completePromise(result: Try[RunStatus]): Unit = { | ||
| pollingActorClientPromise foreach { _.complete(result) } | ||
| pollingActorClientPromise = None | ||
| } | ||
|
|
||
| def pollStatus( | ||
| workflowId: WorkflowId, | ||
| jobName: JobName, | ||
| backendSingletonActor: ActorRef, | ||
| requestFactory: GcpBatchRequestFactory | ||
| ): Future[RunStatus] = | ||
| pollingActorClientPromise match { | ||
| case Some(p) => p.future | ||
| case None => | ||
| backendSingletonActor ! BatchStatusPollRequest( | ||
| workflowId, | ||
| self, | ||
| requestFactory.queryRequest(jobName), | ||
| StandardAsyncJob(jobName.toString) | ||
| ) | ||
|
|
||
| val newPromise = Promise[RunStatus]() | ||
| pollingActorClientPromise = Option(newPromise) | ||
| newPromise.future | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I have no problem merging as-is with these logs in place, seeing as we'll probably have some more rounds of debugging. That said, we'll probably want to reduce the
infoones eventually.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.
For the time being, I have marked the noisy logs as debug and kept the rest as info, it will be help to debug some of the currently open issues.