-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ResourceRequirements tests [partial] (relates to #138) + ensure b…
…ig job log messages are clipped
- Loading branch information
1 parent
4d3ad62
commit eaa129b
Showing
9 changed files
with
221 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/functional/application-packages/SimulateResourceUsage/deploy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# YAML representation supported by WeaverClient | ||
processDescription: | ||
id: SimulateResourceUsage | ||
title: Gradually allocate RAM to simulate a process load. | ||
version: "1.0" | ||
keywords: | ||
- test | ||
jobControlOptions: | ||
- async-execute | ||
outputTransmission: | ||
- reference | ||
executionUnit: | ||
# note: This does not work by itself! The test suite injects the file dynamically. | ||
- href: "tests/functional/application-packages/SimulateResourceUsage/package.cwl" | ||
deploymentProfileName: "http://www.opengis.net/profiles/eoc/dockerizedApplication" |
4 changes: 4 additions & 0 deletions
4
tests/functional/application-packages/SimulateResourceUsage/job.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ram_amount: 4 | ||
ram_chunks: 16 | ||
time_duration: 1 | ||
time_interval: 0.25 |
45 changes: 45 additions & 0 deletions
45
tests/functional/application-packages/SimulateResourceUsage/package.cwl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env cwl-runner | ||
# WARNING: | ||
# This process can generate a large memory load and a very large output file that captures the generated data. | ||
# Even with default ResourceRequirement values, the output can become substantial rapidly. | ||
cwlVersion: "v1.0" | ||
class: CommandLineTool | ||
baseCommand: | ||
- bash | ||
- script.sh | ||
requirements: | ||
DockerRequirement: | ||
dockerPull: debian:stretch-slim | ||
InitialWorkDirRequirement: | ||
listing: | ||
# below script is generated dynamically in the working directory, and then called by the base command | ||
# reference: https://unix.stackexchange.com/a/254976/288952 | ||
- entryname: script.sh | ||
entry: | | ||
echo "Will allocate RAM chunks of $(inputs.ram_chunks) MiB." | ||
echo "Will allocate RAM chunks in increments up to $(inputs.ram_amount) times." | ||
echo "Will maintain allocated RAM load for $(inputs.time_duration)s for each increment." | ||
echo "Will wait $(inputs.time_interval)s between each allocation." | ||
echo "Begin allocating memory..." | ||
for index in \$(seq $(inputs.ram_amount)); do | ||
echo "Allocating \$index x $(inputs.ram_chunks) MiB for $(inputs.time_duration)s..." | ||
cat <( </dev/zero head -c \$((\$index * $(inputs.ram_chunks)))m) <(sleep $(inputs.time_duration)) | tail | ||
echo "Waiting for $(inputs.time_interval)s..." | ||
sleep $(inputs.time_interval) | ||
done | ||
echo "Finished allocating memory..." | ||
inputs: | ||
ram_chunks: | ||
type: int | ||
ram_amount: | ||
type: int | ||
time_duration: | ||
type: float | ||
time_interval: | ||
type: float | ||
outputs: | ||
output: | ||
type: File | ||
outputBinding: | ||
glob: "stdout.log" | ||
stdout: stdout.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters