-
Notifications
You must be signed in to change notification settings - Fork 785
Expand file tree
/
Copy pathExecutorOpts.groovy
More file actions
174 lines (145 loc) · 5.14 KB
/
ExecutorOpts.groovy
File metadata and controls
174 lines (145 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
* Copyright 2013-2026, Seqera Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seqera.config
import groovy.transform.CompileStatic
import nextflow.config.spec.ConfigOption
import nextflow.config.spec.ConfigScope
import nextflow.script.dsl.Description
import nextflow.util.Duration
/**
* Configuration for the Seqera executor.
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
*/
@Description("""
The `seqera.executor` scope provides configuration for the Seqera compute executor.
""")
@CompileStatic
class ExecutorOpts implements ConfigScope {
final RetryOpts retryPolicy
@ConfigOption
@Description("""
The Seqera scheduler service endpoint URL.
""")
final String endpoint
@ConfigOption
@Description("""
The compute backend provider type (e.g. `aws`, `local`).
When specified, used together with region to select the matching compute environment.
""")
final String provider
@ConfigOption
@Description("""
The AWS region for task execution (default: `eu-central-1`).
""")
final String region
@ConfigOption
@Description("""
The EC2 key pair name for SSH access to instances.
""")
final String keyPairName
@ConfigOption
@Description("""
The interval for batching task submissions (default: `1 sec`).
""")
final Duration batchFlushInterval
@Description("""
Machine/infrastructure requirements for session tasks.
""")
final MachineRequirementOpts machineRequirement
@ConfigOption
@Description("""
When `true`, automatically adds workflow metadata labels (e.g. project name,
run name, session ID) with the `nextflow.io/` prefix to the session (default: `false`).
""")
final boolean autoLabels
@ConfigOption
@Description("""
The resource prediction model to use for estimating task resource requirements
based on historical execution metrics. Supported values: `qr/v1`, `qr/v2` (quantile regression).
When not set, no resource estimation is applied.
""")
final String predictionModel
@ConfigOption
@Description("""
Custom environment variables to apply to all tasks submitted by the Seqera executor.
These are merged with the Fusion environment variables, with Fusion variables taking precedence.
""")
final Map<String, String> taskEnvironment
@ConfigOption
@Description("""
The Seqera Platform compute environment ID. When specified, the scheduler resolves
the compute environment directly by this ID instead of listing all workspace CEs.
Used as a fallback when the workflow launch does not include a CE reference.
""")
final String computeEnvId
/* required by config scope -- do not remove */
ExecutorOpts() {}
ExecutorOpts(Map opts) {
this.retryPolicy = new RetryOpts(opts.retryPolicy as Map ?: Map.of())
this.endpoint = opts.endpoint as String
if (!endpoint)
throw new IllegalArgumentException("Missing Seqera endpoint - make sure to specify 'seqera.executor.endpoint' settings")
this.provider = opts.provider as String
this.region = opts.region as String
this.keyPairName = opts.keyPairName as String
this.batchFlushInterval = opts.batchFlushInterval
? Duration.of(opts.batchFlushInterval as String)
: Duration.of('1 sec')
// machine requirement settings
this.machineRequirement = new MachineRequirementOpts(opts.machineRequirement as Map ?: Map.of())
this.autoLabels = opts.autoLabels as boolean ?: false
// prediction model
this.predictionModel = opts.predictionModel as String ?: null
// custom task environment variables
this.taskEnvironment = opts.taskEnvironment as Map<String, String>
// compute environment ID
this.computeEnvId = opts.computeEnvId as String
}
RetryOpts retryOpts() {
this.retryPolicy
}
String getEndpoint() {
return endpoint
}
String getProvider() {
return provider
}
String getRegion() {
return region
}
String getKeyPairName() {
return keyPairName
}
Duration getBatchFlushInterval() {
return batchFlushInterval
}
MachineRequirementOpts getMachineRequirement() {
return machineRequirement
}
boolean getAutoLabels() {
return autoLabels
}
String getPredictionModel() {
return predictionModel
}
Map<String, String> getTaskEnvironment() {
return taskEnvironment
}
String getComputeEnvId() {
return computeEnvId
}
}