Get total number of array workers inside of array job

0

If I subsmit a Batch array job, what is the best practice for getting the total number of array workers within each array worker itself?

I can access the worker index using the AWS_BATCH_JOB_ARRAY_INDEX environment variable, but often this number doesn't mean anything (e.g., for determining the extent of a chunk of data for the worker) without the context of the total number of workers.

I understand that I can supply the total array size as a command line argument to the job, but this is cumbersome. Is there a better way?

質問済み 2年前279ビュー
1回答
1

Unfortunately, there is no straight-forward way to access the Batch array length using the Environment variables. The list of environment variables provided in the doc - https://docs.aws.amazon.com/batch/latest/userguide/job_env_vars.html are the only ones available at the moment.

Please feel free to create a feature request for your use-case in the containers-roadmap github project using this link.

profile pictureAWS
サポートエンジニア
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