MLModelCI welcomes your contributions!
To contribute to the MLModelCI, you need to setup the developing environment first, you can easily create the dev environments according to the following steps. All the scripts should be executed under the root project of this repo.
# create environment
conda env create -f environment.yml
# install PyTorch with specific CUDA version
conda install pytorch torchvision cudatoolkit=<YOUR_CUDA_VERSION> -c pytorch
conda install pytorch-lightning -c conda-forge
pip install hummingbird-ml==0.2.1 torchviz==0.0.1
# set PYTHONPATH
export PYTHONPATH="${PWD}"
To use customized settings such as backend host name, MongoDB password, change the corresponding settings defines at
env-backend.env
(for backend), env-frontend.env
(for frontend) and env-mongodb.env
(for MongoDB).
After that, you should re-generate the environment files (.env
) for the backend and the frontend.
python scripts/generate_env.py
python modelci/cli/__init__.py service init
PyTest is used to execute tests. PyTest can be
installed from PyPI via pip install pytest
.
python -m pytest tests/
You can also provide the -v
flag to pytest
to see additional information about the
tests.
We have some static checks when you filing a PR or pushing commits to the project, please make sure you can pass all the tests and make sure the coding style meets our requirements.
Firstly, you have to fork this repo: https://github.com/cap-ntu/ML-Model-CI and create a local clone of this fork
git clone https://github.com/<YOUR-USERNAME>/ML-Model-CI.git
Then add the original repository as upstream
cd ML-Model-CI
git remote add upstream https://github.com/cap-ntu/ML-Model-CI.git
you can use the following command to verify that the remote is set
git remote -v
This is a must before you make any changes to your fork, or conflict may happen.
git fetch upstream
git checkout master
git merge upstream/master
git push origin master
or you can automate simplify this work by the following command
git branch --set-upstream-to=upstream/master master
git config --local remote.pushDefault origin
and then the workflow becomes:
git checkout master
git fetch
git merge
git push
Before you may any pull request, please correlate your branch with at least one existing opened issue or open one with appropriate labels.
Then you can create a new branch, make sure the branch name is descriptive.
git checkout -b <NEW-BRANCH-NAME>
After making the necessary change, you can commit it to your local repository. There is a general rule for making a commit:
Commits should be logical, atomic units of change
git add -A
git commit -m "<COMMIT-MESSAGE>"
Then push the commit to your Github fork
git push -u origin <NEW-BRANCH-NAME>
You can make a pull request now, make sure to link the relevant issue in your pull request description. Here are relevant docs which may help:
If your branch is out of date during the process, it cannot be merge automatically and you should fix your branch by merging the target branch into your branch.
Once your pull request is merged into the original repository, you should delete the new branch and push the deletion to your fork
git branch -d <NEW-BRANCH-NAME>
git push -u origin master
git push --delete origin