Skip to content

Commit

Permalink
feat(back): #973.3 propagate tags
Browse files Browse the repository at this point in the history
- add propagate tags option

Signed-off-by: Daniel F. Murcia Rivera <[email protected]>
  • Loading branch information
danmur97 committed Oct 26, 2022
1 parent c8316d0 commit 82b02a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/args/compute-on-aws-batch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
includePositionalArgsInName,
memory,
parallel,
propagateTags,
queue,
name,
setup,
Expand Down Expand Up @@ -65,6 +66,7 @@ makeScript {
};
__argName__ = name;
__argParallel__ = parallel;
__argPropagate__ = propagateTags;
__argQueue__ = queue;
__argTags__ = let
tag_names = builtins.attrNames tags;
Expand Down
4 changes: 4 additions & 0 deletions src/args/compute-on-aws-batch/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function main {
local name="__argName__"
local queue="__argQueue__"
local parallel="__argParallel__"
local propagate="__argPropagate__"
local tags="__argTags__"
local submit_job_args

Expand Down Expand Up @@ -79,6 +80,9 @@ function main {
--timeout "attemptDurationSeconds=${attempt_duration_seconds}"
--tags "${tags}"
) \
&& if test -n "${propagate}"; then
submit_job_args+=(--propagate-tags)
fi \
&& if [ "${parallel}" -gt "1" ]; then
submit_job_args+=(--array-properties "size=${parallel}")
fi \
Expand Down
5 changes: 5 additions & 0 deletions src/evaluator/modules/compute-on-aws-batch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
inherit (config) memory;
inherit name;
inherit (config) parallel;
inherit (config) propagateTags;
inherit (config) queue;
inherit (config) setup;
inherit (config) tags;
Expand Down Expand Up @@ -67,6 +68,10 @@ in {
default = 1;
type = lib.types.ints.positive;
};
propagateTags = lib.mkOption {
default = true;
type = lib.types.bool;
};
queue = lib.mkOption {
type = lib.types.nullOr lib.types.str;
};
Expand Down

0 comments on commit 82b02a7

Please sign in to comment.