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

Sphinx v5 and migration from Netlify #3509

Open
JimMadge opened this issue Jan 29, 2024 · 12 comments · May be fixed by #3512 or #3535
Open

Sphinx v5 and migration from Netlify #3509

JimMadge opened this issue Jan 29, 2024 · 12 comments · May be fixed by #3512 or #3535
Labels
infrastructure For all issues related to book infrastructure

Comments

@JimMadge
Copy link
Member

JimMadge commented Jan 29, 2024

Related to #2481

See #3495 #3496 #3513.

The build process was broken both in CI and on Netlify due to an unpinned package.
Attempting to fix this by pinning all packages for the build and upgrading caused trouble as CI used Python3.10 where as Netlify runners can only use Python3.8.

This was fixed by pinning all versions for Python3.8 in #3496.

Python3.8 is almost EOL, only receiving security updates.
It would be good to move to a more recent Python version, and Python3.8 prevents us from using the latest jupyter-book.
This would, however, require a workaround for the Netlify deployment or migration to another host.

Platform options table

Platform Migration burden Financial model Open source DP terms okay? Notes Decision (Y/N)
Netlify None (current platform) Paid service with free tier N Build previews in PRs, limited build minutes, limited concurrent builds, SSL, custom domains, DNS, only Python 3.8
Read The Docs Small (working build Free for OS (with ethical adds), optional support tier at $5 p/m Y Build previews in PRs, limited build minutes, limited concurrent builds, SSL, custom domains, DNS, modern Python, Ad free option, Documentation versioning, page and search analytics, PDF and EPUB export
Web/Self hosting Significant (multiple hosting options, extra infrastructure work) Paid services (and more "people cost") Could aim to use more OS components Would have to implement previews, Could deploy from GitHub CI, Need to manage SSL ourselves, greater flexibility
GH Pages Small Free for OS, and we already rely on GitHub N We have full control over the build (unlike with RTD or Netlifty). We already rely on github so this doesn't add any more service dependencies to our stack. And deploying to GH pages is done by a large number of jupyterbook repos
Cloud storage (e.g. AWS Bucket)
Abstract static site cloud service
Cloud container service + (for example) NGINX container

Needs analysis

Need How it currently works with Netlify How RTD would change this How GH pages would change this Recommendation
Using/supporting open infrastructure across TTW project/community (tied to #2811) Netlify is currently closed source RTD is an open source, community-lead project We are already dependent on GitHub, and a lot of projects deploy to GH Pages, e.g. we can share the infrastructure setup with other players in the field ✅ Move
Keeping up to date with Python and dependencies (#3495, #3513) Netlify can only use Python 3.8. This prevents us using stable JupyterBook/Sphinx and leaves a DOS vulnerability in the dependencies RTD supports more modern Python (3.12) see #3535 Full control over versions without any third-party plugins being forced into the stack (unlike with RTD) ✅ Move
Supporting existing translation infrastructure Not sure
@JimMadge JimMadge added the infrastructure For all issues related to book infrastructure label Jan 29, 2024
@JimMadge JimMadge linked a pull request Jan 30, 2024 that will close this issue
4 tasks
@JimMadge JimMadge linked a pull request Feb 20, 2024 that will close this issue
3 tasks
@aleesteele aleesteele changed the title Sphinx v5 and migration from Netlify Sphinx v5 and migration from Netlify to Read the Docs Feb 21, 2024
@aleesteele
Copy link
Member

aleesteele commented Feb 21, 2024

Hi @JimMadge! Back here to expand here on the discussion with @da5nsy and @KirstieJane!

For #3213 - we documented this need to shift to a Github organisation according to the needs of working groups, in this table format here:

Team and/or Person Need
All WGs While having administrative rights to a Github repository are allowed for non-Alan Turing Institute accounts, having our own Github organisation makes it possible for volunteers & folks not associated with the Turing to create teams.
Infrastructure Maintainers WG Easier to make Github team for Infra Maintainers group, so maintainers can be easily tagged collectively on a Github issue related to infra

In the context of this shift to RTD, I am drawing from an emerging 'platform audit form', which has been previously been used to evaluate Newsletter platforms and Event organising platforms. This template could be used more broadly if research is needed to switch platforms:

Platform Link Can import data from different platform Freemium Open Source DP terms okay? Notes Decision (Y/N)

I suggest the following format since we have decided to move to RTD – though please feel free to remix & shift around if it does not meet your needs.

Need How it currently works with Netlify How RTD would change this Recommendation
Using/supporting open infrastructure across TTW project/community (tied to #2811) Netlify is currently closed source RTD is an open source, community-lead project ✅ Move to RTD!
Supporting existing translation infrastructure Not sure

@the-turing-way/infrastructure-working-group - I think this could be something we build together for a more standardised 'platform/infrastructure evaluation' system more broadly for the community. What do you think?

@JimMadge JimMadge changed the title Sphinx v5 and migration from Netlify to Read the Docs Sphinx v5 and migration from Netlify Feb 22, 2024
@JimMadge
Copy link
Member Author

Thanks @aleesteele 🙏 🚀.

I feel I should say, I don't think we have decided on moving to RTD. In particular, I think we want to look at if support for translations is improved/worsened on RTD compared to Netlify. Although, I do think RTD is a sensible choice, the most natural, and the easiest.

I will add those tables (probably with some adjustments) to the top level comment.

I like that the tables summarise the considerations and decision process in an open way. That feels very important to get right. A while ago we did talk a lot about how one of the key roles of an infrastructure WG/maintainer would be to recommend when to change infrastructure.

I would worry that to strict a system might add unnecessary bureaucracy. Would putting the table templates in the community handbook and encouraging their use in an open place is a good balance?

@JimMadge
Copy link
Member Author

A few notes about RTD deployment,

  • Must call Sphinx, which means you run a pre-build command to write a Sphinx conf.py to file
  • RTD has it's own stack.
    This is more up to date than Netlify, but presents potentially the same problems where we aren't in total control of the build
  • RTD brings it's own dependencies and plugins

@bsipocz
Copy link
Member

bsipocz commented Apr 11, 2024

I've added notes about GH-pages to the opening comment. My strong preference would be to move to that rather than buy into yet another third party service that brings their own plugins and alike like RTD.

In all my other jupyterbook-based projects a tox.ini file is being used to control the build and it works beautifully the same way whether someone builds/tests locally, in a PR or in the deployment. While, in practice, reproducing issues someone run into on RTD can be rather painful and cryptic.

@sgibson91
Copy link
Member

sgibson91 commented Apr 11, 2024

My only comment against GitHub Pages is that it doesn't provide deploy previews like Netlify and RTD do, and a lot of this community depend on that specific feature for review.

@bsipocz
Copy link
Member

bsipocz commented Apr 11, 2024

We do that preview through circleCI using the very same config files. In practice, this setup is way less painful than dealing with the mysteries of RTD failures.

@bsipocz
Copy link
Member

bsipocz commented Apr 11, 2024

(that kind of goes against my argument of adding another 3rd party dependency, but even with that bit of complexity we address most of the issues Jim mentions above vs RTD)

@JimMadge
Copy link
Member Author

Great point about previews. I think whatever we do, we need some way to provide people with previews and to automate a comment linking to the preview in PRs.

In the same way as we can see CI as removing the burden on contributors to run tests/linting previews remove the need to build the book locally to see what it will look like.

@bsipocz
Copy link
Member

bsipocz commented Apr 15, 2024

Having a preview is certainly a must, no question about that. But I would also want to keep it easy to build stuff locally, and have it the same as what happens in CI (super useful to hunt down various issues). And this is exactly the case where RTD is lacking with its custom but not exactly well documented dependency.

@sgibson91
Copy link
Member

As well as deploy previews, we will also need the ability to host the different language versions at either fr.book.the-turing-way.org or book.the-turing-way.org/fr (or something else, I have no strong opinion), as an example. Is this a possibility too in the implementation you're suggesting? Would we have to build our own "language selector" or wait until one is available upstream in Jupyter Book?

I totally get and agree with everything that @bsipocz is saying, but I'm also worried that atm you're the bottleneck to implementing this. So I think we need a plan to upskill the rest of the WG so we can spread the load of implementation and maintenance of it. And I think that's why we've leaned towards RTD in discussions so far, because at least both Jim and I have experience, even if it's a troublesome tech stack.

@JimMadge
Copy link
Member Author

I totally get and agree with everything that @bsipocz is saying

Agreed. I think I'm trying to be pragmatic. The abstraction of RTD and difficultly making local/CI/RTD builds identical bothers me. I think the stuff we get for free with RTD (previous versions, deploy previews, language support) is swaying me to that side though.

I'm not sure if we have had (or need) some time to go over all the options together though. To make sure we all consider the options properly and know why we make the final decision we come to.

@sgibson91
Copy link
Member

@JimMadge definitely feels like something for the next meeting's agenda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure For all issues related to book infrastructure
Projects
Status: Issues (in progress)
4 participants