Skip to content

Latest commit

History

History
260 lines (211 loc) 路 11.2 KB

CONTRIBUTING.md

File metadata and controls

260 lines (211 loc) 路 11.2 KB

馃鈥嶐煉 Contributing to ZenML

A big welcome and thank you for considering contributing to ZenML! It鈥檚 people like you that make it a reality for users in our community.

Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the developers' time management and develop these open-source projects. In return, we will reciprocate that respect by reading your issue, assessing changes, and helping you finalize your pull requests.

鈿★笍 Quicklinks

馃鈥嶁殩锔 Code of Conduct

We take our open-source community seriously and hold ourselves and other contributors to high standards of communication. By participating and contributing to this project, you agree to uphold our Code of Conduct .

馃洬 Getting Started

Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both:

  • To report security vulnerabilities, please get in touch at support@zenml.io, monitored by our security team.
  • Search for existing Issues and PRs before creating your own.
  • We work hard to make sure issues are handled on time, but it could take a while to investigate the root cause depending on the impact.

A friendly ping in the comment thread to the submitter or a contributor can help draw attention if your issue is blocking.

Good First Issues for New Contributors

The best way to start is to check the good-first-issue label on the issue board. The core team creates these issues as necessary smaller tasks that you can work on to get deeper into ZenML internals. These should generally require relatively simple changes, probably affecting just one or two files which we think are ideal for people new to ZenML.

The next step after that would be to look at the good-second-issue label on the issue board. These are a bit more complex, might involve more files, but should still be well-defined and achievable to people relatively new to ZenML.

鈦夛笍 Issues

Issues should be used to report problems with the library, request a new feature, or to discuss potential changes before a PR is created. When you create a new Issue, a template will be loaded that will guide you through collecting and providing the information we need to investigate.

If you find an Issue that addresses your problem, please add your own reproduction information to the existing issue rather than creating a new one. Adding a reaction can also help by indicating to our maintainers that a particular issue is affecting more than just the reporter.

馃彿 Pull Requests: When to make one

Pull Requests (PRs) to ZenML are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should:

  • Only fix/add the functionality in question OR address widespread whitespace/style issues, not both.
  • Add unit or integration tests for fixed or changed functionality (if a test suite already exists).
  • Address a single concern in the least number of changed lines as possible.
  • Include documentation in the repo or in your Pull Request.
  • Be accompanied by a filled-out Pull Request template (loaded automatically when a PR is created).

For changes that address core functionality or would require breaking changes (e.g. a major release), it's best to open an Issue to discuss your proposal first. This is not required but can save time creating and reviewing changes.

馃挴 Pull Requests: Workflow to Contribute

Please note that development in ZenML happens off of the develop branch, not main, which is the default branch on GitHub. Therefore, please pay particular attention to step 5 and step 9 below.

In general, we follow the "fork-and-pull" Git workflow

  1. Review and sign the Contributor License Agreement ( CLA).
  2. Fork the repository to your own Github account.
  3. Clone the project to your machine.
  4. Checkout the develop branch <- git checkout develop.
  5. Create a branch (again, off of the develop branch) locally with a succinct but descriptive name.
  6. Commit changes to the branch
  7. Follow the Linting, formatting, and tests guide to make sure your code adheres to the ZenML coding style (see below).
  8. Push changes to your fork.
  9. Open a PR in our repository (to the develop branch, NOT main) and follow the PR template so that we can efficiently review the changes.

馃П Pull Requests: Rebase Your Branch on Develop

  1. When making pull requests to ZenML, you should always make your changes on a branch that is based on develop. You can create a new branch based on develop by running the following command:
    git checkout -b <new-branch-name> develop
    
  2. Fetch the latest changes from the remote develop branch:
    git fetch origin develop
    
  3. Switch to your branch:
    git checkout <your-branch-name>
    
  4. Rebase your branch on develop:
    git rebase origin/develop
    
    This will apply your branch's changes on top of the latest changes in develop, one commit at a time.
  5. Resolve any conflicts that may arise during the rebase. Git will notify you if there are any conflicts that need to be resolved. Use a text editor to manually resolve the conflicts in the affected files.
  6. After resolving the conflicts, stage the changes:
    git add .
    
  7. Continue the rebase for all of your commits and go to 5) if there are conflicts.
    git rebase --continue
    
  8. Push the rebased branch to your remote repository:
    git push origin --force <your-branch-name>
    
  9. Open a pull request targeting the develop branch. The changes from your rebased branch will now be based on the latest develop branch.

