Skip to content

Commit

Permalink
Merge pull request #1289 from buildtesters/docs_on_autogenerated_exam…
Browse files Browse the repository at this point in the history
…ples

document how to generate examples for buildtest tutorial
  • Loading branch information
shahzebsiddiqui authored Nov 3, 2022
2 parents b4f5f6a + 3bc4ae2 commit b364cc6
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/contributing/build_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,34 @@ DocStrings

We have enabled `napolean extension <https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html>`_ to support
Google style docstring. Please follow this format when you are writting docstring for buildtest codebase. For more details
on google style see: https://google.github.io/styleguide/pyguide.html
on google style see: https://google.github.io/styleguide/pyguide.html

Generating Documentation Examples for Buildtest Tutorial
----------------------------------------------------------

The documentation examples for the buildtest tutorial are run inside the container image
ghcr.io/buildtesters/buildtest_spack:latest which means that some of the example output needs to be generated manually. There
is a script `doc-examples.py <https://github.com/buildtesters/buildtest/blob/devel/scripts/spack_container/doc-examples.py>`_ that
is responsible for auto-generating the documentation examples inside the container. To get started you will need to run the
following commands.

.. Note::

You may need to `source /etc/profile` in your container if you see module command is not found.

.. code-block:: console
docker run -it -v $BUILDTEST_ROOT:/home/spack/buildtest ghcr.io/buildtesters/buildtest_spack:latest
cd /home/spack/buildtest
source scripts/spack_container/setup.sh
You will need to volume mount **$BUILDTEST_ROOT** into `/home/spack/buildtest` in-order to get buildtest code-base accessible inside
the container.

Once you setup is complete, please run the python script and it will auto-generate the documentation examples::

python scripts/spack_container/doc-examples.py

Please verify all the auto-generated examples that will be used in the documentation. Once you are content with all the changes please add all
the changes via ``git add``.

0 comments on commit b364cc6

Please sign in to comment.