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?

feita há 2 anos279 visualizações
1 Resposta
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
ENGENHEIRO DE SUPORTE
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas