-
Notifications
You must be signed in to change notification settings - Fork 52
SphinxDocs set up #572
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: main
Are you sure you want to change the base?
SphinxDocs set up #572
Changes from all commits
7d7535a
707640a
928eb3d
308840e
e08ad87
27e5071
791a95b
655bdf2
014764d
e156a15
bd44c79
79f0bac
944da22
65827cd
aa1d19a
77a8c56
69447fa
0ab37f1
921ae89
ec5f271
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
architecture: x64 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Dependencies | ||
run: | | ||
|
||
set -eux | ||
pip install --upgrade pip | ||
pip install -r build-requirements.txt | ||
pip install --no-build-isolation . | ||
|
||
pip install -r docs/requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to install requirements.txt from the root of the repo. |
||
|
||
- name: Build Sphinx Docs | ||
working-directory: docs | ||
run: | | ||
set -eux | ||
|
||
make html | ||
- name: Upload static files as artifact | ||
id: deployment | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/build/html/ | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
# Generate example documentation from Python files | ||
generate-examples: | ||
@echo "Generating example documentation..." | ||
@cd "$(SOURCEDIR)" && python GenerateExamples.py | ||
|
||
# Override html target to run generate-examples first and include books | ||
html: | ||
@echo "Building HTML documentation with books directory..." | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile html | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
clean: | ||
@echo "Cleaning up build directory..." | ||
@rm -rf "$(BUILDDIR)" | ||
@rm -rf "$(SOURCEDIR)/generated" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sphinx==7.2.6 | ||
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2 | ||
sphinxcontrib.katex==0.9.10 | ||
#breathe==4.34.0 # only if generating C++ | ||
exhale==0.2.3 # only if generating C++ docs | ||
docutils>=0.18.1,<0.21 | ||
sphinx-design==0.6.1 | ||
sphinxcontrib-mermaid==1.0.0 | ||
myst-parser #==0.18.1 # if want to contribute in markdown | ||
sphinx-gallery==0.14.0 # only if hosting interactive tutorials | ||
sphinx-sitemap==2.7.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add sphinx-rust== figure out the version |
||
sphinxext-opengraph | ||
nbsphinx |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Books | ||
|
||
This section contains books and comprehensive guides for Monarch. | ||
|
||
```{toctree} | ||
:maxdepth: 2 | ||
:caption: Available Books | ||
:hidden: | ||
|
||
./hyperactor-book/src/introduction | ||
``` | ||
|
||
|
||
## [HyperActor Book](./hyperactor-book/src/introduction) | ||
|
||
The HyperActor Book provides a comprehensive guide to using the actor system in Monarch. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
book/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Hyperactor Documentation Book | ||
|
||
This is the development documentation for the hyperactor system, built using [`mdBook`](https://rust-lang.github.io/mdBook/). | ||
|
||
```{toctree} | ||
:maxdepth: 2 | ||
:caption: Contents | ||
|
||
./src/introduction | ||
./src/refrences | ||
mailbox | ||
macros | ||
actors | ||
summary | ||
``` | ||
|
||
## Running the Book | ||
|
||
### On the **Server** | ||
|
||
To run the book on a remote server (e.g., `devgpu004`): | ||
|
||
```bash | ||
x2ssh devgpu004.rva5.facebook.com | ||
tmux new -s mdbook | ||
cd ~/fbsource/fbcode/monarch/books/hyperactor-book | ||
mdbook serve | ||
``` | ||
Then detach with Ctrl+b, then d. | ||
|
||
### On the **Client** | ||
|
||
To access the remote book from your local browser: | ||
```bash | ||
autossh -M 0 -N -L 3000:localhost:3000 devgpu004.rva5.facebook.com | ||
``` | ||
Then open http://localhost:3000 in your browser. | ||
|
||
**Note**: If you don’t have autossh installed, you can install it with: | ||
```bash | ||
brew install autossh | ||
``` | ||
|
||
### Notes | ||
|
||
- The source is located in src/, with structure defined in SUMMARY.md. | ||
- The book will auto-reload in the browser on edits. | ||
|
||
## Cleaning Up | ||
|
||
To shut down the book server: | ||
|
||
### Option 1: Reattach and stop | ||
|
||
```bash | ||
x2ssh devgpu004.rva5.facebook.com | ||
tmux attach -t mdbook | ||
``` | ||
Inside the session: | ||
- Press Ctrl+C to stop mdbook serve | ||
- Then type exit to close the shell and terminate the tmux session | ||
|
||
### Option 2: Kill the session directly | ||
|
||
If you don’t want to reattach, you can kill the session from a new shell: | ||
```bash | ||
x2ssh devgpu004.rva5.facebook.com | ||
tmux kill-session -t mdbook | ||
``` | ||
|
||
### Optional: View active tmux sessions | ||
```bash | ||
tmux ls | ||
``` | ||
Use this to check whether the mdbook session is still running. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[book] | ||
authors = ["Shayne Fletcher"] | ||
language = "en" | ||
src = "src" | ||
title = "Hyperactor Book" | ||
|
||
[output.html] | ||
git-repository-url = "https://github.com/pytorch-labs/monarch" | ||
edit-url-template = "https://github.com/pytorch-labs/monarch/edit/main/books/hyperactor-book/src/{path}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Summary | ||
|
||
- [Introduction](./introduction.md) | ||
- [References](references/index.md) | ||
- [Syntax](references/syntax.md) | ||
- [WorldId](references/world_id.md) | ||
- [ProcId](references/proc_id.md) | ||
- [ActorId](references/actor_id.md) | ||
- [PortId](references/port_id.md) | ||
- [GangId](references/gang_id.md) | ||
- [Reference](references/reference.md) | ||
- [Typed References](references/typed_refs.md) | ||
- [Mailboxes and Routers](mailboxes/index.md) | ||
- [Ports](mailboxes/ports.md) | ||
- [MailboxSender](mailboxes/mailbox_sender.md) | ||
- [Reconfigurable Senders](mailboxes/reconfigurable_sender.md) | ||
- [MailboxServer](mailboxes/mailbox_server.md) | ||
- [MailboxClient](mailboxes/mailbox_client.md) | ||
- [Mailbox](mailboxes/mailbox.md) | ||
- [Delivery Semantics](mailboxes/delivery.md) | ||
- [Multiplexers](mailboxes/multiplexer.md) | ||
- [Routers](mailboxes/routers.md) | ||
- [Actors](actors/index.md) | ||
- [Actor](actors/actor.md) | ||
- [Handler](actors/handler.md) | ||
- [RemoteableActor](actors/remotable_actor.md) | ||
- [Checkpointable](actors/checkpointable.md) | ||
- [RemoteActor](actors/remote_actor.md) | ||
- [Binds](actors/binds.md) | ||
- [RemoteHandles](actors/remote_handles.md) | ||
- [ActorHandle](actors/actor_handle.md) | ||
- [Actor Lifecycle](actors/actor_lifecycle.md) | ||
- [Macros](macros/index.md) | ||
- [`#[derive(Handler)]`](macros/handler.md) | ||
- [`#[derive(HandleClient)]`](macros/handle_client.md) | ||
- [`#[derive(RefClient)]`](macros/ref_client.md) | ||
- [`#[derive(Named)]`](macros/named.md) | ||
- [`#[export]`](macros/export.md) | ||
- [`#[forward]`](macros/forward.md) |
Uh oh!
There was an error while loading. Please reload this page.