-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[WIP] Add GitLab CI workflow for incremental HTML build #11595
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
base: master
Are you sure you want to change the base?
Conversation
Yes, I'll do it (see below). Since I encountered some issues when I followed the tutorial, I'll write them here:
Now, about the new “GitLab Pages (incremental build)” section.
Here is a working stages:
- deploy
pages:
cache:
paths:
- docs/build
stage: deploy
# image: sphinxdoc/sphinx
image: mgasphinx/sphinx-html
before_script:
- apt-get update
- apt-get install --no-install-recommends -y make git-restore-mtime
- pip3 install --upgrade pip
- pip3 install --upgrade furo
script:
- git restore-mtime
- cd docs && sphinx-build source build/html -j auto -vv
after_script:
- cp -r docs/build/html/ ./public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH |
|
Thank you for your feedback. @AA-Turner Do you have some ideas why our official docker image may not work for this case but another one (which only seems to remove |
IMHO, this doesn't close this issue which is about “Document how sphinx's change detection works” since, AFAICS, this remains unclear. |
|
Ah, actually the issue should be renamed to something like "make gitlab CI workflow incremental" (since it was your main concern eventually) Concerning the way changes are detected, it's probably another task that should get its own issue imo. |
Agreed, but the current fix for this issue is pretty weak: changing the Docker image embedding |
|
Sorry for the late reply.
|
You're welcome!
You asked @AA-Turner:
Are there some progress on this subject?
Indeed. BTW, why relying on date rather than on
Right! 😄
Okay.
No pressure! 😉 |
Because there are projects with 70k+ RST files and even maybe even more HTML files. The speed for computing md5 also depends on the size of your file. So this would slow the whole process a lot. The date approach is faster (but a bit tricky to implement as we see). |
|
Just FYI, I also wrote a workflow for incremental HTML build (but for GitHub), it is based on Besides, not only the timestamp of rst files need to be restored, timestamp of HTML themes files need to be restored too: https://github.com/sphinx-notes/pages/blob/1ef210dab7429dfcbdb06346d279b746573d147a/main.sh#L64 |
|
@SilverRainZ Thank you for what you linked. Do you think it's possible for you to take over my PR and use your approach since it appears to work? |
|
I am glad to help with this. But still have some questions:
|
|
By compatibility guarantee, do you mean in terms of OS, sphinx versions, VMs, servers etc? Also, I think what users want in priority is a working script they can just use if they use gitlab (but we should probably tell them which gitlab version is supported; if possible I want it to be version-agnostic). As for documenting, it should be a separate task. As I said, people don't bother about how it works until it fails. The issue is titled "document" but I think it should be more "make it work". Don't worry about the time because, while it's a reasonable feature, I don't know whether there are many people asking for it. I picked it up at that time since I had some time but I wouldn't tell you to lose time if you don't have much. Now, IIRC the main issue was with the docker image. I still don't know whether the official image is synced or not and I don't know whether Adam is willing to use an external one actually. And if we choose one image we should stick to it I guess. Note that I am no expert in container and the likes so I don't really know why pur image fails. Finally, you could indicate in the workflow "hey put some additional command here if you want to specify your own requirements" (in my example the furo module was missing because I assumed that the docs being built have no deps). |
@picnixz Feel free to retitle it 😃 |
I mean the compatibility of code implementation of "Sphinx's change detection", once it is changed, the related workflows will break.
I get it. How about writing a small Python script to do this instead of writing shell script in
|
|
Just FYI, I will try to work on this next week :D |
|
Ah thank you. Don't worry about deadlines because as I said, I'm only passing by today. I'll be back to business in 2 weeks or so. |
Closes #11556.
@dbitouze could you check whether the workflow works in production using some fresh project (I don't have any way to test it now).