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?

gefragt vor 2 Jahren279 Aufrufe
1 Antwort
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
SUPPORT-TECHNIKER
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen