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

[Docs] Add docs with mkdocs #202

Merged
merged 32 commits into from
Oct 24, 2024

Conversation

smokestacklightnin
Copy link
Contributor

@smokestacklightnin smokestacklightnin commented Sep 1, 2024

Google Would like to migrate the documentation for mlmd away from their internal systems, so this PR implements that migration.

Changes in this PR:

  • Add .gitignore to the project
  • Add mkdocs to the dependencies and add a configuration for it
  • Add a GitHub workflow to deploy the documentation on GitHub Pages
  • Add __all__ variables so modules and their members are recognized by mkdocs
  • Fixed notes admonitions
  • Add white background to rendered png images so they are legible in dark mode

TODO:

  • Fix the triggers before merge
  • Find a solution for including members of the proto submodule

@smokestacklightnin smokestacklightnin marked this pull request as draft September 9, 2024 16:22
@smokestacklightnin smokestacklightnin changed the title Add docs with mkdocs [WIP] Add docs with mkdocs Sep 10, 2024
@smokestacklightnin smokestacklightnin force-pushed the ci/docs/add-docs branch 8 times, most recently from 1c206ec to 260a824 Compare September 30, 2024 01:23
@peytondmurray
Copy link
Contributor

peytondmurray commented Oct 1, 2024

I made a few additional changes:

  • Renamed g3doc -> docs, since we are no longer using internal tooling for building documentation and docs is the standard mkdocs documentation directory
  • Modified the .gitignore to include bazel-* build artifacts
  • Updated the workflow to build docs on python 3.12
  • Enabled building and publishing docs on pushes to master

Comment on lines 36 to 42
__all__ = [
"downgrade_schema",
"ListOptions",
"MetadataStore",
"OrderByField",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't in scope for this PR, but the try/except block above doesn't work. In the event of an ImportError, this module won't be able to export these symbols. I can't really tell what is intended by the try/except block swallowing any import errors, but maybe this is something we can clean up in a future PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to have been present since before we started working on the repo.

I agree with you that we can possibly revisit this in a future PR

Comment on lines 41 to 42
del metadata_store_service_pb2
del metadata_store_service_pb2_grpc
Copy link
Contributor

@peytondmurray peytondmurray Oct 1, 2024

Choose a reason for hiding this comment

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

If you're going to remove the del metadata_store_pb2 line, can you also remove these other two?

Just a note of context for others working on this: I'm assuming this is to "un-import" the imported protobuf modules...but I'm not clear on why this is needed. If the goal is to re-export certain symbols, from <module> import <symbol> is sufficient. del <module> doesn't "un-import" the module - it persists elsewhere. See https://mail.python.org/pipermail/tutor/2006-August/048596.html for details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed del metadata_store_pb2 because as it is currently written, it is not imported directly anymore. It just has member objects imported. I left the other two del statements because they are not used to import member objects. My preference is to leave them as they are and revisit them in the future.

Copy link
Contributor

@peytondmurray peytondmurray left a comment

Choose a reason for hiding this comment

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

A few minor changes/questions. Once those are done, if you've checked that this deploys and looks good, then let's ship it! 🚢

Comment on lines 5 to 6
branches:
- master
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@peytondmurray I think we should allow this to run for push on any branch so developers can preview the deployment from their forks. If we make the reasonable assumption that nobody is pushing directly to upstream/master, then this will not affect the main docs deployment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now we have no way of deploying builds of individual branches - for now it is up to the users to build the docs and examine their changes locally, and for reviewers to pay due diligence in asking PR authors to provide screenshots/description of major changes to the docs.

Nobody will be pushing to master, but we still want this enabled so that when github itself makes a merge commit and pushes it to master the docs will be rebuilt. As it stands every PR will force-push to gh-pages.

@smokestacklightnin smokestacklightnin marked this pull request as ready for review October 2, 2024 00:56
@smokestacklightnin
Copy link
Contributor Author

@peytondmurray fixed merge conflict and marked as ready for review

Copy link
Contributor

@peytondmurray peytondmurray left a comment

Choose a reason for hiding this comment

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

Thanks for this 🚀

@XinranTang
Copy link
Collaborator

Hi, could you please resolve the conflicts in this branch?

@smokestacklightnin
Copy link
Contributor Author

smokestacklightnin commented Oct 15, 2024

Hi, could you please resolve the conflicts in this branch?

Done

CC: @peytondmurray

@smokestacklightnin smokestacklightnin changed the title [WIP] Add docs with mkdocs [Docs] Add docs with mkdocs Oct 16, 2024
@rtg0795 rtg0795 requested a review from XinranTang October 16, 2024 23:16
@peytondmurray
Copy link
Contributor

@XinranTang Is there anything else I can do to push this through? It would be nice to get this merged.

@XinranTang XinranTang merged commit 398994b into google:master Oct 24, 2024
3 checks passed
@smokestacklightnin
Copy link
Contributor Author

@XinranTang Thanks for merging this.

Can you please change the publishing branch to gh-pages so the docs can correctly be deployed? I'd do it myself but I don't have permissions.

@XinranTang
Copy link
Collaborator

@smokestacklightnin Done https://github.com/google/ml-metadata/settings/pages

@peytondmurray peytondmurray deleted the ci/docs/add-docs branch October 31, 2024 01:16
@smokestacklightnin
Copy link
Contributor Author

smokestacklightnin commented Oct 31, 2024

Thanks @XinranTang!

I somehow overlooked adding some of the documentation content to the branch before opening the PR. I have added it now in PR #208. Can you please review and merge it? Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants