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

CI fails when making the CNAME file #1154

Closed
woutdenolf opened this issue Jun 30, 2022 · 21 comments · Fixed by #1158 or #1159
Closed

CI fails when making the CNAME file #1154

woutdenolf opened this issue Jun 30, 2022 · 21 comments · Fixed by #1158 or #1159
Assignees
Labels
workflows Continuous integration and deployment
Milestone

Comments

@woutdenolf
Copy link
Contributor

https://github.com/nexusformat/definitions/runs/7137146695?check_suite_focus=true

@woutdenolf
Copy link
Contributor Author

woutdenolf commented Jun 30, 2022

@prjemian Is CI still not building the documentation as it is done locally?

@prjemian
Copy link
Contributor

In my local build (make local):

(bluesky_2022_3) prjemian@zap:~/.../NeXus/definitions$ ls ./build/manual/build/html/CNAME
./build/manual/build/html/CNAME

@prjemian
Copy link
Contributor

That was for the dev_tools branch., Checking with main branch now.

@prjemian
Copy link
Contributor

On main branch, with make local:

(bluesky_2022_3) prjemian@zap:~/.../NeXus/definitions$ ls ./build/manual/build/html/CNAME
ls: cannot access './build/manual/build/html/CNAME': No such file or directory

@prjemian
Copy link
Contributor

The CNAME is created

- name: Add CNAME to set custom domain
run: |
echo manual.nexusformat.org > ./build/manual/build/html/CNAME

and then the build/manual/build directory is re-written by

- name: Build (html) and Commit
uses: sphinx-notes/pages@master
with:
# path to conf.py directory
documentation_path: build/manual/source

This second step deletes the CNAME file, correct?

@prjemian
Copy link
Contributor

Also note the default branch of sphinx-notes/pages Actions is v2.

@woutdenolf
Copy link
Contributor Author

I think we should add a job that builds the html, copies the CNAME file to the resulting folder and then Build (html) and Commit . The last one build the html again I guess but should start from the already existing build.

@woutdenolf woutdenolf self-assigned this Jun 30, 2022
@prjemian
Copy link
Contributor

Right. Our publishing steps might be too complicated for sphinx-notes/pages.

@woutdenolf
Copy link
Contributor Author

woutdenolf commented Jun 30, 2022

Yes, so the point is that CNAME needs to be added to the result of an HTML build. In other words it needs to be copied afterward the sphinx HTML build.

@woutdenolf
Copy link
Contributor Author

I have two potential fixes: #1158 and #1157

@woutdenolf
Copy link
Contributor Author

Of course we need to run the publishing CI to check which one works. I propose to merge #1158 first and wait for CI.

@prjemian
Copy link
Contributor

Either that or suspend the rules, temporarily. This time, merge.

@woutdenolf
Copy link
Contributor Author

Ok so #1158 doesn't work, probably because sphinx-notes/pages is not building in the normal directory. I see this

The HTML pages are in ../../../../../tmp/pages-gVzbCR6Kc2.

But I'm not sure the build is actually done in there are the build is just copied there.

@woutdenolf woutdenolf reopened this Jun 30, 2022
@prjemian
Copy link
Contributor

After sphinx-notes/pages runs its part, which branch is the CI process now? If it has switched to gh-pages this step could be easier.

@woutdenolf
Copy link
Contributor Author

Maybe https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path is also an option. I'll investigate ...

@prjemian
Copy link
Contributor

From the workflow log, steps 198-201

Setting up git repository
  Setting up git configure
  No local changes to save
  Setting up branch gh-pages
  Branch exists, checkout to it
  Switched to a new branch 'gh-pages'
  branch 'gh-pages' set up to track 'origin/gh-pages'.
  Removing build/
  Removing utils/
 Committing HTML documentation
  Deleting all file in repository
  removed 'CNAME'

@prjemian
Copy link
Contributor

From raw logs:

2022-06-30T19:11:10.8519755Z removed 'utilities.html'
2022-06-30T19:11:10.8519991Z removed 'validation.html'
2022-06-30T19:11:10.8520229Z Copying HTML documentation to repository
2022-06-30T19:11:10.8520826Z '/tmp/pages-oW788h6erK/./.doctrees/applying-nexus.doctree' -> '././.doctrees/applying-nexus.doctree'
2022-06-30T19:11:10.8521367Z '/tmp/pages-oW788h6erK/./.doctrees/authorgroup.doctree' -> '././.doctrees/authorgroup.doctree'

...

2022-06-30T19:11:10.9211990Z '/tmp/pages-oW788h6erK/./_static/sphinxdoc.css' -> '././_static/sphinxdoc.css'
2022-06-30T19:11:10.9212227Z '/tmp/pages-oW788h6erK/./_static/navigation.png' -> '././_static/navigation.png'
2022-06-30T19:11:10.9212484Z '/tmp/pages-oW788h6erK/./_static/nxdl_vocabulary.html' -> '././_static/nxdl_vocabulary.html'
2022-06-30T19:11:10.9212830Z '/tmp/pages-oW788h6erK/./_static/NeXusIntern.pdf' -> '././_static/NeXusIntern.pdf'
2022-06-30T19:11:10.9213087Z '/tmp/pages-oW788h6erK/./_static/nxdl_vocabulary.yml' -> '././_static/nxdl_vocabulary.yml'

So instead of

echo manual.nexusformat.org > ./build/manual/build/html/CNAME

then perhaps this will work:

echo manual.nexusformat.org > ./CNAME

@woutdenolf
Copy link
Contributor Author

html_extra_path works locally (PR #1159) so hopefully CI will like it as well.

@prjemian
Copy link
Contributor

I see this line in the raw workflow logs:

2022-06-30T19:38:14.3785167Z '/tmp/pages-baY42JJDDi/./CNAME' -> '././CNAME'

@woutdenolf
Copy link
Contributor Author

@woutdenolf
Copy link
Contributor Author

I will do the same on the dev_tools branch.

@prjemian prjemian added the workflows Continuous integration and deployment label Jun 30, 2022
@prjemian prjemian added this to the NXDL 2022.06 milestone Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment