I’d like to start a home in the TVM repo for TVM developer tools–that is, scripts that folks working on TVM might like to run locally. At present, TVM’s developer tools are quite scattered:
Makefileis in the root directory which we don’t maintain
docker/bash.shis the cornerstone for reproducing workflows from CI (we do have a wrapper script on top of this, see below, but this is the entry point). This is not an implementation detail of the CI–the script makes accommodation for almost any calling user’s uid/gid and allows for network port forwarding for interactive Jupyter. Despite this, there’s no reason anyone would think to look in
dockerfor a script like this unless they were accustomed to docker.
- The individual Jenkins tasks are defined in
tests/scripts/task_*. This kind of makes sense, but this directory has become bloated with both scripts that really serve to define test suites and random other scripts that are primarily helper scripts for Jenkinsfile or GitHub Actions.
- Linting can be done with
docker/lint.shbut it is not well-tested
- There is documentation in various README.md (e.g.
jvm/README.md) describing how to do some local core development processes (e.g. building and serving docs), but each of these suffers from needing some common core infrastructure (such as
docker/bash.sh) which itself isn’t documented.
Thinking more about how we might go about this, developer scripts are pretty closely tied to scripts that launch things in CI, since they mainly are scaffolding that invokes those CI scripts in a local dev environment. I’d like to propose a fairly broad overhaul that might affect local developer workflows, and given that I’d like to get feedback from the community.
- We create the
devtop-level directory which contains scripts meant to be invoked by TVM developers.
- We create
citop-level directory (I’ve started down this path with the Jenkinsfile generator which mostly only @driazati and I touch right now).
- We move the following scripts:
- All Jenkinsfile and GH Action Python helpers: to
tests/scripts/cmd_utils.py tests/scripts/determine_docker_images.py tests/scripts/github_cc_reviewers.py tests/scripts/github_docs_comment.py tests/scripts/github_tag_teams.py tests/scripts/github_tvmbot.py tests/scripts/git_skip_ci_globs.py tests/scripts/git_skip_ci.py tests/scripts/git_utils.py tests/scripts/http_utils.py tests/scripts/open_docker_update_pr.py tests/scripts/ping_reviewers.py tests/scripts/pytest_ids.py tests/scripts/pytest_wrapper.py tests/scripts/should_rebuild_docker.py tests/scripts/should_run_slow_tests.py tests/scripts/task_build.py tests/scripts/update_branch.py
- We remove
Makefileand instead add a mode to
dev/run_local_ci.pyto run outside docker.
- We establish the
tvm_ciPython package locally (e.g. create
ci/tvm_ci/__init__.py, it’s not published to PyPI) and introduce
tests/tvm_ciin order to consolidate helpers and unittest them.
- We rewrite the documentation tree (everything in
docs/, but e.g. especially the Contributor Guide) to reference the new scripts. We add documentation describing how to use tools in
Would be great to hear everyone’s thoughts!