-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra(docs): containerize and incremental builds
- Loading branch information
Showing
10 changed files
with
117 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,7 +325,7 @@ jobs: | |
|
||
- name: Test building docs | ||
run: | | ||
cd docs && ./docker.sh | ||
cd docs && ./ci.sh | ||
test-readme: | ||
|
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,8 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
( | ||
cd docker \ | ||
&& docker compose build \ | ||
&& docker compose run --rm sphinx | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Use the official Sphinx base image | ||
FROM sphinxdoc/sphinx:8.0.2 | ||
|
||
# Set working directory for docs | ||
WORKDIR /docs | ||
|
||
# Step 1: Install necessary system dependencies including Pandoc, with caching for apt-get | ||
RUN --mount=type=cache,target=/var/cache/apt \ | ||
--mount=type=cache,target=/var/lib/apt \ | ||
apt-get update && apt-get install -y pandoc && rm -rf /var/lib/apt/lists/* | ||
|
||
# Step 2: Copy project files needed for pip install (setup.py, setup.cfg, versioneer.py, README.md) | ||
COPY ../../setup.py ../../setup.cfg ../../versioneer.py ../../README.md ./ | ||
|
||
# Step 3: Install the project dependencies with pip, including docs extras | ||
RUN python3 -m pip install --no-cache-dir -e .[docs] | ||
|
||
# Step 4: Copy the graphistry source files into the container | ||
COPY ../../graphistry /graphistry | ||
ENV PYTHONPATH="/graphistry:${PYTHONPATH}" | ||
|
||
# Step 5: Copy the build script into the container | ||
COPY docs/docker/build-docs.sh /build-docs.sh | ||
RUN chmod +x /build-docs.sh | ||
|
||
# Step 6: Set the working directory for Sphinx to the `source/` folder | ||
WORKDIR /docs/source | ||
|
||
# Step 7: Run the script to build the documentation | ||
CMD ["/build-docs.sh"] |
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,10 @@ | ||
#!/bin/sh | ||
|
||
# Build the HTML documentation incrementally | ||
sphinx-build -b html -d /docs/doctrees . /docs/_build/html | ||
|
||
# Build the EPUB documentation incrementally | ||
sphinx-build -b epub -d /docs/doctrees . /docs/_build/epub | ||
|
||
# Build the PDF documentation incrementally | ||
sphinx-build -b latex -d /docs/doctrees . /docs/_build/latexpdf |
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,15 @@ | ||
# docs/docker/docker-compose.yml | ||
version: '3' | ||
services: | ||
sphinx: | ||
build: | ||
context: ../.. # Use project root as context | ||
dockerfile: docs/docker/Dockerfile # Specify the Dockerfile | ||
volumes: | ||
- ../../docs/source:/docs/source # Mount the `docs/source` folder to allow live editing | ||
- ../../demos:/docs/source/demos # Mount the `demos` folder for live editing | ||
- ../../docs/_build:/docs/_build # Mount the Sphinx build output to a directory on the host | ||
- ../../docs/doctrees:/docs/doctrees # Mount doctrees to persist build state | ||
environment: | ||
- USER_ID=${UID} # Pass user ID for permission handling | ||
|
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