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

introduce conda-lock file for docs #4553

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
skip: "*.pb"
skip: "*.pb,monodocs-environment.lock.yaml"
15 changes: 9 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ jobs:
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: 3.9
mamba-version: "*"
channels: conda-forge
channel-priority: true
activate-environment: monodocs-env
environment-file: monodocs-environment.yaml
- shell: bash -el {0}
run: |
conda install -c conda-forge conda-lock
conda-lock install -n monodocs-env monodocs-environment.lock.yaml
- shell: bash -el {0}
run: |
conda activate monodocs-env
conda info
conda list
conda config --show-sources
Expand All @@ -48,7 +49,9 @@ jobs:
uses: ts-graphviz/setup-graphviz@v1
- name: Build the documentation
shell: bash -el {0}
run: make docs
run: |
conda activate monodocs-env
make docs

generate_kustomize:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ install-piptools: ## Install pip-tools
doc-requirements.txt: doc-requirements.in install-piptools
$(call PIP_COMPILE,doc-requirements.in)

.PHONY: install-conda-lock
install-conda-lock:
pip install conda-lock

.PHONY: conda-lock
conda-lock: install-conda-lock
conda-lock -f monodocs-environment.yaml --without-cuda --lockfile monodocs-environment.lock.yaml

.PHONY: stats
stats:
@generate-dashboard -o deployment/stats/prometheus/flytepropeller-dashboard.json stats/flytepropeller.dashboard.py
Expand Down
11 changes: 8 additions & 3 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"
commands:
- cat monodocs-environment.lock.yaml
- mamba install -c conda-forge conda-lock
- conda-lock install -p /home/docs/monodocs-env monodocs-environment.lock.yaml
- conda info
- conda env list
- cat docs/conf.py
- cd docs && /home/docs/monodocs-env/bin/python -m sphinx -T -E -b html -d docs/_build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html
Comment on lines +11 to +18
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thomasjpfan minor risk (IMO) is that builds.command key is in beta and may change in the future.

Copy link
Member

@thomasjpfan thomasjpfan Dec 8, 2023

Choose a reason for hiding this comment

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

I tried a solution in https://github.com/thomasjpfan/conda-lock-sphinx-test, which works on readthedocs. It uses a noop.yml to create a small environment and immediately overrides it with conda-lock.

I wanted to configure it without the noop.yml, but readthedocs fails to build without it.

As long as it works, I prefer the build.command approach. If it breaks in the future, there is a workaround.


# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

conda:
environment: monodocs-environment.yaml
Loading
Loading