-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add affinity spec configuration (#37)
Signed-off-by: Jorge Aguilera <[email protected]>
- Loading branch information
Showing
5 changed files
with
149 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
plugins/nf-nomad/src/main/nextflow/nomad/config/AffinitySpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package nextflow.nomad.config | ||
|
||
class AffinitySpec{ | ||
|
||
private String attribute | ||
private String operator | ||
private String value | ||
private Integer weight | ||
|
||
String getOperator(){ | ||
return operator | ||
} | ||
|
||
String getAttribute() { | ||
return attribute | ||
} | ||
|
||
String getValue() { | ||
return value | ||
} | ||
|
||
Integer getWeight() { | ||
return weight | ||
} | ||
|
||
AffinitySpec attribute(String attribute){ | ||
this.attribute=attribute | ||
this | ||
} | ||
|
||
AffinitySpec operator(String operator){ | ||
this.operator = operator | ||
this | ||
} | ||
|
||
AffinitySpec value(String value){ | ||
this.value = value | ||
this | ||
} | ||
|
||
AffinitySpec weight(int weight){ | ||
this.weight = weight | ||
this | ||
} | ||
|
||
void validate(){ | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
plugins/nf-nomad/src/main/nextflow/nomad/config/VolumeSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package nextflow.nomad.config | ||
|
||
import nextflow.nomad.NomadConfig | ||
|
||
class VolumeSpec { | ||
|
||
final static public String VOLUME_DOCKER_TYPE = "docker" | ||
final static public String VOLUME_CSI_TYPE = "csi" | ||
final static public String VOLUME_HOST_TYPE = "host" | ||
|
||
final static protected String[] VOLUME_TYPES = [ | ||
VOLUME_CSI_TYPE, VOLUME_DOCKER_TYPE, VOLUME_HOST_TYPE | ||
] | ||
|
||
private String type | ||
private String name | ||
|
||
String getType() { | ||
return type | ||
} | ||
|
||
String getName() { | ||
return name | ||
} | ||
|
||
VolumeSpec type(String type){ | ||
this.type = type | ||
this | ||
} | ||
|
||
VolumeSpec name(String name){ | ||
this.name = name | ||
this | ||
} | ||
|
||
void validate(){ | ||
if( !VOLUME_TYPES.contains(type) ) { | ||
throw new IllegalArgumentException("Volume type $type is not supported") | ||
} | ||
if( !this.name ){ | ||
throw new IllegalArgumentException("Volume name is required") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters