Hi all,
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:
- A
Makefile
is in the root directory which we don’t maintain -
docker/bash.sh
is 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 indocker
for 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.sh
but it is not well-tested - There is documentation in various README.md (e.g.
docs/README.md
,jenkins/README.md
,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 asdocker/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
dev
top-level directory which contains scripts meant to be invoked by TVM developers. - We create
ci
top-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:
-
docker/bash.sh
→dev/docker-run.sh
-
docker/clear-stale-images.sh
→dev/docker-rmi-unused-tlcpack-images.sh
-
docker/lint.sh
→dev/lint.sh
-
docker/dev_common.sh
→dev/lib/common.sh
-
tests/scripts/task_*
→ci/tasks/task_*
-
tests/scripts/ci.py
→dev/run_local_ci.py
- All Jenkinsfile and GH Action Python helpers: to
ci/tvm_ci
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
Makefile
and instead add a mode todev/run_local_ci.py
to run outside docker. - We establish the
tvm_ci
Python package locally (e.g. createci/tvm_ci/__init__.py
, it’s not published to PyPI) and introducetests/tvm_ci
in 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 indev
.
Would be great to hear everyone’s thoughts!
Andrew