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

automatically deploy development docs #386

Closed
5 tasks done
orbeckst opened this issue Aug 7, 2015 · 6 comments
Closed
5 tasks done

automatically deploy development docs #386

orbeckst opened this issue Aug 7, 2015 · 6 comments

Comments

@orbeckst
Copy link
Member

orbeckst commented Aug 7, 2015

Following Automatically Update Github Pages with Travis Example seems straighforward enough in order to have travis-ci build the sphinx docs and then push them to the gh-pages branch. (See also the discussion at the bottom of #350.)

Potential solutions

Progress so far

  • generated OAUTH token (limit scope to public_repo access; I used the tokens web interface but can also be done via curl as described in the awestruct gh deployment notes). DONE

  • encrypt for travis with the travis client:

    gem2.0 install travis
    travis encrypt GH_TOKEN=`cat ./github_OAUTH_token`
    

    yields the entry for the .travis.yml file:

     secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY="
    

    (This is encrypted with the travis public key. For more details, see Travis CI: Encryption keys.)

  • add lines to .travis.yml along the lines of

    script:
      - ./testsuite/MDAnalysisTests/mda_nosetests -v --with-coverage --cover-package MDAnalysis --processes=2 --process-timeout=120 --with-memleak
      - coveralls
      - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && cd package/doc/sphinx && make clean html
    
    after_success:
      - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && bash maintainer/deploy.sh
    
    env:
       global:
          secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY="

    (We want to build the developer docs when we push an update to the developer branch.)

    I don't know if an error during doc building will then also signal a failure of a build. Perhaps doc building should be put in a sub shell (e.g., - (cd package/doc/sphinx && make html); true) and always return success?

  • Write a maintainer/deploy.sh script (or rake or whatever):

  • test on a feature branch without screwing up our repo...

@orbeckst orbeckst added this to the 0.12 milestone Aug 7, 2015
orbeckst added a commit that referenced this issue Sep 11, 2015
- build and deploy development docs from Travis-CI
- see #386 for details
- closes Issue #386

NOTE: The development docs are now visible at http://www.mdanalysis.org/mdanalysis/
      (so various URLs and forwarding for devdocs.mdanalysis.org need to be
      changed)
@orbeckst orbeckst self-assigned this Sep 11, 2015
orbeckst added a commit that referenced this issue Sep 12, 2015
- build and deploy development docs from Travis-CI
- see #386 for details
- closes Issue #386

NOTE: The development docs are now visible at http://www.mdanalysis.org/mdanalysis/
      (so various URLs and forwarding for devdocs.mdanalysis.org need to be
      changed)
@richardjgowers
Copy link
Member

Looks like it didn't work?

https://travis-ci.org/MDAnalysis/mdanalysis/builds/79970890

/home/travis/build/MDAnalysis/mdanalysis/package/MDAnalysis/lib/transformations.py:1811: UserWarning: failed to import module _transformations

  warnings.warn("failed to import module " + module_name)

Exception occurred:

  File "/home/travis/build/MDAnalysis/mdanalysis/package/MDAnalysis/lib/distances.py", line 40, in <module>

    from ._distances import (calc_distance_array,

ImportError: No module named _distances

The full traceback has been saved in /tmp/sphinx-err-5NdJCZ.log, if you want to report the issue to the developers.

Please also report this if it was a user error, so that a better error message can be provided next time.

A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

make: *** [html] Error 1

It looks like sphinx isn't seeing the Cython modules?

@kain88-de
Copy link
Member

They are not installed locally in the package folder. You have to build them with

Python setup.py build_ext --inplace 

Then the shared object files will be where Sphinx and the Python interpreter can pick them up

orbeckst added a commit that referenced this issue Sep 12, 2015
As suggested by @kain88-de in #386, we let travis also build the libraries in place
(with "python setup.py build_ext --inplace") so that sphinx can properly import
the local build of MDAnalysis.

Manually tested but needs to be run on travis on the develop branch to check
that it performs as it should.
@orbeckst
Copy link
Member Author

I just pushed 80bc2a2 (directly to develop), which includes @kain88-de 's fix. It means that we're rebuilding the library a second time but that's hopefully not too bad. However, just failed with:

$ test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && bash ./maintainer/deploy_docs.sh

bash: ./maintainer/deploy_docs.sh: No such file or directory

I guess this means that the cd hopping is remembered, i.e. each travis.yml line is not executed in a sub shell. Will fix... but feel free to make this more robust when you look at it. (Sorry for cluttering the history...)

A bit more annoying is that as soon as we're running multiple CI workers, each one will deploy the docs as well. Maybe there's a way to mark one worker as special or perhaps Travis sets some environment variables that we could use?

@richardjgowers
Copy link
Member

57eebe1#diff-354f30a63fb0907d4ad57269548329e3R27

WRT the last point, once we're running multiple jobs, we can nominate one as the "master" one that does the doc push (if TRAVIS_PYTHON == 2.7: push docs)

@orbeckst
Copy link
Member Author

For multiple jobs, I found a solution at steveklabnik/automatically_update_github_pages_with_travis_example#5

I am currently trying out things on the test-docdeploy branch.

orbeckst added a commit that referenced this issue Sep 12, 2015
- As suggested by @kain88-de in #386, we let travis also build the libraries in place
  (with "python setup.py build_ext --inplace") so that sphinx can properly import
  the local build of MDAnalysis.
- use subshells when using cd (should avoid not finding the deploy script)
  and should make the travis process more robust
- only run doc deployment if we are the first job in the build matrix (from
  @bguiz , see steveklabnik/automatically_update_github_pages_with_travis_example#5)
- configure almost everything through env vars in .travis.yml
@kain88-de
Copy link
Member

When the module are already build my fix will just cause a copy to the right place and not a full rebuild.

orbeckst added a commit to MDAnalysis/GridDataFormats that referenced this issue Sep 13, 2015
- GridDataFormat docs are available in RTD and from mdanalysis.org; although the latter
  are thus not strictly necessary, I still like to have "our" version of the docs around.
  After MDAnalysis/mdanalysis#386 I implemented Travis-CI based doc deployment.
- Uses same OAuth token (for orbeckst) as MDAnalysis
- added new ci directory with ci/deploy_docs.sh script
- added sphinx conf.py so that the checked out repository (../../) is at the head of the
  sys.path in order to guarantee that the current module is used for sphinx
orbeckst added a commit to MDAnalysis/GridDataFormats that referenced this issue Sep 13, 2015
- GridDataFormat docs are available in RTD and from mdanalysis.org; although the latter
  are thus not strictly necessary, I still like to have "our" version of the docs around.
  After MDAnalysis/mdanalysis#386 I implemented Travis-CI based doc deployment.
- Uses same OAuth token (for orbeckst) as MDAnalysis but needed to
  generate secure GH_TOKEN for MDAnalysis/GridDataFormats repository
- added new ci directory with ci/deploy_docs.sh script
- added sphinx conf.py so that the checked out repository (../../) is at the head of the
  sys.path in order to guarantee that the current module is used for sphinx
- build docs from the master branch
orbeckst added a commit to MDAnalysis/GridDataFormats that referenced this issue Sep 13, 2015
automatically deploy docs from travis

- Docs are built in the first travis-ci job and pushed to gh-pages. 
- Docs appear now at http://www.mdanalysis.org/GridDataFormats/.
- Implementation follows MDAnalysis/mdanalysis#386 but see commit messages for details.
- Functionality was tested successfully with `GH_DOC_BRANCH=ci-deploydocs` (but this won't work anymore on the ci-deploydocs branch because I rewrote the history which includes the final `GH_DOC_BRANCH=master` so that docs are built from master only)
orbeckst added a commit to Becksteinlab/GromacsWrapper that referenced this issue Nov 30, 2015
- closes issue #24
- release docs are hosted on RTD at http://gromacswrapper.readthedocs.org/en/latest/
- once we get testing on Travis working (#23) then we can also build develop docs
  automatically as described under MDAnalysis/mdanalysis#386
lohani2280 pushed a commit to lohani2280/mdanalysis that referenced this issue Feb 17, 2017
…elines to own page and removed anything on manually building developer docs (see MDAnalysis#386 for the new procedure)
orbeckst added a commit that referenced this issue May 9, 2017
- fixes #1337
- new token was generated because the old token was exposed due to a security
  incident at Travis CI, see  https://blog.travis-ci.com/2017-05-08-security-advisory
- followed #386 for generating new token and encrypting for Travis CI
orbeckst added a commit that referenced this issue May 9, 2017
- fixes #1337
- new token was generated because the old token was exposed due to a security
  incident at Travis CI, see  https://blog.travis-ci.com/2017-05-08-security-advisory
- followed #386 for generating new token and encrypting for Travis CI
kain88-de pushed a commit that referenced this issue May 9, 2017
- fixes #1337
- new token was generated because the old token was exposed due to a security
  incident at Travis CI, see  https://blog.travis-ci.com/2017-05-08-security-advisory
- followed #386 for generating new token and encrypting for Travis CI
orbeckst added a commit to MDAnalysis/pmda that referenced this issue Oct 12, 2017
- added encrypted GH_TOKEN for doc deployment to gh_pages
- added ci/deploy_docs.sh (from MDAnalysis/MDAnalysisTutorial)
- added Doc task for travis (copied from MDAnalysis/mdanalysis
  .travis.yml, see also MDAnalysis/mdanalysis#386 )
  - build the docs with `python setup.py build_sphinx`
  - use build/sphinx/html as doc dir
  - push to gh_pages
- manually pushed the first time to create gh_pages branch
  which is visible at https://www.mdanalysis.org/pmda/
- updated .gitignore
orbeckst added a commit to MDAnalysis/pmda that referenced this issue Oct 12, 2017
- added encrypted GH_TOKEN for doc deployment to gh_pages
- added ci/deploy_docs.sh (from MDAnalysis/MDAnalysisTutorial)
- added Doc task for travis (copied from MDAnalysis/mdanalysis
  .travis.yml, see also MDAnalysis/mdanalysis#386 )
  - build the docs with `python setup.py build_sphinx`
  - use build/sphinx/html as doc dir
  - push to gh_pages
- manually pushed the first time to create gh_pages branch
  which is visible at https://www.mdanalysis.org/pmda/
- updated .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants