-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Local mode pass training env var #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local mode pass training env var #411
Conversation
SageMaker Training sets various environment variables for every training job, while Local Mode replicates none of these. This change adds the environment variables for the AWS region and training job name.
Codecov Report
@@ Coverage Diff @@
## master #411 +/- ##
==========================================
+ Coverage 93.26% 93.45% +0.19%
==========================================
Files 52 52
Lines 3665 3668 +3
==========================================
+ Hits 3418 3428 +10
+ Misses 247 240 -7
Continue to review full report at Codecov.
|
src/sagemaker/local/image.py
Outdated
@@ -102,7 +106,12 @@ def train(self, input_data_config, hyperparameters): | |||
self.write_config_files(host, hyperparameters, input_data_config) | |||
shutil.copytree(data_dir, os.path.join(self.container_root, host, 'input', 'data')) | |||
|
|||
compose_data = self._generate_compose_file('train', additional_volumes=volumes) | |||
training_env_vars = { | |||
REGION_ENV_NAME: self.sagemaker_session.boto_session.region_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are cases in which boto_session can be None. I would add an if guard here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
talked offline - changed to use sagemaker_session.boto_region_name
SageMaker Training sets various environment variables for every training job, while Local Mode replicates none of these. This change adds the environment variables for the AWS region and training job name.
Description of changes:
SageMaker Training sets various environment variables for every training job, while Local Mode replicates none of these. This change adds the environment variables for the AWS region and training job name.
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.