Skip to content

Update byo integ test to use sagemaker upload_data method #341

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

Merged
merged 4 commits into from
Aug 9, 2018

Conversation

yangaws
Copy link
Contributor

@yangaws yangaws commented Aug 9, 2018

Issue #, if available:

Description of changes:
1, Use sagemaker api instead of boto api. This reduces the credential error we got from canary test.
2, Add a dummy tensor binary data file for byo integ test to upload to s3. No need to generate it all the time.

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 have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated the changelog with a description of my changes (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.

Copy link
Contributor

@laurenyu laurenyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also make this change in the BYO hyperparameter tuning test? https://github.com/aws/sagemaker-python-sdk/blob/master/tests/integ/test_tuner.py#L360

s3_train_data = 's3://{}/{}/train/{}'.format(bucket, prefix, key)

s3_train_data = sagemaker_session.upload_data(path=training_data_path,
key_prefix=os.path.join(prefix, 'train', key))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since key_prefix is for the S3 path, you don't have to use os.path.join

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I understand it incorrectly? Should I just put everything in the uri after bucket for this arg?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no you have the right thing for the arg, but because S3 always uses '/' regardless of the OS you're running on, you don't need to os.path.join - you can just do '{}/train/{}'.format(prefix, key) or whatever

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh got it.

I actually just copied codes from old lines using os.join. I guess it's not very different? Do I need to send another PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik, it'll fail only on Windows, and I'm sure this isn't the only place where we have this issue. It should probably be fixed when we fix our Windows support.

laurenyu
laurenyu previously approved these changes Aug 9, 2018
Copy link
Contributor

@icywang86rui icywang86rui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yangaws yangaws merged commit 021b67d into aws:master Aug 9, 2018
@yangaws yangaws deleted the byo_test branch August 9, 2018 23:23
pdasamzn pushed a commit to pdasamzn/sagemaker-python-sdk that referenced this pull request Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants