Skip to content

Commit 2f03741

Browse files
committed
regen; drop CommandLineBindableImpl; add optional CWL extensions
1 parent 0d50091 commit 2f03741

24 files changed

+2153
-56
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.commonwl.cwlsdk.cwl1_2;
16+
17+
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions;
18+
import org.commonwl.cwlsdk.cwl1_2.utils.Saveable;
19+
20+
/**
21+
* Auto-generated interface for <I>http://commonwl.org/cwltool#CUDARequirement</I><BR>This interface is implemented by {@link CUDARequirementImpl}<BR> <BLOCKQUOTE>
22+
Require support for NVIDA CUDA (GPU hardware acceleration).
23+
</BLOCKQUOTE>
24+
*/
25+
public interface CUDARequirement extends ProcessRequirement, Saveable {
26+
27+
java.util.Map<String, Object> getExtensionFields();
28+
LoadingOptions getLoadingOptions();
29+
30+
/**
31+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/class</I><BR>
32+
* <BLOCKQUOTE>
33+
* cwltool:CUDARequirement * </BLOCKQUOTE>
34+
*/
35+
36+
String getClass_();
37+
/**
38+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaComputeCapability</I><BR>
39+
* <BLOCKQUOTE>
40+
* CUDA hardware capability required to run the software, in X.Y
41+
* format.
42+
*
43+
* * If this is a single value, it defines only the minimum
44+
* compute capability. GPUs with higher capability are also
45+
* accepted.
46+
*
47+
* * If it is an array value, then only select GPUs with compute
48+
* capabilities that explicitly appear in the array.
49+
* * </BLOCKQUOTE>
50+
*/
51+
52+
Object getCudaComputeCapability();
53+
/**
54+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaDeviceCountMax</I><BR>
55+
* <BLOCKQUOTE>
56+
* Maximum number of GPU devices to request. If not specified,
57+
* same as `cudaDeviceCountMin`.
58+
* * </BLOCKQUOTE>
59+
*/
60+
61+
Object getCudaDeviceCountMax();
62+
/**
63+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaDeviceCountMin</I><BR>
64+
* <BLOCKQUOTE>
65+
* Minimum number of GPU devices to request. If not specified,
66+
* same as `cudaDeviceCountMax`. If neither are specified,
67+
* default 1.
68+
* * </BLOCKQUOTE>
69+
*/
70+
71+
Object getCudaDeviceCountMin();
72+
/**
73+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaVersionMin</I><BR>
74+
* <BLOCKQUOTE>
75+
* Minimum CUDA version to run the software, in X.Y format. This
76+
* corresponds to a CUDA SDK release. When running directly on
77+
* the host (not in a container) the host must have a compatible
78+
* CUDA SDK (matching the exact version, or, starting with CUDA
79+
* 11.3, matching major version). When run in a container, the
80+
* container image should provide the CUDA runtime, and the host
81+
* driver is injected into the container. In this case, because
82+
* CUDA drivers are backwards compatible, it is possible to
83+
* use an older SDK with a newer driver across major versions.
84+
*
85+
* See https://docs.nvidia.com/deploy/cuda-compatibility/ for
86+
* details.
87+
* * </BLOCKQUOTE>
88+
*/
89+
90+
String getCudaVersionMin();
91+
}
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.commonwl.cwlsdk.cwl1_2;
16+
17+
import org.commonwl.cwlsdk.cwl1_2.utils.LoaderInstances;
18+
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions;
19+
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptionsBuilder;
20+
import org.commonwl.cwlsdk.cwl1_2.utils.SaveableImpl;
21+
import org.commonwl.cwlsdk.cwl1_2.utils.ValidationException;
22+
23+
/**
24+
* Auto-generated class implementation for <I>http://commonwl.org/cwltool#CUDARequirement</I><BR> <BLOCKQUOTE>
25+
Require support for NVIDA CUDA (GPU hardware acceleration).
26+
</BLOCKQUOTE>
27+
*/
28+
public class CUDARequirementImpl extends SaveableImpl implements CUDARequirement {
29+
private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
30+
private java.util.Map<String, Object> extensionFields_ =
31+
new java.util.HashMap<String, Object>();
32+
public LoadingOptions getLoadingOptions() {
33+
return this.loadingOptions_;
34+
}
35+
public java.util.Map<String, Object> getExtensionFields() {
36+
return this.extensionFields_;
37+
}
38+
39+
private String class_;
40+
41+
/**
42+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/class</I><BR>
43+
* <BLOCKQUOTE>
44+
* cwltool:CUDARequirement * </BLOCKQUOTE>
45+
*/
46+
47+
public String getClass_() {
48+
return this.class_;
49+
}
50+
51+
private Object cudaComputeCapability;
52+
53+
/**
54+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaComputeCapability</I><BR>
55+
* <BLOCKQUOTE>
56+
* CUDA hardware capability required to run the software, in X.Y
57+
* format.
58+
*
59+
* * If this is a single value, it defines only the minimum
60+
* compute capability. GPUs with higher capability are also
61+
* accepted.
62+
*
63+
* * If it is an array value, then only select GPUs with compute
64+
* capabilities that explicitly appear in the array.
65+
* * </BLOCKQUOTE>
66+
*/
67+
68+
public Object getCudaComputeCapability() {
69+
return this.cudaComputeCapability;
70+
}
71+
72+
private Object cudaDeviceCountMax;
73+
74+
/**
75+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaDeviceCountMax</I><BR>
76+
* <BLOCKQUOTE>
77+
* Maximum number of GPU devices to request. If not specified,
78+
* same as `cudaDeviceCountMin`.
79+
* * </BLOCKQUOTE>
80+
*/
81+
82+
public Object getCudaDeviceCountMax() {
83+
return this.cudaDeviceCountMax;
84+
}
85+
86+
private Object cudaDeviceCountMin;
87+
88+
/**
89+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaDeviceCountMin</I><BR>
90+
* <BLOCKQUOTE>
91+
* Minimum number of GPU devices to request. If not specified,
92+
* same as `cudaDeviceCountMax`. If neither are specified,
93+
* default 1.
94+
* * </BLOCKQUOTE>
95+
*/
96+
97+
public Object getCudaDeviceCountMin() {
98+
return this.cudaDeviceCountMin;
99+
}
100+
101+
private String cudaVersionMin;
102+
103+
/**
104+
* Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaVersionMin</I><BR>
105+
* <BLOCKQUOTE>
106+
* Minimum CUDA version to run the software, in X.Y format. This
107+
* corresponds to a CUDA SDK release. When running directly on
108+
* the host (not in a container) the host must have a compatible
109+
* CUDA SDK (matching the exact version, or, starting with CUDA
110+
* 11.3, matching major version). When run in a container, the
111+
* container image should provide the CUDA runtime, and the host
112+
* driver is injected into the container. In this case, because
113+
* CUDA drivers are backwards compatible, it is possible to
114+
* use an older SDK with a newer driver across major versions.
115+
*
116+
* See https://docs.nvidia.com/deploy/cuda-compatibility/ for
117+
* details.
118+
* * </BLOCKQUOTE>
119+
*/
120+
121+
public String getCudaVersionMin() {
122+
return this.cudaVersionMin;
123+
}
124+
125+
/**
126+
* Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of CUDARequirementImpl.
127+
*
128+
* @param __doc_ Document fragment to load this record object from (presumably a
129+
{@link java.util.Map}).
130+
* @param __baseUri_ Base URI to generate child document IDs against.
131+
* @param __loadingOptions Context for loading URIs and populating objects.
132+
* @param __docRoot_ ID at this position in the document (if available) (maybe?)
133+
* @throws ValidationException If the document fragment is not a {@link java.util.Map}
134+
* or validation of fields fails.
135+
*/
136+
public CUDARequirementImpl(
137+
final Object __doc_,
138+
final String __baseUri_,
139+
LoadingOptions __loadingOptions,
140+
final String __docRoot_) {
141+
super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
142+
// Prefix plumbing variables with '__' to reduce likelihood of collision with
143+
// generated names.
144+
String __baseUri = __baseUri_;
145+
String __docRoot = __docRoot_;
146+
if (!(__doc_ instanceof java.util.Map)) {
147+
throw new ValidationException("CUDARequirementImpl called on non-map");
148+
}
149+
final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
150+
final java.util.List<ValidationException> __errors =
151+
new java.util.ArrayList<ValidationException>();
152+
if (__loadingOptions != null) {
153+
this.loadingOptions_ = __loadingOptions;
154+
}
155+
String class_;
156+
try {
157+
class_ =
158+
LoaderInstances
159+
.uri_StringInstance_False_True_None_None
160+
.loadField(__doc.get("class"), __baseUri, __loadingOptions);
161+
} catch (ValidationException e) {
162+
class_ = null; // won't be used but prevents compiler from complaining.
163+
final String __message = "the `class` field is not valid because:";
164+
__errors.add(new ValidationException(__message, e));
165+
}
166+
Object cudaComputeCapability;
167+
try {
168+
cudaComputeCapability =
169+
LoaderInstances
170+
.union_of_StringInstance_or_array_of_StringInstance
171+
.loadField(__doc.get("cudaComputeCapability"), __baseUri, __loadingOptions);
172+
} catch (ValidationException e) {
173+
cudaComputeCapability = null; // won't be used but prevents compiler from complaining.
174+
final String __message = "the `cudaComputeCapability` field is not valid because:";
175+
__errors.add(new ValidationException(__message, e));
176+
}
177+
Object cudaDeviceCountMax;
178+
179+
if (__doc.containsKey("cudaDeviceCountMax")) {
180+
try {
181+
cudaDeviceCountMax =
182+
LoaderInstances
183+
.union_of_NullInstance_or_IntegerInstance_or_ExpressionLoader
184+
.loadField(__doc.get("cudaDeviceCountMax"), __baseUri, __loadingOptions);
185+
} catch (ValidationException e) {
186+
cudaDeviceCountMax = null; // won't be used but prevents compiler from complaining.
187+
final String __message = "the `cudaDeviceCountMax` field is not valid because:";
188+
__errors.add(new ValidationException(__message, e));
189+
}
190+
191+
} else {
192+
cudaDeviceCountMax = null;
193+
}
194+
Object cudaDeviceCountMin;
195+
196+
if (__doc.containsKey("cudaDeviceCountMin")) {
197+
try {
198+
cudaDeviceCountMin =
199+
LoaderInstances
200+
.union_of_NullInstance_or_IntegerInstance_or_ExpressionLoader
201+
.loadField(__doc.get("cudaDeviceCountMin"), __baseUri, __loadingOptions);
202+
} catch (ValidationException e) {
203+
cudaDeviceCountMin = null; // won't be used but prevents compiler from complaining.
204+
final String __message = "the `cudaDeviceCountMin` field is not valid because:";
205+
__errors.add(new ValidationException(__message, e));
206+
}
207+
208+
} else {
209+
cudaDeviceCountMin = null;
210+
}
211+
String cudaVersionMin;
212+
try {
213+
cudaVersionMin =
214+
LoaderInstances
215+
.StringInstance
216+
.loadField(__doc.get("cudaVersionMin"), __baseUri, __loadingOptions);
217+
} catch (ValidationException e) {
218+
cudaVersionMin = null; // won't be used but prevents compiler from complaining.
219+
final String __message = "the `cudaVersionMin` field is not valid because:";
220+
__errors.add(new ValidationException(__message, e));
221+
}
222+
if (!__errors.isEmpty()) {
223+
throw new ValidationException("Trying 'RecordField'", __errors);
224+
}
225+
this.class_ = (String) class_;
226+
this.cudaComputeCapability = (Object) cudaComputeCapability;
227+
this.cudaDeviceCountMax = (Object) cudaDeviceCountMax;
228+
this.cudaDeviceCountMin = (Object) cudaDeviceCountMin;
229+
this.cudaVersionMin = (String) cudaVersionMin;
230+
for (String field:__doc.keySet()) {
231+
if (!attrs.contains(field)) {
232+
if (field.contains(":")) {
233+
String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
234+
extensionFields_.put(expanded_field, __doc.get(field));
235+
}
236+
}
237+
}
238+
}
239+
private java.util.List<String> attrs = java.util.Arrays.asList("class", "cudaComputeCapability", "cudaDeviceCountMax", "cudaDeviceCountMin", "cudaVersionMin");
240+
}

