From 8d728cda9d73f2f3655e6530385cd5383c68b536 Mon Sep 17 00:00:00 2001 From: Vincent Tang Date: Tue, 30 Apr 2024 22:34:51 +0000 Subject: [PATCH] #4003: Integrate build_rst_sweep_results.py into build docs flow to generate automated RSTs during build time --- .github/workflows/docs-latest-public.yaml | 11 ++--------- docs/Makefile | 12 ++---------- docs/source/ttnn/ttnn_sweeps/index.rst | 2 ++ tests/scripts/run_build_docs.sh | 1 + tests/ttnn/sweep_tests/build_rst_sweep_results.py | 2 +- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docs-latest-public.yaml b/.github/workflows/docs-latest-public.yaml index 98263671de53..9aecbea9a086 100644 --- a/.github/workflows/docs-latest-public.yaml +++ b/.github/workflows/docs-latest-public.yaml @@ -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 diff --git a/docs/Makefile b/docs/Makefile index 461e4191a195..ee00c5343e56 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -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 @@ -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) diff --git a/docs/source/ttnn/ttnn_sweeps/index.rst b/docs/source/ttnn/ttnn_sweeps/index.rst index 92f9ea72b93f..29212274b758 100644 --- a/docs/source/ttnn/ttnn_sweeps/index.rst +++ b/docs/source/ttnn/ttnn_sweeps/index.rst @@ -2,3 +2,5 @@ Placeholder title ================= + +You must generate ttnn_sweeps here. diff --git a/tests/scripts/run_build_docs.sh b/tests/scripts/run_build_docs.sh index 66dc0d36cebd..af7987df701b 100755 --- a/tests/scripts/run_build_docs.sh +++ b/tests/scripts/run_build_docs.sh @@ -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 diff --git a/tests/ttnn/sweep_tests/build_rst_sweep_results.py b/tests/ttnn/sweep_tests/build_rst_sweep_results.py index 8a3f666db7a9..2041c7983bde 100644 --- a/tests/ttnn/sweep_tests/build_rst_sweep_results.py +++ b/tests/ttnn/sweep_tests/build_rst_sweep_results.py @@ -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}