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

Pivotal ID #186578721: Allow to execute test jobs in cluster API #781

Merged
merged 4 commits into from
Nov 30, 2023

Conversation

Juan-EBI
Copy link
Contributor

Copy link
Contributor

@jhoanmanuelms jhoanmanuelms left a comment

Choose a reason for hiding this comment

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

It's looking good, I only have one concern which is related to the private key in the repo

@@ -25,6 +25,8 @@ class ClusterOperations(
private val sessionFunction: () -> Session,
) {
suspend fun triggerJob(jobSpec: JobSpec): Try<Job> {
logger.info { "Triggering Job $jobSpec" }
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

}
}

suspend fun runJob(
Copy link
Contributor

Choose a reason for hiding this comment

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

After looking at this improvement, I think we should probably call these methods triggerJobAsync and triggerJobSync just to make it super clear the difference between them. Another option would be adding Javadoc. WDYT?

@@ -0,0 +1,39 @@
-----BEGIN RSA PRIVATE KEY-----
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's a good idea to persist private keys in the repo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is a dummy key required for itest to run

return clusterOperations.jobStatus(jobId)
}

data class JobSpecDto(val command: String, val queue: String, val megaBytes: Int) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the last parameter should be called memory, ramSize or even just ram like in the Job class because megaBytes is not very clear at communicating what the value is actually used for

}

@PostMapping("/submit")
suspend fun submitJob(@RequestBody job: JobSpecDto): Job {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these endpoints will be super useful

Copy link
Contributor

@jhoanmanuelms jhoanmanuelms left a comment

Choose a reason for hiding this comment

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

LGTM

@Juan-EBI Juan-EBI merged commit b69ecfa into master Nov 30, 2023
@Juan-EBI Juan-EBI deleted the feature/pivotal-186578721 branch November 30, 2023 14:58
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.

2 participants