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

Monodocs sphinx build #4347

Merged
merged 51 commits into from
Dec 6, 2023
Merged

Monodocs sphinx build #4347

merged 51 commits into from
Dec 6, 2023

Conversation

cosmicBboy
Copy link
Contributor

Tracking issue

Closes #4329

Describe your changes

This PR adds a custom sphinx build system that imports flytekit, flytesnacks, flytectl, and flyteidl documentation and builds the flyte docs as a single docs site. It introduces the following:

  • An auto_examples.py sphinx extension to convert flytesnacks examples into myst markdown. This extension also adds convenience directives to render toctree and table of contents in the flytesnacks examples.
  • An import_projects.py sphinx extension that handles cloning, generating, and rendering docs from imported projects, either from git or from local (e.g. flyteidl)

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
@cosmicBboy cosmicBboy changed the title Monodocs Monodocs sphinx build Nov 1, 2023
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see this done in two stages, which can help with reviewing.

  1. Move flyteidl's docs into this repo. I think this is a majority of this PR.
  2. Move the rest, which I suspect will be a smaller follow up PR.

For step 2, moving flytectl and flytekit looks okay to me. I'm concerned over flytesnacks, because of how many dependencies it adds to building the docs.

doc-requirements.in Outdated Show resolved Hide resolved
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
@pingsutw
Copy link
Member

Shoutout to @cosmicBboy. I really like the new doc. Thanks for your tremendous work.

image

Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c049865) 58.89% compared to head (44e6728) 58.90%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4347      +/-   ##
==========================================
+ Coverage   58.89%   58.90%   +0.01%     
==========================================
  Files         620      620              
  Lines       52440    52458      +18     
==========================================
+ Hits        30883    30900      +17     
- Misses      19090    19091       +1     
  Partials     2467     2467              
Flag Coverage Δ
unittests 58.90% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Niels Bantilan <[email protected]>
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Dec 1, 2023
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, comparing master's build with this PR's build, the build time went from 100 seconds on master to 448 seconds on this PR. I think that is okay.

docs/.readthedocs.yaml Outdated Show resolved Hide resolved
common-requirements.in Outdated Show resolved Hide resolved
@@ -16,4 +16,4 @@ sphinx:
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: doc-requirements.txt
- requirements: doc-requirements.in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using the pinned version .txt is safer for doc builds. Otherwise, we can have PRs that break from unrelated issues.

Copy link
Contributor Author

@cosmicBboy cosmicBboy Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently this does not work, as pip-compile will add tensorflow-macos to the doc-requirements.txt file when I run it locally, which will not work on readthedocs build.

planning on using conda here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, I do not see tensorflow-macos in doc-requirements.txt. Is this change still required?

planning on using conda here

Yes, Conda-lock will resolve this because it can lock a linux environment from a macos environment.

In any case, I am okay with merging this as is and fixing it later if doc builds become flaky.

docs/.readthedocs.yaml Show resolved Hide resolved
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the merge commits are not signed.

Otherwise, I am okay with the current PR. We can always adjust with follow up PRs.

channels: conda-forge
channel-priority: true
activate-environment: monodocs-env
environment-file: monodocs-environment.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a follow up, I prefer to lock this environment as well. conda-incubator/setup-miniconda supports lock files: https://github.com/conda-incubator/setup-miniconda#example-7-lockfiles

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna followup on this with a PR

with:
python-version: "3.8"
- name: Install dependencies
python-version: 3.9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The python version is already in monodocs-environment.yaml. Including it here will "override" the version in the environment yaml, so I think it's better to leave it out here:

Suggested change
python-version: 3.9

@@ -16,4 +16,4 @@ sphinx:
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: doc-requirements.txt
- requirements: doc-requirements.in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, I do not see tensorflow-macos in doc-requirements.txt. Is this change still required?

planning on using conda here

Yes, Conda-lock will resolve this because it can lock a linux environment from a macos environment.

In any case, I am okay with merging this as is and fixing it later if doc builds become flaky.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 6, 2023
Copy link
Contributor

@samhita-alla samhita-alla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! let's merge the PR. 🚀

