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

GH-41430: [Docs] Use sphinxcontrib-mermaid instead of generating images from .mmd #41455

Merged
merged 9 commits into from
May 8, 2024

Conversation

kou
Copy link
Member

@kou kou commented Apr 30, 2024

Rationale for this change

This is for easy to maintain.

What changes are included in this PR?

  • Install sphinxcontrib-mermaid
  • Install Chromium to generate SVG from .mmd
  • Use Debian instead of Ubuntu for building docs because Ubuntu provides Chromium only via snap
  • Use a normal user not root to build documents because Mermaid require additional --no-sandbox argument when we use root

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Copy link

⚠️ GitHub issue #41430 has been automatically assigned in GitHub to PR creator.

@kou
Copy link
Member Author

kou commented Apr 30, 2024

@github-actions crossbow submit preview-docs

This comment was marked as outdated.

@kou kou force-pushed the docs-sphinx-mermaid branch 2 times, most recently from f94eb24 to a9457bf Compare April 30, 2024 10:19
@raulcd
Copy link
Member

raulcd commented Apr 30, 2024

@github-actions crossbow submit preview-docs

This comment was marked as outdated.

@kou kou force-pushed the docs-sphinx-mermaid branch 3 times, most recently from 1b40397 to f6081c6 Compare April 30, 2024 15:01
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* && \
npm install -g yarn @mermaid-js/mermaid-cli
Copy link
Member

Choose a reason for hiding this comment

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

We should be setting

ENV CHROME_BIN="/usr/bin/chromium" \
    PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"

before we install mermaid-cli so that puppeteer doesn't download its own chromium binary, changing CHROME_BIN's value to wherever Debian installs it

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the info!
It seems that CHROME_BIN is needless. We need PUPPETEER_EXECUTABLE_PATH instead.

@github-actions github-actions bot added awaiting review Awaiting review awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Apr 30, 2024
@github-actions github-actions bot added awaiting review Awaiting review and removed awaiting review Awaiting review awaiting changes Awaiting changes labels May 1, 2024
@kou
Copy link
Member Author

kou commented May 1, 2024

@github-actions crossbow submit preview-docs

@github-actions github-actions bot removed the awaiting review Awaiting review label May 1, 2024
Copy link

github-actions bot commented May 4, 2024

Revision: 6cfc130

Submitted crossbow builds: ursacomputing/crossbow @ actions-d1fc246446

Task Status
preview-docs GitHub Actions

Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting merge Awaiting merge and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels May 6, 2024
@kou
Copy link
Member Author

kou commented May 6, 2024

I'll merge this in a few days if nobody objects this.

@kou kou merged commit 46e7816 into apache:main May 8, 2024
64 of 66 checks passed
@kou kou deleted the docs-sphinx-mermaid branch May 8, 2024 21:29
@kou kou removed the awaiting merge Awaiting merge label May 8, 2024
Copy link

After merging your PR, Conbench analyzed the 0 benchmarking runs that have been run so far on merge-commit 46e7816.

None of the specified runs were found on the Conbench server.

The full Conbench report has more details.

assignUser added a commit that referenced this pull request May 14, 2024
### Rationale for this change

Broken benchmarks after #41455 
### What changes are included in this PR?

Use /tmp/arrow as build dir.

### Are these changes tested?

### Are there any user-facing changes?

* GitHub Issue: #41630

Authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
@@ -584,6 +587,9 @@
#
# texinfo_no_detailmenu = False

# -- Options for mermaid output -------------------------------------------

mermaid_output_format = 'svg'
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we are setting this here, instead of letting it generate the svg image live through the js mermaid script? (the default setting)

That would avoid requiring mermaid-cli for building the docs

Copy link
Member Author

@kou kou May 14, 2024

Choose a reason for hiding this comment

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

@zeroshade Why did you choose svg here? I just used your code here.

Copy link
Member

Choose a reason for hiding this comment

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

If I remember correctly, it would require us to actually pull down and statically add the mermaid js script to our resulting documentation output, which also ended up interfering with the anchor links on the right side based on headings. The "zoom" and other features that mermaid-js provides ended up causing issues so it was better for us to pre-generate the images during building the docs and include those images rather than rely on manually including and picking a version of mermaid-js to add to our static files.

from the sphixcontrib-mermaid docs:

The version of mermaid that will be used to parse raw output in HTML files. This should match a version available on https://unpkg.com/browse/mermaid/. The default is "10.2.0". If you need a newer version, you'll need to add the custom initialization. See below.

If it's set to "", the lib won't be automatically included from the CDN service and you'll need to add it as a local file in html_js_files.

@github-actions github-actions bot added the awaiting changes Awaiting changes label May 14, 2024
kou pushed a commit to apache/arrow-site that referenced this pull request May 14, 2024
…d change) (#513)

The doc build was changed in apache/arrow#41455,
we need a change here accordingly to ensure to keep updating the dev
docs from that crossbow build.
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…g images from .mmd (apache#41455)

### Rationale for this change

This is for easy to maintain. 

### What changes are included in this PR?

* Install sphinxcontrib-mermaid
* Install Chromium to generate SVG from .mmd
* Use Debian instead of Ubuntu for building docs because Ubuntu provides Chromium only via snap
* Use a normal user not root to build documents because Mermaid require additional `--no-sandbox` argument when we use root

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41430

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…pache#41631)

### Rationale for this change

Broken benchmarks after apache#41455 
### What changes are included in this PR?

Use /tmp/arrow as build dir.

### Are these changes tested?

### Are there any user-facing changes?

* GitHub Issue: apache#41630

Authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request May 29, 2024
…pache#41631)

### Rationale for this change

Broken benchmarks after apache#41455 
### What changes are included in this PR?

Use /tmp/arrow as build dir.

### Are these changes tested?

### Are there any user-facing changes?

* GitHub Issue: apache#41630

Authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
kou added a commit that referenced this pull request Jun 1, 2024
### Rationale for this change

This is a follow-up of GH-41455.

### What changes are included in this PR?

Add missing build directory argument.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #41920

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants