From 6df7a1c0d5ead5770699bc68b054515388ab733b Mon Sep 17 00:00:00 2001 From: David Acevedo Date: Wed, 12 Oct 2022 00:10:32 -0500 Subject: [PATCH 1/3] fix(build): #967 nodejs binaries - allow bin to be empty as some packages require it Signed-off-by: David Acevedo --- .mailmap | 1 + src/args/make-node-js-modules/builder.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 1efa9678..8af8430d 100644 --- a/.mailmap +++ b/.mailmap @@ -3,6 +3,7 @@ Daniel Murcia Daniel Murcia <42251914+danmur97@users.nore Daniel Salazar Daniel Salazar Daniel Salazar Daniel Salazar Daniel Salazar Daniel Salazar +David Acevedo David Acevedo David Arnold David Arnold David Arnold David Arnold Diego Restrepo Diego Restrepo Mesa <36453706+drestrepom@users.noreply.github.com> diff --git a/src/args/make-node-js-modules/builder.sh b/src/args/make-node-js-modules/builder.sh index 3450eb22..21881d95 100644 --- a/src/args/make-node-js-modules/builder.sh +++ b/src/args/make-node-js-modules/builder.sh @@ -48,8 +48,8 @@ function main { && case "${bin_type}" in object) info Generating binaries from "${package_json}" \ - && jq -er '.bin | to_entries[].key' < "${package_json}" > bins.lst \ - && jq -er '.bin | to_entries[].value' < "${package_json}" > bin_locations.lst \ + && jq -r '.bin | to_entries[].key' < "${package_json}" > bins.lst \ + && jq -r '.bin | to_entries[].value' < "${package_json}" > bin_locations.lst \ && mapfile -t bins < bins.lst \ && mapfile -t bin_locations < bin_locations.lst \ && for ((index = 0; index < "${#bins[@]}"; index++)); do From c2ae63e1183aef93eb06ac194d0de7164216fd67 Mon Sep 17 00:00:00 2001 From: "Daniel F. Murcia Rivera" Date: Mon, 24 Oct 2022 14:23:33 -0500 Subject: [PATCH 2/3] feat(back): #973.1 tags support - add tag support for aws jobs Signed-off-by: Daniel F. Murcia Rivera --- src/args/compute-on-aws-batch/default.nix | 8 ++++++++ src/args/compute-on-aws-batch/entrypoint.sh | 2 ++ src/evaluator/modules/compute-on-aws-batch/default.nix | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/args/compute-on-aws-batch/default.nix b/src/args/compute-on-aws-batch/default.nix index db3b9556..29624506 100644 --- a/src/args/compute-on-aws-batch/default.nix +++ b/src/args/compute-on-aws-batch/default.nix @@ -19,6 +19,7 @@ queue, name, setup, + tags, vcpus, }: makeScript { @@ -65,6 +66,13 @@ makeScript { __argName__ = name; __argParallel__ = parallel; __argQueue__ = queue; + __argTags__ = let + tag_names = builtins.attrNames tags; + encode_tag = key: "${key}=${tags."${key}"}"; + encoded = map encode_tag tag_names; + encoded_tags = builtins.concatStringsSep "," encoded; + in + encoded_tags; }; searchPaths = { bin = [ diff --git a/src/args/compute-on-aws-batch/entrypoint.sh b/src/args/compute-on-aws-batch/entrypoint.sh index 036b2e78..3135ea6b 100644 --- a/src/args/compute-on-aws-batch/entrypoint.sh +++ b/src/args/compute-on-aws-batch/entrypoint.sh @@ -22,6 +22,7 @@ function main { local name="__argName__" local queue="__argQueue__" local parallel="__argParallel__" + local tags="__argTags__" local submit_job_args : \ @@ -76,6 +77,7 @@ function main { --job-definition "${definition}" --retry-strategy "attempts=${attempts}" --timeout "attemptDurationSeconds=${attempt_duration_seconds}" + --tags "${tags}" ) \ && if [ "${parallel}" -gt "1" ]; then submit_job_args+=(--array-properties "size=${parallel}") diff --git a/src/evaluator/modules/compute-on-aws-batch/default.nix b/src/evaluator/modules/compute-on-aws-batch/default.nix index 6f3de09f..0002b7d0 100644 --- a/src/evaluator/modules/compute-on-aws-batch/default.nix +++ b/src/evaluator/modules/compute-on-aws-batch/default.nix @@ -25,6 +25,7 @@ inherit (config) parallel; inherit (config) queue; inherit (config) setup; + inherit (config) tags; inherit (config) vcpus; }; }; @@ -73,6 +74,10 @@ in { default = []; type = lib.types.listOf lib.types.package; }; + tags = lib.mkOption { + default = {}; + type = lib.types.attrsOf lib.types.str; + }; vcpus = lib.mkOption { type = lib.types.ints.positive; }; From 76a1bd6ec4ce0d0f3e39cad694de12aba9f9dd50 Mon Sep 17 00:00:00 2001 From: "Daniel F. Murcia Rivera" Date: Mon, 24 Oct 2022 16:52:29 -0500 Subject: [PATCH 3/3] feat(doc): #973.2 tags support - add tag input on docs Signed-off-by: Daniel F. Murcia Rivera --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c0b3b806..6b8244c3 100644 --- a/README.md +++ b/README.md @@ -1724,6 +1724,9 @@ Types: If the value of attempts is greater than one, the job is retried on failure the same number of attempts as the value. Defaults to `1`. + - tags (`attrsOf str`): Optional. + Tags to apply to the batch job. + Defaults to `{ }`. - attemptDurationSeconds (`ints.positive`): Optional. The time duration in seconds (measured from the job attempt's startedAt timestamp)