Skip to content

Commit 366115d

Browse files
committed
fix: Create a new standardMachineType runtime attribute instead of reusing cpuPlatform
1 parent 8b20d18 commit 366115d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchRuntimeAttributes.scala

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ final case class GcpBatchRuntimeAttributes(cpu: Int Refined Positive,
4949
continueOnReturnCode: ContinueOnReturnCode,
5050
noAddress: Boolean,
5151
useDockerImageCache: Option[Boolean],
52-
checkpointFilename: Option[String]
52+
checkpointFilename: Option[String],
53+
standardMachineType: Option[String]
5354
)
5455

5556
object GcpBatchRuntimeAttributes {
@@ -85,6 +86,8 @@ object GcpBatchRuntimeAttributes {
8586
UseDockerImageCacheKey
8687
).optional
8788

89+
val StandardMachineTypeKey = "StandardMachineType"
90+
8891
val CheckpointFileKey = "checkpointFile"
8992
private val checkpointFileValidationInstance = new StringRuntimeAttributesValidation(CheckpointFileKey).optional
9093

@@ -98,6 +101,8 @@ object GcpBatchRuntimeAttributes {
98101
)
99102
private def cpuPlatformValidation(runtimeConfig: Option[Config]): OptionalRuntimeAttributesValidation[String] =
100103
cpuPlatformValidationInstance
104+
private def standardMachineTypeValidation(runtimeConfig: Option[Config]): OptionalRuntimeAttributesValidation[String] =
105+
new StringRuntimeAttributesValidation(StandardMachineTypeKey).optional
101106
private def gpuTypeValidation(runtimeConfig: Option[Config]): OptionalRuntimeAttributesValidation[GpuType] =
102107
GpuTypeValidation.optional
103108

@@ -171,7 +176,8 @@ object GcpBatchRuntimeAttributes {
171176
bootDiskSizeValidation(runtimeConfig),
172177
useDockerImageCacheValidation(runtimeConfig),
173178
checkpointFileValidationInstance,
174-
dockerValidation
179+
dockerValidation,
180+
standardMachineTypeValidation(runtimeConfig)
175181
)
176182
}
177183

@@ -228,6 +234,10 @@ object GcpBatchRuntimeAttributes {
228234
useDockerImageCacheValidation(runtimeAttrsConfig).key,
229235
validatedRuntimeAttributes
230236
)
237+
val standardMachineType: Option[String] = RuntimeAttributesValidation.extractOption(
238+
standardMachineTypeValidation(runtimeAttrsConfig).key,
239+
validatedRuntimeAttributes
240+
)
231241

232242
new GcpBatchRuntimeAttributes(
233243
cpu = cpu,
@@ -243,7 +253,8 @@ object GcpBatchRuntimeAttributes {
243253
continueOnReturnCode = continueOnReturnCode,
244254
noAddress = noAddress,
245255
useDockerImageCache = useDockerImageCache,
246-
checkpointFilename = checkpointFileName
256+
checkpointFilename = checkpointFileName,
257+
standardMachineType = standardMachineType
247258
)
248259
}
249260

0 commit comments

Comments
 (0)