Skip to content

Commit

Permalink
Merge pull request #160 from ngageoint/issue-159
Browse files Browse the repository at this point in the history
Closes #159 added ALLOCATED_ to resource env. variable normalization
  • Loading branch information
gisjedi authored Jun 27, 2018
2 parents 1837241 + eaa111a commit da74004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ func DefineResources(seed *objects.Seed, inputSizeMiB float64) ([]string, float6
value = fmt.Sprintf("%d", intMem)
}

envVar := util.GetNormalizedVariable(s.Name)
envVar := util.GetNormalizedVariable("ALLOCATED_" + s.Name)
resources = append(resources, "-e")
resources = append(resources, fmt.Sprintf("%s=%s", envVar, value))
}
Expand Down
6 changes: 3 additions & 3 deletions commands/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ func TestDefineResources(t *testing.T) {
expectedErrorMsg string
}{
{"../examples/addition-job/seed.manifest.json",
4.0, "[-e CPUS=0.100000 -m 16m -e MEM=16 -e DISK=5.000000 --shm-size=128m -e SHAREDMEM=128]", 5.0, true, ""},
4.0, "[-e ALLOCATED_CPUS=0.100000 -m 16m -e ALLOCATED_MEM=16 -e ALLOCATED_DISK=5.000000 --shm-size=128m -e ALLOCATED_SHAREDMEM=128]", 5.0, true, ""},
{"../examples/extractor/seed.manifest.json",
1.0, "[-e CPUS=1.000000 -m 16m -e MEM=16 --shm-size=1m -e SHAREDMEM=1 -e DISK=1.010000]", 1.01, true, ""},
1.0, "[-e ALLOCATED_CPUS=1.000000 -m 16m -e ALLOCATED_MEM=16 --shm-size=1m -e ALLOCATED_SHAREDMEM=1 -e ALLOCATED_DISK=1.010000]", 1.01, true, ""},
{"../examples/extractor/seed.manifest.json",
16.0, "[-e CPUS=1.000000 -m 16m -e MEM=16 --shm-size=1m -e SHAREDMEM=1 -e DISK=16.010000]", 16.01, true, ""},
16.0, "[-e ALLOCATED_CPUS=1.000000 -m 16m -e ALLOCATED_MEM=16 --shm-size=1m -e ALLOCATED_SHAREDMEM=1 -e ALLOCATED_DISK=16.010000]", 16.01, true, ""},
}

for _, c := range cases {
Expand Down

0 comments on commit da74004

Please sign in to comment.