Skip to content

Commit

Permalink
Merge pull request #57 from commit-0/docs3
Browse files Browse the repository at this point in the history
Updates to docs
  • Loading branch information
srush authored Sep 25, 2024
2 parents 5e897ea + 2b0cc7d commit 1711fdf
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 140 deletions.
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ The [commit0 tool](setup) allows you to:
* Distribute testing and development across cloud systems
* Track and log all changes made throughout.

To install run:

```bash
pip install commit0
```


| | Name | Repo | Commit0 | Tests | |
|--|--------|-------|----|----|------|
| <img src='https://avatars.githubusercontent.com/u/69814924?s=280&v=4' width='100px'/> | [minitorch](https://minitorch.github.io/) | [[orig](http://github.com/minitorch/minitorch)] | [[commit0](http://github.com/commit-0/minitorch)] | 230 | <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAQAAADtJZLrAAAAD0lEQVR42mNkYGAcRcQhADxaAGWhD8eHAAAAAElFTkSuQmCC'/> |
Expand Down
139 changes: 0 additions & 139 deletions docs/setup.md

This file was deleted.

46 changes: 46 additions & 0 deletions docs/setupdist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Distributed Mode

Commit0 is a command-line tool that allows you to run unit-tests on a
variety of libraries in isolated environments.

The defaul tool uses [modal](https://modal.com/) as a distributed
test runner.

```bash
pip install modal
modal token new
```

To get started, run the `setup` command with the dataset
split that youare interested in working with.
We'll start with the `lite` split.

```bash
commit0 setup lite
```

This will clone a set of skeleton libraries in your `repos/` directory.
Commiting changes to branches in this directory is how you send changes
to the test runner.

Next to run tests you can run the standard test command.
This command will run a reference unit test for the `simpy` repo.

```bash
commit0 test simpy tests/test_event.py::test_succeed --reference
```

To run a test in your codebase you can run with no args.
This one will fail.

```bash
commit0 test simpy tests/test_event.py::test_succeed
```

To run a test in your codebase with a specific branch
you can commit to the branch and call with the --branch command.


```bash
commit0 test simpy tests/test_event.py::test_succeed --branch my_branch
```
36 changes: 36 additions & 0 deletions docs/setuplocal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Local Mode

To run in local mode you first be sure that you have [docker tools](https://docs.docker.com/desktop/install/mac-install/)
installed. On Debian systems:

```bash
apt install docker
```

To get started, run the `setup` command with the dataset
split that you are interested in working with.
We'll start with the `lite` split.


```bash
commit0 setup lite
```

This will install a clone the code for subset of libraries to your `repos/` directory.

Next run the `build` command which will configure Docker containers for
each of the libraries with isolated virtual environments. The command uses the
[uv](https://github.com/astral-sh/uv) library for efficient builds.

```bash
commit0 build
```

The main operation you can do with these enviroments is to run tests.
Here we run [a test](https://github.com/commit-0/simpy/blob/master/tests/test_event.py#L11) in the `simpy` library.

```bash
commit0 test simpy tests/test_event.py::test_succeed
```

See [distributed setup](setupdist) for more commands.
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ site_name: ""
docs_dir: docs
nav:
- Home: index.md
- Setup: setup.md
- Distributed: setupdist.md
- Local: setuplocal.md
- Extending: repos.md
- About: about.md
theme:
Expand Down

0 comments on commit 1711fdf

Please sign in to comment.