-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add k8s container #295
Add k8s container #295
Conversation
Thanks much for all the hard work on this @maeve-fpf. I was able to confirm that:
Differences of note:
IMO neither of these are blocking issues for this PR though, and we can investigate this further in follow-up. I'd appreciate a second pair of eyes from a maintainer before we merge (no need to repeat every single of the above checks though). One small thing: I'd suggest squashing the commits down a bit before merging. |
990c6b0
to
1a0519c
Compare
I've added a commit here, branched off of |
4c72f29
to
8d5b6e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following @eloquence's review, I've reviewed the diff and taken staging-docs.securedrop.org
for a spin, testing especially:
- the documentation is built correctly in two versions,
stable
andlatest
- these versions correspond to the most recently tagged version and to the
HEAD
ofmain
(respectively) - the URL paths correspond to the current documentation, i.e. no existing external links should break
- the PDF is generated (with errors as noted in the code comment) and corresponds mostly to the current PDF (see below)
- the version selector widget works as expected
Inline I've requested (slash offered to make :-) one change in the underlying ReST source in this repository specifically (not a functional change to this implementation).
Table of contents should now be working. |
Approved!—but I'll defer to you, @maeve-fpf and @eloquence, for merge, in light of any operational considerations I'm not in the loop on. |
ad49ef8
to
0850bb5
Compare
0850bb5
to
cf10ad3
Compare
Thanks @cfm, I've picked up that commit! Ready to merge now - noting here that for staging CI purposes, we are still building the "stable" docs off off this backported branch: 2.1.0-2...stable-plus-k8s-container - tagging that commit as something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving and merging based on @cfm's and my prior review.
Status
Ready for review
Description of Changes
This adds a container which runs Sphinx during the build, and serves the output with nginx. We will deploy this container in GKE to self-host the documentation and move off of RTD.
HTML output is relatively straightforward. There is an RTD-like theme in Sphinx. In order to get the functionality RTD gives us of a version switching widget, I added a small bit of template based on what RTD's JavaScript adds to the document. It's not as full-featured as RTD but it does show you if you're on
latest
orstable
and lets you download the PDF.PDF output required some wrangling: non-latin characters must be defined as LaTeX, and SVG inclusion does not work (it did not work on RTD either, however). In going through characters used in the source, I only fixed incorrectly encoded quotation marks, and did not try to make all the triangles used to denote submenu items consistent (there are U+25B6 ▶, U+25B8 ▸, and U+003E >).
Testing
The output is deployed at https://staging-docs.securedrop.org/ (publicly accessible). To run locally,
docker build -f deploy/Dockerfile .
; and run withdocker run <imageid> -p 127.0.0.1:5080:5080
, then navigate to http://localhost:5080/. Because the container will be deployed behind another Nginx setup, it is set to omit port numbers from redirects, so you may have to add them back in.The main redirect is from
/
to/en/stable/
, to match the current behavior of RTD (as there is no localization the output is currently just copied to this directory to get the correct path). There are also redirects from the current RTD PDF URLs,/_/downloads/en/stable/pdf/
(andlatest
), to the actual PDF files.To verify that the content is different between stable and latest, you can check the "Set Up the Network Firewall" page - in latest, it has been split out into pfSense and OPNSense.
Release
Currently, k8s CI is set up to deploy a test branch to staging. Once this is merged, I can adjust that to run on pushes to
main
here.Checklist (Optional)
make docs-lint
) passed locally - the container build does not run this, but we could add failing on that if desired.make docs-linkcheck
) passed - No, I'm currently getting a 500 from Gitter. Maybe an actual outage on their end?make docs
) docs at http://localhost:8000 - still works, although the version switcher/PDF link will be useless. There is no containerized live preview.