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?

posta 2 anni fa279 visualizzazioni
1 Risposta
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
TECNICO DI SUPPORTO
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande