Skip to content

Commit

Permalink
#4003: Integrate build_rst_sweep_results.py into build docs flow to g…
Browse files Browse the repository at this point in the history
…enerate automated RSTs during build time
  • Loading branch information
vtangTT authored and tt-rkim committed May 21, 2024
1 parent 00e1fd8 commit 295825c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/docs-latest-public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,13 @@ jobs:
- uses: ./.github/actions/install-python-deps
- name: Build Docs
timeout-minutes: 15
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
./tests/scripts/run_build_docs.sh
- name: Build additional ttnn sweeps docs
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
export PYTHONPATH=$(pwd)
source ${{ github.workspace }}/python_env/bin/activate
cd docs/
make ttnn_sweeps/check_directory
make ttnn_sweeps
- name: Prepare artifact - move output
run: |
mkdir gh_pages
Expand Down
12 changes: 2 additions & 10 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ PORT ?= 8888
DOCS_VERSION ?= latest

GITHUB_TOKEN ?= INSERT_TOKEN_HERE
TTNN_SWEEPS_DIR = $(HTMLDIR)/ttnn/ttnn_sweeps
TTNN_SWEEPS_DIR = source/ttnn/ttnn_sweeps

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help default clean html publish build_doxygen sphinx_build_dir html/ttnn html/tt-metalium ttnn_sweeps ttnn_sweeps/check_directory
.PHONY: help default clean html publish build_doxygen sphinx_build_dir html/ttnn html/tt-metalium ttnn_sweeps

default: html

Expand Down Expand Up @@ -49,14 +49,6 @@ html: html/tt-metalium html/ttnn
mv -f $(TTNN_BUILDDIR) $(HTMLDIR)/ttnn
cp source/index.html $(HTMLDIR)/

ttnn_sweeps/check_directory:
@if [ -d "$(TTNN_SWEEPS_DIR)" ]; then \
echo "Error: ttnn sweeps dir $(TTNN_SWEEPS_DIR) exists already."; \
exit 1; \
else \
mkdir -p $(TTNN_SWEEPS_DIR); \
fi

ttnn_sweeps:
@echo "Note that GITHUB_TOKEN must be set before calling this"
@cd .. && python tests/ttnn/sweep_tests/build_rst_sweep_results.py --dir docs/$(TTNN_SWEEPS_DIR) --token $(GITHUB_TOKEN)
Expand Down
2 changes: 2 additions & 0 deletions docs/source/ttnn/ttnn_sweeps/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

Placeholder title
=================

You must generate ttnn_sweeps here.
1 change: 1 addition & 0 deletions tests/scripts/run_build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ echo "Checking docs build..."
cd $TT_METAL_HOME/docs
python -m pip install -r requirements-docs.txt
make clean
make ttnn_sweeps
make html
2 changes: 1 addition & 1 deletion tests/ttnn/sweep_tests/build_rst_sweep_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def diff_results(temp_dir_path, most_recent_run_index, total_runs, directory_for
All Sweep Tests
--------------------
---------------
These are the sweep tests for commit hash {most_recent_commit_hash}
Expand Down

0 comments on commit 295825c

Please sign in to comment.