馃 Linting, formatting, and tests

To install ZenML from your local checked out files including all core dev-dependencies, run:

pip install -e ".[server,dev]"

Optionally, you might want to run the following commands to ensure you have all integrations for mypy checks:

zenml integration install -y -i feast
pip install click~=8.0.3
mypy --install-types

Warning: This might take a while for both (~ 15 minutes each, depending on your machine), however if you have time, please run it as it will make the next commands error-free. Note that the zenml integration install command might also fail on account of dependency conflicts so you can just install the specific integration you're working on and manually run the mypy command for the files you've been working on.

You can now run the following scripts to automatically format your code and to check whether the code formatting, linting, docstrings, and spelling is in order:

bash scripts/format.sh
bash scripts/run-ci-checks.sh

If you're on Windows you might have to run the formatting script as bash scripts/format.sh --no-yamlfix and run the yamlfix command separately as yamlfix .github -v.

Tests can be run as follows:

bash scripts/test-coverage-xml.sh

Please note that it is good practice to run the above commands before submitting any Pull Request: The CI GitHub Action will run it anyway, so you might as well catch the errors locally!

馃毃 Reporting a Vulnerability

Please refer to our security / reporting instructions for details on reporting vulnerabilities.

Coding Conventions

The code within the repository is structured in the following way - the most relevant places for contributors are highlighted with a <- arrow:

鈹溾攢鈹 .github           -- Definition of the GH action workflows
鈹溾攢鈹 docker            -- Dockerfiles used to build ZenML docker images
鈹溾攢鈹 docs              <- The ZenML docs, CLI docs and API docs live here
鈹   鈹溾攢鈹 book          <- In case you make user facing changes, update docs here
鈹   鈹斺攢鈹 mkdocs        -- Some configurations for the API/CLI docs
鈹溾攢鈹 examples          <- When adding an integration, add an example here
鈹溾攢鈹 scripts           -- Scripts used by Github Actions or for local linting/testing
鈹溾攢鈹 src/zenml         <- The heart of ZenML
鈹   鈹溾攢鈹 <stack_component>   <- Each stack component has its own directory 
鈹   鈹溾攢鈹 cli                 <- Change and improve the CLI here
鈹   鈹溾攢鈹 config              -- The ZenML config methods live here
鈹   鈹溾攢鈹 integrations        <- Add new integrations here
鈹   鈹溾攢鈹 io                  -- File operation implementations
鈹   鈹溾攢鈹 materializers       <- Materializers responsible for reading/writing artifacts
鈹   鈹溾攢鈹 pipelines           <- The base pipeline and its decorator
鈹   鈹溾攢鈹 services            -- Code responsible for managing services
鈹   鈹溾攢鈹 stack               <- Stack, Stack Components and the flavor registry
鈹   鈹溾攢鈹 steps               <- Steps and their decorators are defined here
鈹   鈹溾攢鈹 utils               <- Collection on useful utils
鈹   鈹溾攢鈹 zen_server          -- Code for running the Zen Server
鈹   鈹斺攢鈹 zen_stores          -- Code for storing stacks in multiple settings
鈹斺攢鈹 test              <- Don't forget to write unit tests for your code

馃懛 Creating a new Integration

In case you want to create an entirely new integration that you would like to see supported by ZenML there are a few steps that you should follow:

  1. Create the actual integration. Check out the Integrations README for detailed step-by-step instructions.
  2. Create an example of how to use the integration. Check out the Examples README to find out what to do.
  3. All integrations deserve to be documented. Make sure to pay a visit to the Component Guide in the docs and add your implementations.

馃啒 Getting Help

Join us in the ZenML Slack Community to interact directly with the core team and community at large. This is a good place to ideate, discuss concepts or ask for help.