@cosmicBboy cosmicBboy enabled auto-merge (squash) December 6, 2023 15:10
@cosmicBboy cosmicBboy merged commit aff1150 into master Dec 6, 2023
40 of 41 checks passed
@cosmicBboy cosmicBboy deleted the monodocs branch December 6, 2023 15:26
pvditt pushed a commit that referenced this pull request Dec 13, 2023
* rename rsts to docs

Signed-off-by: Niels Bantilan <[email protected]>

* update docs reqs

Signed-off-by: Niels Bantilan <[email protected]>

* update reqs, styles

Signed-off-by: Niels Bantilan <[email protected]>

* update doc requirements

Signed-off-by: Niels Bantilan <[email protected]>

* edit gitignore

Signed-off-by: Niels Bantilan <[email protected]>

* update doc requirement

Signed-off-by: Niels Bantilan <[email protected]>

* update doc requirements

Signed-off-by: Niels Bantilan <[email protected]>

* update doc requirements

Signed-off-by: Niels Bantilan <[email protected]>

* minor clean up

Signed-off-by: Niels Bantilan <[email protected]>

* update deps

Signed-off-by: Niels Bantilan <[email protected]>

* use doc-requirements.in in .readthedocs.yml

Signed-off-by: Niels Bantilan <[email protected]>

* updates

Signed-off-by: Niels Bantilan <[email protected]>

* check in new docs

Signed-off-by: Niels Bantilan <[email protected]>

* clean up most reference warnings

Signed-off-by: Niels Bantilan <[email protected]>

* fix ref links

Signed-off-by: Niels Bantilan <[email protected]>

* update auto examples

Signed-off-by: Niels Bantilan <[email protected]>

* add logic to find/replace invalid links

Signed-off-by: Niels Bantilan <[email protected]>

* update docs with changes

Signed-off-by: Niels Bantilan <[email protected]>

* clean up toc list for deployment docs

Signed-off-by: Niels Bantilan <[email protected]>

* add back rsts

Signed-off-by: Niels Bantilan <[email protected]>

* add readthedocs config for monodocs

Signed-off-by: Niels Bantilan <[email protected]>

* incorporate changes from master

Signed-off-by: Niels Bantilan <[email protected]>

* reformat concepts section

Signed-off-by: Niels Bantilan <[email protected]>

* move monodocs readthedocs config

Signed-off-by: Niels Bantilan <[email protected]>

* debug readthedocs config

Signed-off-by: Niels Bantilan <[email protected]>

* add monodocs requirements

Signed-off-by: Niels Bantilan <[email protected]>

* update reqs

Signed-off-by: Niels Bantilan <[email protected]>

* fix furo dep

Signed-off-by: Niels Bantilan <[email protected]>

* update logo

Signed-off-by: Niels Bantilan <[email protected]>

* update logo

Signed-off-by: Niels Bantilan <[email protected]>

* update css

Signed-off-by: Niels Bantilan <[email protected]>

* update css

Signed-off-by: Niels Bantilan <[email protected]>

* update sidebar caption styling

Signed-off-by: Niels Bantilan <[email protected]>

* update sidebar css

* use conda to install monodocs deps

Signed-off-by: cosmicBboy <[email protected]>

* update conda deps

Signed-off-by: cosmicBboy <[email protected]>

* update makefile docs target

Signed-off-by: cosmicBboy <[email protected]>

* add furo dep to environment.yaml

Signed-off-by: cosmicBboy <[email protected]>

* add retry dep

Signed-off-by: cosmicBboy <[email protected]>

* update vaex deps

Signed-off-by: cosmicBboy <[email protected]>

* add graphviz to ci

Signed-off-by: cosmicBboy <[email protected]>

* add graphviz to readthedocs config

Signed-off-by: cosmicBboy <[email protected]>

* support pointing to local flytekit, flytesnacks, flytectl

- add graphviz as conda dependency
- remove monodocs-requirements.{in,txt}

Signed-off-by: Niels Bantilan <[email protected]>

* delete doc-requirements.txt - defer cleaning this up to followup PR

Signed-off-by: Niels Bantilan <[email protected]>

* revert doc-requirements.txt

Signed-off-by: Niels Bantilan <[email protected]>

---------

Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Co-authored-by: Samhita Alla <[email protected]>
Signed-off-by: Paul Dittamo <[email protected]>
@dosubot dosubot bot mentioned this pull request Jan 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docs] Monodocs build - a build system to consolidate Flyte docs
4 participants