Skip to content

Commit

Permalink
Fall back to large Docker image size if we can't find a real one
Browse files Browse the repository at this point in the history
  • Loading branch information
jgainerdewar committed Jan 3, 2025
1 parent 8a2d781 commit 8971bfe
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ case class LifeSciencesFactory(applicationName: String, authMode: GoogleAuthMode
*/
val adjustedBootDiskSize = {
val fromRuntimeAttributes = createPipelineParameters.runtimeAttributes.bootDiskSize
// Compute the decompressed size based on the information available
val userCommandImageSizeInBytes = createPipelineParameters.jobDescriptor.dockerSize
// Compute the decompressed size based on the information available. If we couldn't get the image size,
// default to 30GB. Defaulting to 0 can cause task to run out of disk. (more in AN-300)
val userCommandImageSizeInGB = createPipelineParameters.jobDescriptor.dockerSize
.map(_.toFullSize(DockerConfiguration.instance.sizeCompressionFactor))
.getOrElse(0L)
val userCommandImageSizeInGB =
MemorySize(userCommandImageSizeInBytes.toDouble, MemoryUnit.Bytes).to(MemoryUnit.GB).amount
val userCommandImageSizeRoundedUpInGB = userCommandImageSizeInGB.ceil.toInt
.map(s => MemorySize(s.toDouble, MemoryUnit.Bytes).to(MemoryUnit.GB))

Check warning on line 161 in supportedBackends/google/pipelines/v2beta/src/main/scala/cromwell/backend/google/pipelines/v2beta/LifeSciencesFactory.scala

View check run for this annotation

Codecov / codecov/patch

supportedBackends/google/pipelines/v2beta/src/main/scala/cromwell/backend/google/pipelines/v2beta/LifeSciencesFactory.scala#L161

Added line #L161 was not covered by tests
.getOrElse(MemorySize(30, MemoryUnit.GB))
val userCommandImageSizeRoundedUpInGB = userCommandImageSizeInGB.amount.ceil.toInt

val totalSize = fromRuntimeAttributes +
createPipelineParameters.dockerImageCacheDiskOpt
Expand Down

0 comments on commit 8971bfe

Please sign in to comment.