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

Build documentation automatically with master merge and update website content #379

Merged
merged 6 commits into from
Jan 19, 2020

Conversation

mathfac
Copy link
Contributor

@mathfac mathfac commented Dec 13, 2019

Motivation and Context

Before the proposed change we have to build and update documentation manually. As results Docs are quite outdated on our website: https://aihabitat.org/docs/. With current change documentation automatically will be updated with new commits in master powered by CircleCI.

  • Install latex, pelican, doxygen and other dependencies needed.
  • Setup securely ssh key for updating website repository.
  • Rebuild Habitat-SIM with wide options enabled for documentation update.
  • Build docs with Doxygen.
  • Build docs with Mcss documentation.
  • Update habitat-website master branch with changed parts of documentation.
  • Update habitat-website gh-pages branch (website update) with changed parts of documentation.
  • Apply master only branch filter.
  • Run build as separate CircleCI job.
  • Add links update for tutorials.

How Has This Been Tested

Run CI and check produced commits for website content.

A commit to master branch of habitat-website:
Screenshot 2019-12-13 00 37 28

A commit to gh-pages branch of habitat-website:
Screenshot 2019-12-13 00 57 49

Types of changes

  • Docs change / refactoring / dependency upgrade

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mathfac mathfac added this to the Better eng milestone Dec 13, 2019
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 13, 2019
cd ../..

# Update website
git clone git@github.com:facebookmicrosites/habitat-website.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actual publish step should be run only once the PR is merged into master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's for testing purposes. I added it as incomplete steps in the PR description.

@codecov-io
Copy link

codecov-io commented Dec 13, 2019

Codecov Report

Merging #379 into master will decrease coverage by 11.42%.
The diff coverage is 87.36%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #379       +/-   ##
===========================================
- Coverage   64.49%   53.06%   -11.43%     
===========================================
  Files          64      151       +87     
  Lines        2929     6479     +3550     
  Branches       84       84               
===========================================
+ Hits         1889     3438     +1549     
- Misses       1040     3041     +2001
Flag Coverage Δ
#CPP 45.83% <83.5%> (?)
#JavaScript 10% <90.62%> (ø) ⬆️
#Python 77.42% <100%> (-1.41%) ⬇️
Impacted Files Coverage Δ
src/esp/assets/MeshData.h 100% <ø> (ø)
src/esp/scene/SemanticScene.h 26.92% <ø> (ø)
src/esp/gfx/Simulator.h 100% <ø> (ø)
src/esp/nav/PathFinder.h 100% <ø> (ø)
src/esp/assets/MeshMetaData.h 100% <ø> (ø)
habitat_sim/nav/__init__.py 100% <ø> (ø) ⬆️
src/esp/assets/GenericInstanceMeshData.h 0% <ø> (ø)
src/esp/geo/geo.cpp 34.28% <0%> (ø)
src/esp/gfx/PTexMeshShader.cpp 0% <0%> (ø)
src/esp/physics/PhysicsManager.cpp 45.04% <0%> (ø)
... and 115 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae63bad...214c85a. Read the comment docs.

Copy link
Contributor

@apsdehal apsdehal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left general comments. Thanks for working on this.

rm -rf published/docs/${dir}
cp -r ../habitat-sim/build/docs-public/${dir} published/docs/.
done
git checkout published/docs/habitat-sim/index.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index.html will never be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be update only manually as we have hardcoded links to tutorials. cc @mosra if I understood incorrectly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, no, it shouldn't behave like that, at all. I wasn't aware of https://github.com/facebookmicrosites/habitat-website/commit/f16a3d1c932a8b9ed1f6f48ef99a9f269ce0a909 -- it's behaving correctly on my side, generating links as intended (testing with current master). I bet it's due to some unfortunate minor difference in docutils on the CI?

In any case, the following patch should make it work correctly, as it explicitly uses the :ref: role instead of relying on the overriden default role:

diff --git a/docs/pages/index.rst b/docs/pages/index.rst
index b2fe3e8..c1907aa 100644
--- a/docs/pages/index.rst
+++ b/docs/pages/index.rst
@@ -14,9 +14,9 @@ over 10,000 FPS multi-process on a single GPU!
 
 .. TODO: this is waiting on m.css to propagate page titles to links
 
--   `New Actions <std:doc:new-actions>`
--   `Notebooks <std:doc:notebooks>`
--   `Creating a stereo agent <std:doc:stereo-agent>`
+-   :ref:`New Actions <std:doc:new-actions>`
+-   :ref:`Notebooks <std:doc:notebooks>`
+-   :ref:`Creating a stereo agent <std:doc:stereo-agent>`
 
 .. note-warning::
 

@mathfac can you confirm the above makes it work correctly, without the git checkout needed?

.circleci/config.yml Outdated Show resolved Hide resolved
git commit -m "Build ${NOW}"
git status
git stash
git push origin master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to push both master/gh-pages together once all of the required copy/pasting is finished. If there is some issue in the below commands, master/gh-pages won't go out of sync.

.circleci/config.yml Outdated Show resolved Hide resolved
Copy link
Collaborator

@mosra mosra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

Apart from this one thing, I have basically the same comments as @apsdehal.

conda install -y -c conda-forge pelican
mkdir -p ../build/docs
git submodule update --init
doxygen
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since doxygen is run by the shell script below again, this isn't necessary, only makes the build longer.

@mathfac mathfac force-pushed the autodoc branch 5 times, most recently from 622a391 to d0f0a7d Compare January 17, 2020 11:54
- install_and_test_ubuntu
filters:
branches:
only: autodoc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
only: autodoc
only: master

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, planned to change to master, still need for testing.

rm -rf __pycache__
git add .
git commit -m "Build ${NOW}"
# git push origin gh-pages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# git push origin gh-pages
git push origin gh-pages

- run:
name: Update public documentation
command: |
# Update website
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts

To deal with the fingerprint issue.

Copy link
Contributor Author

@mathfac mathfac Jan 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the snipet! For know add checkout step at the beginning. It should take care of that and may be useful for other manipulation with docs.

@mathfac
Copy link
Contributor Author

mathfac commented Jan 19, 2020

Successful doc updated run.
Changed branch and git push, ready for merge.

@mathfac
Copy link
Contributor Author

mathfac commented Jan 20, 2020

The documentation update step succeeded on master branch. New "loadGibsonHouse" function is available in the public doc.
Now with every merge into master the public documentation will be updated automatically.

eundersander pushed a commit to eundersander/habitat-sim that referenced this pull request Aug 6, 2020
* Add support for eval on all episodes

* Add None correctly
Ram81 pushed a commit to Ram81/habitat-web-sim that referenced this pull request Dec 10, 2020
…e content (facebookresearch#379)

Before the proposed change we have to build and update documentation manually. As results Docs are quite outdated on our website: https://aihabitat.org/docs/. With current change documentation automatically will be updated with new commits in master powered by CircleCI.

 Install latex, pelican, doxygen and other dependencies needed.
 Setup securely ssh key for updating website repository.
 Rebuild Habitat-SIM with wide options enabled for documentation update.
 Build docs with Doxygen.
 Build docs with Mcss documentation.
 Update habitat-website master branch with changed parts of documentation.
 Update habitat-website gh-pages branch (website update) with changed parts of documentation.
 Apply master only branch filter.
 Run build as separate CircleCI job.
 Add links update for tutorials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants