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

Upgrade Website #2653

Closed
wants to merge 110 commits into from
Closed

Upgrade Website #2653

wants to merge 110 commits into from

Conversation

CristianLara
Copy link
Contributor

@CristianLara CristianLara commented Dec 16, 2024

Motivation

We are already using most of the correct tooling but it has become very out of date and is tied together with scripts that are difficult to maintain. Upgrade our tooling by updating to latest versions and dramatically simplifying our setup/deploy scripts.

Includes:

  • Upgrade Docusaurus from V1 to V3
  • Utilize new MDX support in Docusaurus by converting our tutorials to MDX (previously converted to html)
  • Tutorials link to Colab for easy execution
  • Website versioning is now handled natively through Docusaurus
  • New website versions are only created for major and minor releases (not patches)
  • Build and Deploy workflows have been dramatically simplified
  • Change Sphinx theme to ReadTheDocs
  • API Reference is still built using Sphinx but is now hosted by ReadTheDocs. ReadTheDocs also handles versioning.
  • Legacy website will be frozen and available at archive.botorch.org
    • Served by Vercel from the archive branch
  • Website now supports dark mode
Before After
image image
image image
image image
image image

The commits for most of the major changes are grouped into themed PRs on my fork if that makes the review easier: https://github.com/CristianLara/botorch/pulls?q=is%3Apr+is%3Aclosed

Considerations

  • Our tutorials are natively embedded and versioned in the website using Docusaurus, but our sphinx-generated API reference is not. ReadTheDocs will create new version of the sphinx docs for every new release tag in our github repo.
  • The main branch will now contain copies of the website documentation for every version. This includes the converted tutorial MDX but not the original ipynb files, those are accessible linked to from github using release tags.
  • Continue using same integrations for Algolia Search and Google Analytics
  • The number and type of github workflows we have remain the same, but the complexity of the workflows and the supporting scripts has been simplified.

Test Plan

I moved the old website directory from `website/` to `website-old/` and ran `npx @docusaurus/migrate migrate website-old website`

Various things are still broken, fixes coming in next commits
The migration script completely ignored our previous landing page. Here we migrate it ourselves manually and drop most of our custom styling in favor of the new docusaurus styling.
These are not yet configured for this fork
I noticed this hidden docusaurus folder is new after the upgrade
`yarn upgrade @docusaurus/core@latest ││ @docusaurus/preset-classic@latest`

And then manually upgrading other dependencies.

Docusaurus v3 by default interprets all markdown files as mdx. Our md docs are not compatible with mdx yet and require some hand editing to fix. I don
t think we're planning to use mdx in our manually handwritten md docs so I've added an option to the docusaurus config to treat .md files as pure markdown.
This controls the theme for codeblocks. The specified themes are closer to the colors used in the old website
The old `<!--DOCUSAURUS_CODE_TABS-->` comments are deprecated, use the new `<Tabs>` component and convert this .md file to .mdx to utilize it.
Remove unused tags and components, improve styles
Based on old footer
Created this project under my personal algolia account specifically for the version of this site that will be hosted under my personal website.
Docusaurus has moved from mathjax to katex. We also make some small tweaks to some of the math in our md to match updated synatx for katex. I spot checked each of our md docs pages to find offenders.
This was heavily modified as a result of the docusaurus upgrade
Dramatically simplify the process of deploying and versioning. We remove the shell script and perform the fewer steps from within github actions.

A big change here is the move to using docusaurus's built-in versioning system. Before, we were abusing docusaurus's system to take a snapshot of the entire website. For now we are only handling our md docs, but in future commits we will handle versioning tutorials and sphinx.
This is necessary to host from my personal website.
[Actions] Update publish website workflow
The Ax and Botorch repos have this same script but it's named slightly differently T_T
Provides a consistent structure such that notebooks are always nested within a directory regardless of whether the notebook has additional data/assets.
This is a direct copy/paste from the Ax fork. https://github.com/CristianLara/Ax/blob/15242657d3fe19f5655566c881c4156a0b64591e/scripts/convert_ipynb_to_mdx.py

It doesn't fully work with the tutorials in this repo yet, fixes in the next commits
The automated migration script left this behind
The automated migration script didn't update this reference
KaTeX requires these to be wrapped by $$ to be parsed as math.