src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandLineBindable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.commonwl.cwlsdk.cwl1_2.utils.Saveable;
1919

2020
/**
21-
* Auto-generated interface for <I>https://w3id.org/cwl/cwl#CommandLineBindable</I><BR>This interface is implemented by {@link CommandLineBindableImpl}<BR>
21+
* Auto-generated interface for <I>https://w3id.org/cwl/cwl#CommandLineBindable</I><BR>
2222
*/
2323
public interface CommandLineBindable extends Saveable {
2424

src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandLineToolImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public CommandLineToolImpl(
480480
try {
481481
requirements =
482482
LoaderInstances
483-
.idmap_requirements_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement
483+
.idmap_requirements_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_Secrets_or_MPIRequirement_or_CUDARequirement_or_Loop_or_ShmSize
484484
.loadField(__doc.get("requirements"), __baseUri, __loadingOptions);
485485
} catch (ValidationException e) {
486486
requirements = null; // won't be used but prevents compiler from complaining.
@@ -497,7 +497,7 @@ public CommandLineToolImpl(
497497
try {
498498
hints =
499499
LoaderInstances
500-
.idmap_hints_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_AnyInstance
500+
.idmap_hints_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_Secrets_or_MPIRequirement_or_CUDARequirement_or_Loop_or_ShmSize_or_AnyInstance
501501
.loadField(__doc.get("hints"), __baseUri, __loadingOptions);
502502
} catch (ValidationException e) {
503503
hints = null; // won't be used but prevents compiler from complaining.

src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public ExpressionToolImpl(
353353
try {
354354
requirements =
355355
LoaderInstances
356-
.idmap_requirements_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement
356+
.idmap_requirements_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_Secrets_or_MPIRequirement_or_CUDARequirement_or_Loop_or_ShmSize
357357
.loadField(__doc.get("requirements"), __baseUri, __loadingOptions);
358358
} catch (ValidationException e) {
359359
requirements = null; // won't be used but prevents compiler from complaining.
@@ -370,7 +370,7 @@ public ExpressionToolImpl(
370370
try {
371371
hints =
372372
LoaderInstances
373-
.idmap_hints_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_AnyInstance
373+
.idmap_hints_optional_array_of_union_of_InlineJavascriptRequirement_or_SchemaDefRequirement_or_LoadListingRequirement_or_DockerRequirement_or_SoftwareRequirement_or_InitialWorkDirRequirement_or_EnvVarRequirement_or_ShellCommandRequirement_or_ResourceRequirement_or_WorkReuse_or_NetworkAccess_or_InplaceUpdateRequirement_or_ToolTimeLimit_or_SubworkflowFeatureRequirement_or_ScatterFeatureRequirement_or_MultipleInputFeatureRequirement_or_StepInputExpressionRequirement_or_Secrets_or_MPIRequirement_or_CUDARequirement_or_Loop_or_ShmSize_or_AnyInstance
374374
.loadField(__doc.get("hints"), __baseUri, __loadingOptions);
375375
} catch (ValidationException e) {
376376
hints = null; // won't be used but prevents compiler from complaining.

0 commit comments

Comments
 (0)