aws / aws/sagemaker-training-toolkit

Relying on potentially uninitialized environment variables.

Open
#12 2 comments 0 reactions 0 assignees View on GitHub
priority: low
Dominant language
Python
Stars
530
Forks
140
Avg merge
1h 12m
Merged PRs (30d)
2

Description

- https://github.com/aws/sagemaker-containers/blob/be2ac3746e0afeceb53d2f91261d1586ff290cfc/src/sagemaker_containers/_files.py#L156
- https://github.com/aws/sagemaker-containers/blob/0c0bfcd4afa54f2a7fd71ba6d5c814a692a636f0/src/sagemaker_containers/_trainer.py#L73

```
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.

Contributor guide

Open the contributing guide

Research direction

Start at the referenced lines in src/sagemaker_containers/_files.py and src/sagemaker_containers/_trainer.py, then trace how the training environment initializes REGION_NAME_ENV. Check the behavior when AWS_REGION is absent and determine the expected independent use of REGION_NAME_ENV; done means the environment lookup no longer relies on a potentially unset variable.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.