We also update our regex for unescaping braces in math to support math wrapped by double dollar signs and containing newlines.
<br> tags are normal in ipynb but fail mdx parsing.
- \begin{}...\end{} blocks don't necessarily have to be {align} blocks. Update the regex to handle any kind. But make sure that the end and begin blocks are of the same type to handle nested blocks.
- Make sure $$ symbols are not escaped and include line breaks before and after. I encountered a few examples in our notebooks that didn't match this formatting expected by mdx.
This page is not autogenerated so it's the only file in the docs/tutorials/ directory that we track in github.

I manually converted this to MDX from our old page which was a react component because files in the docs/ directory must be either md or mdx.
The fork was being hosted at /botorch but the official website does not use a baseUrl
Accidentally removed this while resolving merge conflicts
These changes were perfomed on all tutorials before this new one was created.
Copy link
Contributor

@saitcakmak saitcakmak 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 we're ready to test in prod!

@facebook-github-bot
Copy link
Contributor

@CristianLara has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

CristianLara added a commit to CristianLara/botorch that referenced this pull request Jan 31, 2025
Summary:
## Motivation

We are already using most of the correct tooling but it has become very out of date and is tied together with scripts that are difficult to maintain. Upgrade our tooling by updating to latest versions and dramatically simplifying our setup/deploy scripts.

Includes:
- Upgrade Docusaurus from V1 to V3
- Utilize new MDX support in Docusaurus by converting our tutorials to MDX (previously converted to html)
- Tutorials link to Colab for easy execution
- Website versioning is now handled natively through Docusaurus
- New website versions are only created for major and minor releases (not patches)
- Build and Deploy workflows have been dramatically simplified
- Change Sphinx theme to ReadTheDocs
- API Reference is still built using Sphinx but is now hosted by ReadTheDocs. ReadTheDocs also handles versioning.
- Legacy website will be frozen and available at [archive.botorch.org](archive.botorch.org)
    - Served by Vercel from the `archive` branch
- Website now supports dark mode

| Before    | After |
| -------- | ------- |
|        <img width="1280" alt="image" src="https://github.com/user-attachments/assets/5c9f2d8d-6e9b-4712-b818-eca5d558adc7" />         |      <img width="1282" alt="image" src="https://github.com/user-attachments/assets/79a247e5-0d84-4202-8d22-9ccaa03af200" />      |
| <img width="1278" alt="image" src="https://github.com/user-attachments/assets/a2f2c259-dccf-4c82-a514-dc2bb2b75f16" /> | <img width="1277" alt="image" src="https://github.com/user-attachments/assets/0722fd36-ee4d-478d-b416-ff9c66c2e83a" />  |
| <img width="1279" alt="image" src="https://github.com/user-attachments/assets/606529da-2725-4910-b9fc-d060a4713a8f" /> | <img width="1276" alt="image" src="https://github.com/user-attachments/assets/d4358df6-1092-42e3-ae8c-3701772d61a6" /> |
| <img width="1277" alt="image" src="https://github.com/user-attachments/assets/aeb54819-c256-49cd-a4ff-2b7ac7c9af15" /> | <img width="1277" alt="image" src="https://github.com/user-attachments/assets/71b34ff9-1aaf-4c39-ade1-7bb346aad317" /> |

The commits for most of the major changes are grouped into themed PRs on my fork if that makes the review easier: https://github.com/CristianLara/botorch/pulls?q=is%3Apr+is%3Aclosed

## Considerations
- Our tutorials are natively embedded and versioned in the website using Docusaurus, but our sphinx-generated API reference is not. ReadTheDocs will create new version of the sphinx docs for every new release tag in our github repo.
- The main branch will now contain copies of the website documentation for every version. This includes the converted tutorial MDX but not the original ipynb files, those are accessible linked to from github using release tags.
- Continue using same integrations for Algolia Search and Google Analytics
- The number and type of github workflows we have remain the same, but the complexity of the workflows and the supporting scripts has been simplified.

Pull Request resolved: pytorch#2653

Test Plan:
- I've enabled all the workflows in my PR and everything is passing [https://github.com/CristianLara/botorch/actions](https://github.com/CristianLara/botorch/actions)
    - Pypy deploy and codecov are failing as expected due to missing credentials
