-
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
A mini-DSL for specifying constraints and affinities #55
Comments
we can try to define here a first approach to the DSL (?) |
Mmm, actually the first point that comes to my mind is regarding the use of Therefore if we want to make use of a mini-DSL for Nomad config then we should rely upon a different symbol? |
so maybe something similar as:
|
Works, but doesn't feel like "Nextflow" Ideally, we can just use the maps to work with a whitelisted set of keys like node-attributes Something like job {
constraints {
//NOTE: STATIC list of whitelisted attributes for nodes
node {
unique = [ id: "node-id", name: "node-name"]
class = "linux-64bit"
pool = "custom-pool"
}
//NOTE: These are common (STATIC list of) node properties
attr {
cpu = [arch: "amd64", numcores: 5 ...]
consul = [],
os = [name: , version: , build: ]
platform = [],
kernel = [],
unique = [],
driver = [ docker: [], ... ]
}
//NOTE: These properties can be setup DYNAMICALLY on the node
meta {
group = "tb-research"
customAttr = "<4"
...
}
}
// NOTE: I"m NOT sure how to use these exactly, need to do more reading for their usage. Maybe, they don't need to be exposed at all.
vars {
nomad : [ port: ...],
consul: [clientKey: ...],
vault: [token: ...]
}
}
We can leave the parsing of At the moment, attributes like What are your thoughts @jagedn? |
Understood, I will implement one of them and we'll see how it looks |
this is a first iteration to implement Node constraints into our DSL (I would like to do a little refactor but can be used to validate the idea) in this file you can see how we can now specify a "global" constraint and/or process constraint (using directives) master...constraints#diff-a10ebc84928f2879f5dc4b264dcafe0d3953ed526ad7716ed3a8f265f48895deR15 |
Marking this as closed since we already have a prototype for the DSL, we'll update as and when needed to suit the needs of the project :) |
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.
Originally posted by @abhi18av in #40 (comment)
The text was updated successfully, but these errors were encountered: