Repository navigation
Support to requirements.txt file - #60
Conversation
Codecov Report
@@ Coverage Diff @@
## r2.0 #60 +/- ##
=========================================
- Coverage 98.45% 98.1% -0.35%
=========================================
Files 14 15 +1
Lines 452 475 +23
Branches 24 25 +1
=========================================
+ Hits 445 466 +21
- Misses 4 6 +2
Partials 3 3
Continue to review full report at Codecov.
|
| shutil.rmtree(tmp) | ||
|
|
||
|
|
||
| def write_file(path, content, mode='w'): # type: (str, str, str) -> None |
There was a problem hiding this comment.
I don't think this kind of function (along with tmpdir and read_json), belongs to this module (env.py) -- they're utility functions that could really live anywhere since they don't refer to variables in the module's scope. write_file, for example, is only called in another module (module.py) -- it could be _write_file in module.py
My concern is that users will depend on these utility functions and they'll be part of the sagemaker_containers.env interface, just like gpu_count, TrainingEnvironment-- are we ok with that?
There was a problem hiding this comment.
I agree with you @andremoeller, are you ok if the follow up PR includes the code moves?
| subprocess.check_call(shlex.split('%s -m pip install %s -U' % (sys.executable, path))) | ||
| except subprocess.CalledProcessError: | ||
| raise RuntimeError('Failed to pip install %s:%s%s' % (path, os.linesep, traceback.format_exc())) | ||
| cmd = '%s -m pip install -U . ' % sys.executable |
There was a problem hiding this comment.
We got into trouble because I moved requirements.txt installation from TensorFlow into SageMaker Container Support, so we moved it back. I think @laurenyu knows more about why that didn't work though -- I suggest you make sure we aren't running into the same problem.
There was a problem hiding this comment.
the issue last time was that the logic for downloading the user code was in the TF container, and the call to install requirements occurred before that downloading happened.
There was a problem hiding this comment.
Thanks to detail the issue @laurenyu. I believe that our current implementation does not have the same issue, I will make sure to integration on the framework containers to ensure that it is working.
| subprocess.check_call(shlex.split('%s -m pip install %s -U' % (sys.executable, path))) | ||
| except subprocess.CalledProcessError: | ||
| raise RuntimeError('Failed to pip install %s:%s%s' % (path, os.linesep, traceback.format_exc())) | ||
| cmd = '%s -m pip install -U . ' % sys.executable |
There was a problem hiding this comment.
the issue last time was that the logic for downloading the user code was in the TF container, and the call to install requirements occurred before that downloading happened.
| module = modules.download_and_import(user_module.url, 'test_script') | ||
| module = modules.download_and_import(user_module.url, user_module_name, cache=False) | ||
|
|
||
| # flake8: noqa ignore=W291 trailing whitespace |
There was a problem hiding this comment.
why do you need trailing whitespace here? does this mean things will break if someone's editor automatically deletes all trailing whitespace?
There was a problem hiding this comment.
Good call. I will remove the noqa
andremoeller
left a comment
There was a problem hiding this comment.
Changes in a future PR
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.