Skip to content
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

DOC: improve dev environment documentation #202

Merged
merged 3 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 33 additions & 7 deletions docs/source/devs/env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ in a development container.

.. attention::

The ``dr`` script bind-mounts your local copy of the repository into the container.
Any edits you make outside the container will be reflected inside (and vice versa).
The ``dr`` script bind-mounts your local copy of the repository into the
container. Any edits you make outside the container will be reflected
inside (and vice versa).

Anything you pass to ``dr`` will be executed inside the container.
The initial working directory is the ``htmap`` repository inside the container.
Expand All @@ -25,8 +26,20 @@ Running the Test Suite
----------------------

The fastest way to run the test suite is to run ``pytest`` inside the
development container with multiple workers.
``pytest -n 4`` seems to be a good number for laptops.
development container with multiple workers:

.. code:: shell

$ ./dr bash # for example
# ...
mapper@161b6af91d72:~/htmap$ pytest

``pytest -n 4`` seems to be a good number for laptops:

.. code:: shell

mapper@161b6af91d72:~/htmap$ pytest -n 4

See `pytest-xdist <https://pypi.org/project/pytest-xdist/>`_ for more details.


Expand All @@ -36,8 +49,16 @@ Building the Docs
HTMap's documentation is served by `Read the Docs <https://readthedocs.org/>`_,
which builds the docs as well.
However, it can be helpful to build the docs locally during development.
From inside the development container, run `docs/autobuild.sh` inside the
development container.
From inside the development container,

.. code:: shell

$ ./dr bash
# ...
mapper@161b6af91d72:~/htmap$ ./docs/autobuild
NOTE: CONNECT TO http://127.0.0.1:8000 NOT WHAT SPHINX-AUTOBUILD TELLS YOU
# trimmed; visit URL above

Note the startup message: ignore the link that `sphinx-autobuild` gives you,
and instead go to http://127.0.0.1:8000 to see the built documentation.

Expand All @@ -50,7 +71,12 @@ The tutorials are run inside a specialized Docker container
(not the development container).
To test whether the Binder container is working properly, run the
``binder/test.sh`` script from the repository root
(i.e., not from inside the development container).
(i.e., not from inside the development container):

.. code:: shell

$ source binder/test.sh
stsievert marked this conversation as resolved.
Show resolved Hide resolved

It will give you a link to enter into your web browser that will land you in the
same Jupyter environment you would get on Binder.
The ``binder/edit.sh`` will do the same, but also bind-mount the tutorials into
Expand Down
2 changes: 1 addition & 1 deletion dr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ CONTAINER_TAG='htmap-dev'

set -e

docker build --quiet -t ${CONTAINER_TAG} --file docker/Dockerfile .
docker build -t ${CONTAINER_TAG} --file docker/Dockerfile .

docker run -it --rm --mount type=bind,src="$PWD",dst=/home/mapper/htmap -p 8000:8000 ${CONTAINER_TAG} $@