Skip to content
This repository was archived by the owner on Aug 26, 2020. It is now read-only.

Conversation

@loodvn
Copy link

@loodvn loodvn commented Feb 5, 2020

Issue #, if available:
#245

Description of changes:

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sagemaker-bot
Copy link

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@loodvn
Copy link
Author

loodvn commented Feb 5, 2020

As described in https://github.com/aws/sagemaker-containers/issues/245, I can't seem to use an entry point that's nested inside my package.

In _process.py, we trim the ".py" extension from e.g. train.py and then run

python -m train

When the user-given entry point contains path seperators, this becomes

python -m my_package/train

, which causes an ImportError.

I have two proposed ideas for a fix:

  • Replace path separators with periods
  • If "/" exists in the entry point, change the entry point type to "python program", which means that my_package/train.py will run as a program.

I'm just not sure what side effects the second would have (by changing the entry point type), so I implemented the first so long.

@loodvn
Copy link
Author

loodvn commented Feb 5, 2020

Oops, I just realised that with something like

setup.py
src/
  my_package/
    train.py

The above change would still give me src.my_package.train, instead of my_package.train.

Do you have any thoughts on this?

@loodvn loodvn changed the title added split function and tests, inserted into _process.py added split path function and tests, inserted into _process.py Feb 5, 2020
@laurenyu
Copy link
Contributor

going to close this in favor of aws/sagemaker-python-sdk#941 (see #245)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants