-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Simple Commit & PR rules #466
Comments
I think CI should also test on cuda backend, if it hasn't been set up that way. |
It's sad that online CI servies (Travis/AppVeyor) does not actually provide CUDA. The Jenkins buildbot (http://f11.csail.mit.edu:8080/job/taichi/) is borrowed from the other lab so I don't dare to abuse it for too many builds. However, I recently got an NVIDIA Jetson TX2 which I have exclusive access, so we can at least set that up for testing ARM64 + CUDA. |
Looks good!
More thoughts on CI, I noticed that AppVeyor is very slow, and sometimes the tests can stay in the queue for hours. I guess all these CI issues can be resolved just by spending more money... 😂
+1. I think PRs should always be rebased onto the HEAD of master before merging. It's probably also worth mentioning that the author should not squash the commits (or at least not squash beyond the commit of the last review) during the process of a review, so that reviewers can easily track the diffs. For trivial PRs, squash the commits only after the PR is approved? |
Yeah, money talks :-) (although it takes $745/year to get three parallel jobs on AppVeyor, with which we can reduce the build time from 40min to 13min). On the other hand, I don't know any CI services that support CUDA.
Good point. Added to the list.
Yeah, let's just say |
Yes, and sometimes Travis is far more fast than AppVeyor. I clicked into Details and see, jobs are queueing. Possible solution to make it faster: When we push commits frequent, CI build restarts frequently too. This may cause the CI scheduler (I guess) postpone our follow-up build requests. But some commits are really not necessary for a CI test. For example, a contributor make a little change in a unsiginificant file and push that commit, CI restarts. That's a waste of computation resources. Also, there won't be this problem if we can disable restarting CI for each commit: we could run CI when we want to. For example, PRs with trivial correctness (eg. GUI, examples, docs) can do CI test only after merge is approved. |
The Contributor Guideline should be placed in a eye-catching position so that every newcomers who are willing to contribute can see, for fear of disorder.
to issue/PR template? |
+1, I think this is the most efficient way to utilize CI resources. Maybe trigger the CI automatically only right before the merge? Devs should be allowed to run CI if they need to verify the correctness, but they should also be mindful... |
Possible dirty hack to control CI: before_install:
- test -f $TRAVIS_BUILD_DIR/.enable_ci || exit When creating a new fork, run Or we can make this hack more advanced - detect base commit id: before_install:
- [ `cat $TRAVIS_BUILD_DIR/.ci_base_commit` == $TRAVIS_THIS_COMMIT_ID ] || exit # enable_ci.sh
`git get-this-commit-id` > .ci_base_commit ... where If we want to test the current commit, run |
Thanks for all the valuable inputs! I'm summarizing them up.
Yeah, Travis currently only build for OS X with Python 3.7, while AppVeyor builds for all 3.6/7/8. One more property we can possibly make use of to accelerate AppVeyor: currently AppVeyor builds Taichi with Python 3.6/3.7/3.8 in serial, each taking 13 min, and 40 min in total. For most commits, we only need to build with Python 3.6. For releasing commits (e.g. those with message |
They all look good to me. 👍 One more thing I could think of is code style. Do we want to adopt some linter? |
I also want to ask something about code style... Is there any reason to use 2 space indenting for python code? I think 4 space is the standard, and I get many warning from my editor when I open python files. If we adopt any python linter, I expect we get indentation warning everywhere. |
I would assume 2-space is just personal preference. Modify the your editor setsing (probably PEP-8 related) could make it clean.
We could modify the linter's setting, or just simply adopting the 4-space common practice. |
We also need a coding style for CPP. Personally I've been following the Google coding style, except for function naming for code-base consistency.
We may want to do a few large-scale changes to fix all the styles issue. We can also install some github hooks to check the styles before submitting? |
Currently we heavily rely on clang-format (https://github.com/taichi-dev/taichi/blob/master/.clang-format) and yapf (https://github.com/taichi-dev/taichi/blob/master/misc/.style.yapf).
Exactly. It would be good to have a git hook that automatically formats all the modified code to enforce the styles. |
TBH Google's cpp style is not up to my aesthetic taste. LOL |
I used to have a git hook: https://github.com/taichi-dev/taichi/blob/legacy/githooks/pre-commit.py but for some reason, I abandoned it... |
Well, i don't have much of a choice... ¯_(ツ)_/¯ (But i think it works OK for me) Kind of curious what's your favorite style.. |
One thing I really don't like about Google's style is that they put an extra space before access modifiers... That odd number makes me feel bad somehow... |
A big thank you to everybody for the valuable inputs! The discussions above on commits and PRs have been compiled into the Contributor Guideline in the documentation. Let's continue the code format discussions in Issue #559 :-) |
I noticed that our commit logs can get pretty long, because Github by default record all the intermediate commits in the commit message. E.g.
Should we just remove these intermediate commits before merging? |
Good point. I usually use
in my |
As the Taichi developers community is growing, I suggest we make some simple rules just to make our life easier. The very high-level guidelines are
Commits:
PRs:
master
gets a bit more commits and might be a little messyPlease feel free to add your inputs! Thanks! :-) @k-ye @KLozes @archibate @Psycho7 @masahi
After we reach a consensus, the rules above will be put into the Contributor Guideline.
The text was updated successfully, but these errors were encountered: