-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
Signed-off-by: Jorge Aguilera <[email protected]>
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.
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?
def config = new NomadConfig([ | ||
jobs: [constraint : { | ||
attribute '${meta.my_custom_value}' | ||
operator ">" | ||
value "3" | ||
}] |
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 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.
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.
totally agree
as reminder, we need also to work in the process
configuration as current constraint
and affinity
is for all tasks
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