-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8534: Add the first iteration of the doc pipeline that brings the d…
…ocs into the centralized repo #8534: Add packaging of TTNN Docs to the Deployment workflow #8534: Enable the push to the tenstorrent.github.io repo Update TTNN Get started to edit the location of installation.html and the tutorials
- Loading branch information
1 parent
e6f4c70
commit 6ec1596
Showing
3 changed files
with
134 additions
and
4 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
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,115 @@ | ||
name: "Release Docs: package the docs and publish to Docs the repo" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
# Note that people may spam the post-commit pipeline on their branch, and | ||
# we have this docs pipeline in the post-commit pipeline, then people | ||
# would have to wait until the previous one fully completes. That may be | ||
# ok because each post-commit pipeline definitely takes more than 30 min | ||
group: "pages-${{ github.ref }}" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
package-push-docs: | ||
strategy: | ||
# Do not fail-fast because we need to ensure all tests go to completion | ||
# so we try not to get hanging machines | ||
fail-fast: false | ||
matrix: | ||
arch: [grayskull] | ||
env: | ||
DOCS_VERSION: ${{ inputs.version }} | ||
DOCS_REPO: docs-test | ||
ARCH_NAME: ${{ matrix.arch }} | ||
LOGURU_LEVEL: INFO | ||
LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib | ||
environment: dev | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
lfs: false | ||
- name: Set up dynamic env vars for build | ||
run: | | ||
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV | ||
- uses: ./.github/actions/install-metal-deps | ||
with: | ||
os: ubuntu-20.04 | ||
- uses: ./.github/actions/install-metal-dev-deps | ||
with: | ||
os: ubuntu-20.04 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: TTMetal_build_${{ matrix.arch }} | ||
- name: Extract files | ||
run: tar -xvf ttm_${{ matrix.arch }}.tar | ||
- uses: ./.github/actions/install-python-deps | ||
- name: Build Doxygen 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 | ||
doxygen | ||
- name: Clone Shared Docs Repo | ||
run: | | ||
GITHUB_USER=tenstorrent-github-bot | ||
git config --global user.email "${GITHUB_USER}@tenstorrent.com" | ||
git config --global user.name "${GITHUB_USER}" | ||
echo "About to clone" | ||
git clone https://${GITHUB_USER}:${{ secrets.TTBOT_DOCS_ACCESS }}@github.com/tenstorrent/$DOCS_REPO.git | ||
git remote set-url origin https://${GITHUB_USER}::${{ secrets.TTBOT_DOCS_ACCESS }}@github.com/tenstorrent/$DOCS_REPO.git | ||
- name: Package TT-Metalium Docs | ||
run: | | ||
echo "Preparing tt-metalium docs assets" | ||
mkdir tt-metalium | ||
cp -Lr docs/doxygen_build tt-metalium | ||
cp -Lr docs/source/tt-metalium/* tt-metalium | ||
rm tt-metalium/conf.py # Do not change conf.py | ||
echo "Copying the docs into the repo" | ||
cp -r tt-metalium/* $DOCS_REPO/tt-metalium | ||
- name: Package TT-NN Docs | ||
run: | | ||
mkdir ttnn-docs | ||
cp -Lr docs/doxygen_build ttnn-docs | ||
cp -Lr docs/source/ttnn/* ttnn-docs | ||
rm ttnn-docs/conf.py # Do not change conf.py | ||
echo "Copy tutorials and examples for TTNN from a different repo area." | ||
cp -Lr ttnn/examples ttnn-docs/ttnn | ||
echo "Make sure the links are updated in ttnn/usage.rst to the correct spot for the tutorials and examples." | ||
sed -i "s/..\/..\/..\/..\/ttnn\/examples/examples/g" ttnn-docs/ttnn/usage.rst | ||
echo "Change tutorial and installation links in TTNN Get Started." | ||
sed -i "s/.\/..\/ttnn\/ttnn//g" ttnn-docs/ttnn/get_started.rst | ||
sed -i "s/.\/ttnn\/installing/\/installing/g" ttnn-docs/ttnn/get_started.rst | ||
echo "Copying the docs into the repo" | ||
cp -r ttnn-docs/* $DOCS_REPO/ttnn | ||
- name: Push new versions to the Docs repo for publishing | ||
run: | | ||
cd $DOCS_REPO | ||
echo "Register new documentation versions" | ||
python update_tags.py tt-metalium $DOCS_VERSION | ||
python update_tags.py ttnn $DOCS_VERSION | ||
git checkout -b test_v51_deploy | ||
git add . | ||
git commit -m "Update ttnn and tt-metalium docs from pipeline ${{ github.run_id }} with tag $DOCS_VERSION" | ||
echo "Tag commits to identify different versions." | ||
git tag -a ttnn_$DOCS_VERSION -m "ttnn and tt-metalium documentation version $DOCS_VERSION" | ||
git tag -a tt-metalium_$DOCS_VERSION -m "ttnn and tt-metalium documentation version $DOCS_VERSION" | ||
echo "Pushing the new docs" | ||
git push -u origin test_v51_deploy && git push --tags |
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