aws / sagemaker-training-toolkit

Train machine learning models within a 🐳 Docker container using 🧠 Amazon SageMaker.
Apache License 2.0
489 stars 117 forks source link

Relying on potentially uninitialized environment variables. #12

Open nadiaya opened 5 years ago

nadiaya commented 5 years ago
os.environ.get('AWS_REGION', os.environ.get(_params.REGION_NAME_ENV))

I don't think 'AWS_REGION' is set the platform in Training. Looks like 'REGION_NAME_ENV' can be used independently but in reality it gets set when training environment is initialized.

yangaws commented 5 years ago

Hi @mvsusp,

Seems you made the change, do you have an answer for this?

mvsusp commented 5 years ago

The training environment set's the region here https://github.com/aws/sagemaker-containers/blob/master/src/sagemaker_containers/_env.py#L554

This code is more complicated that it should be. I would: