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

add constraint spec #40

Merged
merged 1 commit into from
Jun 13, 2024
Merged

add constraint spec #40

merged 1 commit into from
Jun 13, 2024

Conversation

jagedn
Copy link
Collaborator

@jagedn jagedn commented Jun 12, 2024

add constraint spec

also recovered some commented tests we have pending

p.d.
I just realized affinities and constraints can be an array. Current implementation consider only one instance per spec so maybe we'll need to do a refactor in a future

Signed-off-by: Jorge Aguilera <[email protected]>
@jagedn jagedn requested a review from abhi18av June 12, 2024 16:35
@abhi18av abhi18av mentioned this pull request Jun 13, 2024
16 tasks
@abhi18av abhi18av linked an issue Jun 13, 2024 that may be closed by this pull request
16 tasks
Copy link
Member

@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.

As an initial implementation this looks good Jorge, I have added a comment regarding a custom DSL for affinities,constraints in future.

Eager to hear your thoughts?

Comment on lines +187 to +192
def config = new NomadConfig([
jobs: [constraint : {
attribute '${meta.my_custom_value}'
operator ">"
value "3"
}]
Copy link
Member

Choose a reason for hiding this comment

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

For now, a direct mapping is great since it works with mental model of Nomad users as per the job definitions https://developer.hashicorp.com/nomad/docs/job-specification/constraint

Though for future, maybe this is something that maybe we can parse in a more user-friendly manner using a small DSL, which can have the added benefit that we can add more Nextflow level checks for the constraints being assigned correctly. What do you tihnk @jagedn , something worth tracking ?

Otherwise, in failing cases, Nomad layer would give an error code/message to the NF layer and we'd have to parse that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

totally agree

as reminder, we need also to work in the process configuration as current constraint and affinity is for all tasks

@jagedn jagedn merged commit 419b14a into master Jun 13, 2024
2 checks passed
@jagedn jagedn deleted the constrains branch June 13, 2024 07:46
@jagedn jagedn restored the constrains branch July 2, 2024 14:32
@jagedn jagedn deleted the constrains branch July 2, 2024 14:33
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