- Website for my fork is being actively built and served at [cristianlara.me/botorch](cristianlara.me/botorch)
- API Reference is being built and served by ReadTheDocs at [https://botorch-dev.readthedocs.io/](https://botorch-dev.readthedocs.io/)

Reviewed By: saitcakmak

Differential Revision: D67293492

Pulled By: CristianLara
CristianLara added a commit to CristianLara/Ax that referenced this pull request Jan 31, 2025
Summary:
## Context

This is the Ax counterpart to the same upgrade in Botorch: pytorch/botorch#2653

## Motivation

We are already using most of the correct tooling but it has become very out of date and is tied together with scripts that are difficult to maintain. Upgrade our tooling by updating to latest versions and dramatically simplifying our setup/deploy scripts.

Includes:
- Upgrade Docusaurus from V1 to V3
- Utilize new MDX support in Docusaurus by converting our tutorials to MDX (previously converted to html)
- Tutorials link to Colab for easy execution
- Website versioning is now handled natively through Docusaurus
- New website versions are only created for major and minor releases (not patches)
- Build and Deploy workflows have been dramatically simplified
- Change Sphinx theme to ReadTheDocs
- API Reference is still built using Sphinx but is now hosted by ReadTheDocs. ReadTheDocs also handles versioning.
- Legacy website will be frozen and available at [archive.ax.dev](archive.ax.dev)
    - Served by Vercel from the `archive` branch
- Website now supports dark mode

| Before    | After |
| -------- | ------- |
|        <img width="1325" alt="image" src="https://github.com/user-attachments/assets/4af73120-f125-47e2-8285-bd01f4251ee9" />         |      <img width="1330" alt="image" src="https://github.com/user-attachments/assets/ea17c47c-5012-47ab-a9d2-4b7e9c103cb0" />      |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/3dbde70a-8b84-43a4-8374-362f594de7fc" /> | <img width="1332" alt="image" src="https://github.com/user-attachments/assets/c779b7dd-76b9-4eb3-9b08-ca663732d7ec" />  |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/25d74ed7-4536-43a3-8654-ed291ae50cf3" /> | <img width="1331" alt="image" src="https://github.com/user-attachments/assets/e2438746-d975-4a09-96b5-d73e5d1a9980" /> |
| <img width="1327" alt="image" src="https://github.com/user-attachments/assets/bcf71617-a537-45e4-a5e8-452de946a238" /> | <img width="1277" alt="image" src="https://github.com/user-attachments/assets/71b34ff9-1aaf-4c39-ade1-7bb346aad317" /> |

## Considerations
- Our tutorials are natively embedded and versioned in the website using Docusaurus, but our sphinx-generated API reference is not. ReadTheDocs will create new version of the sphinx docs for every new release tag in our github repo.
- Continue using same integrations for Algolia Search and Google Analytics
- The number and type of github workflows we have remain the same, but the complexity of the workflows and the supporting scripts has been simplified.

Pull Request resolved: facebook#3289

Test Plan:
- I've enabled all the workflows in my PR and everything is passing [https://github.com/CristianLara/botorch/actions](https://github.com/CristianLara/botorch/actions)
    - Pypy deploy and codecov are failing as expected due to missing credentials
- Website for my fork is being actively built and served at [cristianlara.me/Ax](cristianlara.me/Ax)
- API Reference is being built and served by ReadTheDocs at [https://ax.readthedocs.io/](https://ax.readthedocs.io/)

Differential Revision: D68916590

Pulled By: CristianLara
CristianLara added a commit to CristianLara/Ax that referenced this pull request Jan 31, 2025
Summary:
Pull Request resolved: facebook#3294

## Context

This is the Ax counterpart to the same upgrade in Botorch: pytorch/botorch#2653

## Motivation

We are already using most of the correct tooling but it has become very out of date and is tied together with scripts that are difficult to maintain. Upgrade our tooling by updating to latest versions and dramatically simplifying our setup/deploy scripts.

Includes:
- Upgrade Docusaurus from V1 to V3
- Utilize new MDX support in Docusaurus by converting our tutorials to MDX (previously converted to html)
- Tutorials link to Colab for easy execution
- Website versioning is now handled natively through Docusaurus
- New website versions are only created for major and minor releases (not patches)
- Build and Deploy workflows have been dramatically simplified
- Change Sphinx theme to ReadTheDocs
- API Reference is still built using Sphinx but is now hosted by ReadTheDocs. ReadTheDocs also handles versioning.
- Legacy website will be frozen and available at [archive.ax.dev](archive.ax.dev)
    - Served by Vercel from the `archive` branch
- Website now supports dark mode

| Before    | After |
| -------- | ------- |
|        <img width="1325" alt="image" src="https://github.com/user-attachments/assets/4af73120-f125-47e2-8285-bd01f4251ee9" />         |      <img width="1330" alt="image" src="https://github.com/user-attachments/assets/ea17c47c-5012-47ab-a9d2-4b7e9c103cb0" />      |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/3dbde70a-8b84-43a4-8374-362f594de7fc" /> | <img width="1332" alt="image" src="https://github.com/user-attachments/assets/c779b7dd-76b9-4eb3-9b08-ca663732d7ec" />  |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/25d74ed7-4536-43a3-8654-ed291ae50cf3" /> | <img width="1331" alt="image" src="https://github.com/user-attachments/assets/e2438746-d975-4a09-96b5-d73e5d1a9980" /> |
| <img width="1327" alt="image" src="https://github.com/user-attachments/assets/bcf71617-a537-45e4-a5e8-452de946a238" /> | <img width="1277" alt="image" src="https://github.com/user-attachments/assets/71b34ff9-1aaf-4c39-ade1-7bb346aad317" /> |

## Considerations
- Our tutorials are natively embedded and versioned in the website using Docusaurus, but our sphinx-generated API reference is not. ReadTheDocs will create new version of the sphinx docs for every new release tag in our github repo.
- Continue using same integrations for Algolia Search and Google Analytics
- The number and type of github workflows we have remain the same, but the complexity of the workflows and the supporting scripts has been simplified.

Pull Request resolved: facebook#3289

Test Plan:
- I've enabled all the workflows in my PR and everything is passing [https://github.com/CristianLara/botorch/actions](https://github.com/CristianLara/botorch/actions)
    - Pypy deploy and codecov are failing as expected due to missing credentials
- Website for my fork is being actively built and served at [cristianlara.me/Ax](cristianlara.me/Ax)
- API Reference is being built and served by ReadTheDocs at [https://ax.readthedocs.io/](https://ax.readthedocs.io/)

Differential Revision: D68916590

Pulled By: CristianLara
@facebook-github-bot
Copy link
Contributor

@CristianLara merged this pull request in b3f6a38.

CristianLara added a commit to CristianLara/Ax that referenced this pull request Jan 31, 2025
Summary:
Pull Request resolved: facebook#3294

## Context

This is the Ax counterpart to the same upgrade in Botorch: pytorch/botorch#2653

## Motivation

We are already using most of the correct tooling but it has become very out of date and is tied together with scripts that are difficult to maintain. Upgrade our tooling by updating to latest versions and dramatically simplifying our setup/deploy scripts.

Includes:
- Upgrade Docusaurus from V1 to V3
- Utilize new MDX support in Docusaurus by converting our tutorials to MDX (previously converted to html)
- Tutorials link to Colab for easy execution
- Website versioning is now handled natively through Docusaurus
- New website versions are only created for major and minor releases (not patches)
- Build and Deploy workflows have been dramatically simplified
- Change Sphinx theme to ReadTheDocs
- API Reference is still built using Sphinx but is now hosted by ReadTheDocs. ReadTheDocs also handles versioning.
- Legacy website will be frozen and available at [archive.ax.dev](archive.ax.dev)
    - Served by Vercel from the `archive` branch
- Website now supports dark mode

| Before    | After |
| -------- | ------- |
|        <img width="1325" alt="image" src="https://github.com/user-attachments/assets/4af73120-f125-47e2-8285-bd01f4251ee9" />         |      <img width="1330" alt="image" src="https://github.com/user-attachments/assets/ea17c47c-5012-47ab-a9d2-4b7e9c103cb0" />      |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/3dbde70a-8b84-43a4-8374-362f594de7fc" /> | <img width="1332" alt="image" src="https://github.com/user-attachments/assets/c779b7dd-76b9-4eb3-9b08-ca663732d7ec" />  |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/25d74ed7-4536-43a3-8654-ed291ae50cf3" /> | <img width="1331" alt="image" src="https://github.com/user-attachments/assets/e2438746-d975-4a09-96b5-d73e5d1a9980" /> |
| <img width="1327" alt="image" src="https://github.com/user-attachments/assets/bcf71617-a537-45e4-a5e8-452de946a238" /> | <img width="1277" alt="image" src="https://github.com/user-attachments/assets/71b34ff9-1aaf-4c39-ade1-7bb346aad317" /> |

## Considerations
- Our tutorials are natively embedded and versioned in the website using Docusaurus, but our sphinx-generated API reference is not. ReadTheDocs will create new version of the sphinx docs for every new release tag in our github repo.
- Continue using same integrations for Algolia Search and Google Analytics
- The number and type of github workflows we have remain the same, but the complexity of the workflows and the supporting scripts has been simplified.

Pull Request resolved: facebook#3289

Test Plan:
- I've enabled all the workflows in my PR and everything is passing [https://github.com/CristianLara/botorch/actions](https://github.com/CristianLara/botorch/actions)
    - Pypy deploy and codecov are failing as expected due to missing credentials
- Website for my fork is being actively built and served at [cristianlara.me/Ax](cristianlara.me/Ax)
- API Reference is being built and served by ReadTheDocs at [https://ax.readthedocs.io/](https://ax.readthedocs.io/)

Differential Revision: D68916590

Pulled By: CristianLara
facebook-github-bot pushed a commit to facebook/Ax that referenced this pull request Jan 31, 2025
Summary:
Pull Request resolved: #3294

## Context

This is the Ax counterpart to the same upgrade in Botorch: pytorch/botorch#2653

## Motivation

We are already using most of the correct tooling but it has become very out of date and is tied together with scripts that are difficult to maintain. Upgrade our tooling by updating to latest versions and dramatically simplifying our setup/deploy scripts.

Includes:
- Upgrade Docusaurus from V1 to V3
- Utilize new MDX support in Docusaurus by converting our tutorials to MDX (previously converted to html)
- Tutorials link to Colab for easy execution
- Website versioning is now handled natively through Docusaurus
- New website versions are only created for major and minor releases (not patches)
- Build and Deploy workflows have been dramatically simplified
- Change Sphinx theme to ReadTheDocs
- API Reference is still built using Sphinx but is now hosted by ReadTheDocs. ReadTheDocs also handles versioning.
- Legacy website will be frozen and available at [archive.ax.dev](archive.ax.dev)
    - Served by Vercel from the `archive` branch
- Website now supports dark mode

| Before    | After |
| -------- | ------- |
|        <img width="1325" alt="image" src="https://github.com/user-attachments/assets/4af73120-f125-47e2-8285-bd01f4251ee9" />         |      <img width="1330" alt="image" src="https://github.com/user-attachments/assets/ea17c47c-5012-47ab-a9d2-4b7e9c103cb0" />      |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/3dbde70a-8b84-43a4-8374-362f594de7fc" /> | <img width="1332" alt="image" src="https://github.com/user-attachments/assets/c779b7dd-76b9-4eb3-9b08-ca663732d7ec" />  |
| <img width="1328" alt="image" src="https://github.com/user-attachments/assets/25d74ed7-4536-43a3-8654-ed291ae50cf3" /> | <img width="1331" alt="image" src="https://github.com/user-attachments/assets/e2438746-d975-4a09-96b5-d73e5d1a9980" /> |
| <img width="1327" alt="image" src="https://github.com/user-attachments/assets/bcf71617-a537-45e4-a5e8-452de946a238" /> | <img width="1277" alt="image" src="https://github.com/user-attachments/assets/71b34ff9-1aaf-4c39-ade1-7bb346aad317" /> |

## Considerations
- Our tutorials are natively embedded and versioned in the website using Docusaurus, but our sphinx-generated API reference is not. ReadTheDocs will create new version of the sphinx docs for every new release tag in our github repo.
- Continue using same integrations for Algolia Search and Google Analytics
- The number and type of github workflows we have remain the same, but the complexity of the workflows and the supporting scripts has been simplified.

Pull Request resolved: #3289

Test Plan:
- I've enabled all the workflows in my PR and everything is passing [https://github.com/CristianLara/botorch/actions](https://github.com/CristianLara/botorch/actions)
    - Pypy deploy and codecov are failing as expected due to missing credentials
- Website for my fork is being actively built and served at [cristianlara.me/Ax](cristianlara.me/Ax)
- API Reference is being built and served by ReadTheDocs at [https://ax.readthedocs.io/](https://ax.readthedocs.io/)

Reviewed By: saitcakmak

Differential Revision: D68916590

Pulled By: CristianLara

fbshipit-source-id: 7b1d4a3bffff72a89b16acea7231b0c4bf7ddc1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants