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

Accommodate Nextflow CPU/Memory in Nomad Job taskResources #27

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

abhi18av
Copy link
Member

@abhi18av abhi18av commented Mar 9, 2024

I have drafted an initial support for cores and memory.

NOTE: As Nomad interprets cpus in MegaHertz different from the integer values in Nextflow, therefore, I have mapped Nextflow CPU -> Nomad Cores.

Tested this with the nf-core/fetchngs pipeline

Screenshot 2024-03-08 at 23 25 13

Resources

@abhi18av abhi18av self-assigned this Mar 9, 2024
Copy link
Member Author

@abhi18av abhi18av left a comment

Choose a reason for hiding this comment

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

Added comments for informing the reviewer.

Comment on lines 97 to 101
void "submit a task with docker volume"(){
given:
def config = new NomadConfig(
client:[
address : "http://${mockWebServer.hostName}:${mockWebServer.port}"
Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed this test as we decided not to continue with docker volume.

@abhi18av abhi18av requested a review from jagedn March 9, 2024 02:24
@abhi18av abhi18av marked this pull request as ready for review March 9, 2024 02:26
@abhi18av abhi18av linked an issue Mar 9, 2024 that may be closed by this pull request
16 tasks
@abhi18av abhi18av mentioned this pull request Mar 9, 2024
16 tasks
@abhi18av abhi18av changed the title Accommodate Nextflow process directives like CPU/Memory in Nomad Job taskResources Accommodate Nextflow CPU/Memory in Nomad Job taskResources Mar 9, 2024

JobRegisterRequest jobRegisterRequest = new JobRegisterRequest();
jobRegisterRequest.setJob(job);
JobRegisterResponse jobRegisterResponse = jobsApi.registerJob(jobRegisterRequest, config.jobOpts.region, config.jobOpts.namespace, null, null)
jobRegisterResponse.evalID
}

TaskGroup createTaskGroup(String id, String name, String image, List<String> args, String workingDir, Map<String, String>env){
def task = createTask(id, image, args, workingDir, env)
TaskGroup createTaskGroup(String id, String name, String image, List<String> args, String workingDir, Map<String, String>env, Resources resources){
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't like to expose specific nomad objects outside of the service

I mean, Resources is something strong related with the Service but not with the Task. Maybe we can use some TaskResource class as parameter and let the Service do the conversion to a nomad Resource object

it sounds a little more complicated/elaborated but in this way we have separate both concepts (nextflow vs nomad)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @jagedn , okay so I've tried to refactor the code keeping different layers separate. Let me know what you think about the current structure?

I do think that we can explore the idea regarding a specific "translation" class which covers all aspects of NomadJobDefinition from a NextflowTask, however I suggest that we still continue the current iterations and revisit this once the plugin has stabilised in its design - what do you think?

@abhi18av abhi18av merged commit 65b9226 into master Mar 12, 2024
@abhi18av abhi18av deleted the patch-nomad-client branch March 12, 2024 15:40
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.

Plugin design - dev meetings.
2 participants