Skip to content

Commit 6850d2e

Browse files
romanlutzCopilot
andauthored
FIX: RTD build - remove broken TOC entries, fix AML image paths, build PDF in CI (#1740)
Co-authored-by: romanlutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2a97244 commit 6850d2e

6 files changed

Lines changed: 36 additions & 14 deletions

File tree

.github/workflows/docs.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,24 @@ jobs:
5555
- name: Install PyRIT with uv
5656
run: uv sync --extra all
5757

58-
# Build the book
58+
# LaTeX toolchain needed for the PDF export (jupyter-book --pdf via xelatex).
59+
# Mirrors the ReadTheDocs build so CI catches PDF-only issues (e.g. broken
60+
# image paths) instead of letting them silently break the RTD build.
61+
- name: Install LaTeX (for PDF export)
62+
run: |
63+
sudo apt-get update
64+
sudo apt-get install -y --no-install-recommends \
65+
texlive-xetex \
66+
texlive-fonts-recommended \
67+
texlive-fonts-extra \
68+
texlive-plain-generic \
69+
texlive-latex-extra \
70+
latexmk
71+
72+
# Build the book (HTML site + PDF export)
5973
- name: Build the book
6074
run: |
61-
make docs-build
75+
make docs-build-all
6276
# Upload the book's HTML as an artifact
6377
- name: Upload artifact
6478
uses: actions/upload-pages-artifact@v3

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,25 @@ ty:
2020
# Build the full documentation site:
2121
# 1. Generate API reference JSON from Python source (griffe)
2222
# 2. Convert API JSON to MyST markdown pages
23-
# 3. Build the Jupyter Book site
23+
# 3. Build the Jupyter Book site (HTML only — fast, no LaTeX needed)
2424
# 4. Generate RSS feed
2525
docs-build:
2626
uv run python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json
2727
uv run python build_scripts/gen_api_md.py
2828
cd doc && uv run jupyter-book build --all --html
2929
uv run ./build_scripts/generate_rss.py
3030

31+
# Build the full documentation site including the PDF export.
32+
# Mirrors the ReadTheDocs build (.readthedocs.yaml) so CI catches PDF-only issues
33+
# such as missing images that the HTML-only build silently ignores.
34+
# Requires xelatex / latexmk on PATH (texlive-xetex + texlive-fonts-recommended +
35+
# texlive-plain-generic + latexmk on Ubuntu).
36+
docs-build-all:
37+
uv run python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json
38+
uv run python build_scripts/gen_api_md.py
39+
cd doc && uv run jupyter-book build --all --html --pdf
40+
uv run ./build_scripts/generate_rss.py
41+
3142
# Regenerate only the API reference pages (without building the full site)
3243
docs-api:
3344
uv run python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json

doc/getting_started/troubleshooting/deploy_hf_model_aml.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
"\n",
4848
"5. **AZURE_ML_MODEL_NAME_TO_DEPLOY**\n",
4949
" - If the model is listed in the AZURE ML Hugging Face model catalog, then supply the model name as shown in the following image.\n",
50-
" <br> <img src=\"./../../assets/aml_hf_model.png\" alt=\"AML Hugging Face model\" height=\"400\"/> <br>\n",
50+
" <br> <img src=\"./../../../assets/aml_hf_model.png\" alt=\"AML Hugging Face model\" height=\"400\"/> <br>\n",
5151
" - If you intend to deploy the model from the AZURE ML workspace model registry, then use the model name as shown in the subsequent image.\n",
52-
" <br> <img src=\"./../../assets/aml_ws_model.png\" alt=\"AML Workspace model\" height=\"400\"/> <br>\n",
52+
" <br> <img src=\"./../../../assets/aml_ws_model.png\" alt=\"AML Workspace model\" height=\"400\"/> <br>\n",
5353
"6. **AZURE_ML_MODEL_VERSION_TO_DEPLOY**\n",
5454
" - You can find the details of the model version in the images from previous step associated with the respective model.\n",
5555
"\n",
@@ -277,7 +277,7 @@
277277
"**Add deployment to an Azure ML endpoint created above**\n",
278278
"\n",
279279
"Please be aware that deploying, particularly larger models, may take some time. Once the deployment is finished, the provisioning state will be marked as 'Succeeded', as illustrated in the image below.\n",
280-
"<br> <img src=\"./../../assets/aml_endpoint_deployment.png\" alt=\"AML Endpoint Deployment\" height=\"400\"/> <br>"
280+
"<br> <img src=\"./../../../assets/aml_endpoint_deployment.png\" alt=\"AML Endpoint Deployment\" height=\"400\"/> <br>"
281281
]
282282
},
283283
{

doc/getting_started/troubleshooting/download_and_register_hf_model_aml.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"\n",
128128
"9. **AZURE_ML_COMPUTE_NAME**\n",
129129
" - If you already have an Azure ML compute cluster, provide its name. If not, the script will create one based on the instance size and the specified minimum and maximum instances.\n",
130-
" <br> <img src=\"./../../assets/aml_compute_cluster.png\" alt=\"AML compute cluster\" height=\"400\"/> <br>\n",
130+
" <br> <img src=\"./../../../assets/aml_compute_cluster.png\" alt=\"AML compute cluster\" height=\"400\"/> <br>\n",
131131
"\n",
132132
"10. **IDLE_TIME_BEFORE_SCALE_DOWN**\n",
133133
" - Set the duration for the Azure ML cluster to remain active before scaling down due to inactivity, ensuring efficient resource use. Typically, 3-4 hours is ideal for large size models.\n",

doc/getting_started/troubleshooting/score_aml_endpoint.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
"\n",
2626
"1. **AZURE_ML_SCORE_DEPLOYMENT_NAME**\n",
2727
" - This deployment name can be acquired from the Azure ML managed online endpoint, as illustrated in image below.\n",
28-
" <br> <img src=\"./../../assets/aml_deployment_name.png\" alt=\"AML Deployment Name\" height=\"400\"/> <br>\n",
28+
" <br> <img src=\"./../../../assets/aml_deployment_name.png\" alt=\"AML Deployment Name\" height=\"400\"/> <br>\n",
2929
"\n",
3030
"2. **AZURE_ML_MANAGED_ENDPOINT**\n",
3131
" - To obtain the managed endpoint, navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. Copy the REST endpoint as depicted below.\n",
32-
" <br> <img src=\"./../../assets/aml_score_uri.png\" alt=\"AML Score URI\" height=\"400\"/> <br>\n",
32+
" <br> <img src=\"./../../../assets/aml_score_uri.png\" alt=\"AML Score URI\" height=\"400\"/> <br>\n",
3333
"\n",
3434
"3. **AZURE_ML_KEY**\n",
3535
" - Navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. The primary key can be obtained as shown in the subsequent image.\n",
36-
" <br> <img src=\"./../../assets/aml_score_key.png\" alt=\"AML Score Key\" height=\"400\"/> <br>\n",
36+
" <br> <img src=\"./../../../assets/aml_score_key.png\" alt=\"AML Score Key\" height=\"400\"/> <br>\n",
3737
"\n"
3838
]
3939
},
@@ -80,7 +80,7 @@
8080
"**Azure ML endpoint JSON body**\n",
8181
"\n",
8282
"The JSON body can be acquired by the following method: Access the Hugging Face model within the Azure ML model catalog by going to the workspace, then to the studio, selecting 'Model Catalog', and using the search bar to find the model ID. Open the model to view the sample input schema as shown in the image below.\n",
83-
"<br> <img src=\"./../../assets/aml_model_endpoint_schema.png\" alt=\"aml_model_endpoint_schema.png\" height=\"400\"/> <br>\n",
83+
"<br> <img src=\"./../../../assets/aml_model_endpoint_schema.png\" alt=\"aml_model_endpoint_schema.png\" height=\"400\"/> <br>\n",
8484
"\n",
8585
"In addition, we have compiled the details of the request and response for the Hugging Face models hosted on the Azure Machine Learning (Azure ML) endpoint. Please review the [provided link](./hf_aml_model_endpoint_guide.md) to access the JSON request body and response for the Azure ML endpoint. Additionally, you can deduce the schema from the response if a bad request was sent to the inference endpoint."
8686
]

doc/myst.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,7 @@ project:
201201
- file: api/pyrit_scenario.md
202202
- file: api/pyrit_score.md
203203
- file: api/pyrit_setup.md
204-
children:
205-
- file: api/pyrit_setup_initializers.md
206204
- file: api/pyrit_show_versions.md
207-
- file: api/pyrit_ui.md
208205
- file: blog/README.md
209206
children:
210207
- file: blog/2026_04_14_scoring_scorers.md

0 commit comments

Comments
 (0)