Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.
- Table of Contents
- Reporting Bugs/Feature Requests
- Contributing via Pull Requests (PRs)
- Finding Contributions to Work On
- Code of Conduct
- Security Issue Notifications
- Licensing
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
When filing an issue, please check existing open and recently closed issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
- A reproducible test case or series of steps.
- The version of our code being used.
- Any modifications you've made relevant to the bug.
- A description of your environment or deployment.
Contributions via pull requests are much appreciated.
Before sending us a pull request, please ensure that:
- You are working against the latest source on the master branch.
- You check the existing open and recently merged pull requests to make sure someone else hasn't already addressed the problem.
- You open an issue to discuss any significant work - we would hate for your time to be wasted.
- Set up the Cloud9 environment:
- Instance type: You'll need at least 4 GB of RAM to avoid running into memory issues. We recommend at least a t3.medium to run the unit tests. A larger host will reduce the chance of encountering resource limits.
- Follow the instructions at Creating a Cloud9 EC2 Environment to set up a Cloud9 EC2 environment.
- Expand the storage of the EC2 instance from 10GB to 20GB:
- Because you'll need a minimum of 11GB of disk storage on the EC2 instance to run the repository's unit tests, you'll need to expand your EC2 volume size. We recommend at least 20GB. A larger volume will reduce the chance of encountering resource limits.
- Follow the instructions at Modifying an EBS Volume Using Elastic Volumes (Console) to increase the EBS volume size associated with the newly created EC2 instance.
- Wait 5-10min for the new EBS volume increase to finalize.
- Allow EC2 to claim the additional space by stopping and then starting your EC2 host.
- If you do not already have one, create a GitHub account by following the prompts at Join Github.
- Create a fork of this repository on GitHub. You should end up with a fork at
https://github.com/<username>/sagemaker-python-sdk
.- Follow the instructions at Fork a Repo to fork a GitHub repository.
- Clone your fork of the repository:
git clone https://github.com/<username>/sagemaker-python-sdk
where<username>
is your github username.
- Install tox using
pip install tox
- Install coverage using
pip install .[test]
- cd into the sagemaker-python-sdk folder:
cd sagemaker-python-sdk
orcd /environment/sagemaker-python-sdk
- Run the following tox command and verify that all code checks and unit tests pass:
tox tests/unit
You can also run a single test with the following command: tox -e py36 -- -s -vv <path_to_file><file_name>::<test_function_name>
- Note that the coverage test will fail if you only run a single test, so make sure to surround the command with
export IGNORE_COVERAGE=-
andunset IGNORE_COVERAGE
- Example:
export IGNORE_COVERAGE=- ; tox -e py36 -- -s -vv tests/unit/test_estimator.py::test_sagemaker_model_s3_uri_invalid ; unset IGNORE_COVERAGE
Our CI system runs integration tests (the ones in the tests/integ
directory), in parallel, for every Pull Request.
You should only worry about manually running any new integration tests that you write, or integration tests that test an area of code that you've modified.
- Follow the instructions at Set Up the AWS Command Line Interface (AWS CLI).
- To run a test, specify the test file and method you want to run per the following command:
tox -e py36 -- -s -vv <path_to_file><file_name>::<test_function_name>
- Note that the coverage test will fail if you only run a single test, so make sure to surround the command with
export IGNORE_COVERAGE=-
andunset IGNORE_COVERAGE
- Example:
export IGNORE_COVERAGE=- ; tox -e py36 -- -s -vv tests/integ/test_tf_script_mode.py::test_mnist ; unset IGNORE_COVERAGE
- Note that the coverage test will fail if you only run a single test, so make sure to surround the command with
If you are writing or modifying a test that creates a SageMaker job (training, tuner, or transform) or endpoint, it's important to assign a concurrency-friendly job_name
(or endpoint_name
), or your tests may fail randomly due to name collisions. We have a helper method sagemaker.utils.unique_name_from_base(base, max_length)
that makes test-friendly names. You can find examples of how to use it here and
here, or by searching for "unique_name_from_base" in our test code.
- Create a new git branch:
git checkout -b my-fix-branch master
- Make your changes, including unit tests and, if appropriate, integration tests.
- Include unit tests when you contribute new features or make bug fixes, as they help to:
- Prove that your code works correctly.
- Guard against future breaking changes to lower the maintenance cost.
- Please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
- Include unit tests when you contribute new features or make bug fixes, as they help to:
- Run all the unit tests as per Running the Unit Tests, and verify that all checks and tests pass.
We use commit messages to update the project version number and generate changelog entries, so it's important for them to follow the right format. Valid commit messages include a prefix, separated from the rest of the message by a colon and a space. Here are a few examples:
feature: support VPC config for hyperparameter tuning
fix: fix flake8 errors
documentation: add MXNet documentation
Valid prefixes are listed in the table below.
Prefix | Use for... |
---|---|
breaking |
Incompatible API changes. |
deprecation |
Deprecating an existing API or feature, or removing something that was previously deprecated. |
feature |
Adding a new feature. |
fix |
Bug fixes. |
change |
Any other code change. |
documentation |
Documentation changes. |
Some of the prefixes allow abbreviation ; break
, feat
, depr
, and doc
are all valid. If you omit a prefix, the commit will be treated as a change
.
For the rest of the message, use imperative style and keep things concise but informative. See How to Write a Git Commit Message for guidance.
GitHub provides additional document on Creating a Pull Request.
Please remember to:
- Use commit messages (and PR titles) that follow the guidelines under Committing Your Change.
- Send us a pull request, answering any default questions in the pull request interface.
- Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opensource-codeofconduct@amazon.com with any additional questions or comments.
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public github issue.
See the LICENSE file for our project's licensing. We will ask you to confirm the licensing of your contribution.
We may ask you to sign a Contributor License Agreement (CLA) for larger changes.