-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Pull Request resolved: #2715 ## 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: #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 fbshipit-source-id: 0d938bd849bd94986cf20587c4420bfba37090d6
- Loading branch information
1 parent
acae12d
commit b3f6a38
Showing
86 changed files
with
13,090 additions
and
9,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Publish Website | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
new_version: | ||
required: false | ||
type: string | ||
run_tutorials: | ||
required: false | ||
type: boolean | ||
default: false | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
|
||
build-website: | ||
runs-on: ubuntu-latest | ||
env: | ||
# `uv pip ...` requires venv by default. This skips that requirement. | ||
UV_SYSTEM_PYTHON: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: 'docusaurus-versions' # release branch | ||
fetch-depth: 0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
- name: Sync release branch with main | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git merge origin/main | ||
# To avoid a large number of commits we don't push this sync commit to github until a new release. | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- if: ${{ !inputs.new_version }} | ||
name: Install latest GPyTorch and Linear Operator | ||
run: | | ||
uv pip install git+https://github.com/cornellius-gp/linear_operator.git | ||
uv pip install git+https://github.com/cornellius-gp/gpytorch.git | ||
- name: Install dependencies | ||
env: | ||
ALLOW_LATEST_GPYTORCH_LINOP: true | ||
ALLOW_BOTORCH_LATEST: true # Allow Ax to install w/ new BoTorch release. | ||
run: | | ||
uv pip install ."[dev, tutorials]" | ||
# There may not be a compatible Ax uv pip version, so we use the development version. | ||
uv pip install git+https://github.com/facebook/Ax.git | ||
- if: ${{ inputs.new_version }} | ||
name: Create new docusaurus version | ||
run: | | ||
python3 scripts/convert_ipynb_to_mdx.py --clean | ||
cd website | ||
yarn | ||
yarn docusaurus docs:version ${{ inputs.new_version }} | ||
git add --all | ||
git commit -m "Create version ${{ inputs.new_version }} of site in Docusaurus" | ||
git push --force origin HEAD:docusaurus-versions | ||
- name: Build website | ||
run: | | ||
bash scripts/build_docs.sh -b | ||
- name: Upload website build as artifact | ||
id: deployment | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: website/build/ | ||
|
||
deploy-website: | ||
needs: build-website | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: "2" | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.12" | ||
jobs: | ||
post_install: | ||
# Install latest botorch if not on a released version | ||
- | | ||
tag=$(eval "git name-rev --name-only --tags HEAD") | ||
if [ $tag = "undefined" ]; then | ||
pip install git+https://github.com/cornellius-gp/linear_operator.git | ||
pip install git+https://github.com/cornellius-gp/gpytorch.git | ||
fi | ||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- dev | ||
|
||
sphinx: | ||
configuration: sphinx/source/conf.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.