Skip to content
Draft
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
41 changes: 41 additions & 0 deletions .github/workflows/_build-tutorials-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ jobs:

docker exec -u ci-user -t "${container_name}" sh -c ".jenkins/build.sh"

- name: Upload build log
if: always()
uses: actions/upload-artifact@v4
with:
name: build-log-${{ matrix.shard }}
path: _build/build.log
if-no-files-found: ignore

- name: Teardown Linux
uses: pytorch/test-infra/.github/actions/teardown-linux@main
if: always()
Expand Down Expand Up @@ -148,6 +156,18 @@ jobs:
with:
docker-image: ${{ steps.calculate-docker-image.outputs.docker-image }}

- name: Download worker build logs
uses: actions/download-artifact@v4
with:
pattern: build-log-*
path: _build/worker-logs

- name: Merge build logs
shell: bash
run: |
mkdir -p _build
cat _build/worker-logs/build-log-*/build.log > _build/build.log 2>/dev/null || true

- name: Build
shell: bash
env:
Expand All @@ -158,6 +178,7 @@ jobs:
JOB_TYPE: manager
COMMIT_SOURCE: ${{ github.ref }}
GITHUB_PYTORCHBOT_TOKEN: ${{ secrets.PYTORCHBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_NIGHTLY: ${{ inputs.USE_NIGHTLY }}
run: |
set -ex
Expand All @@ -172,6 +193,7 @@ jobs:
-e JOB_TYPE \
-e COMMIT_SOURCE \
-e GITHUB_PYTORCHBOT_TOKEN \
-e GITHUB_TOKEN \
-e USE_NIGHTLY \
--env-file="/tmp/github_env_${GITHUB_RUN_ID}" \
--tty \
Expand All @@ -184,6 +206,25 @@ jobs:

docker exec -u ci-user -t "${container_name}" sh -c ".jenkins/build.sh"

- name: Generate API deprecation report
if: always()
shell: bash
run: |
python3 -m tools.deprecation_checker.api_report \
--build-log _build/build.log \
-o _build/api_report.md \
--create-issue || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload API deprecation report
if: always()
uses: actions/upload-artifact@v4
with:
name: api-deprecation-report
path: _build/api_report.md
if-no-files-found: ignore

- name: Upload docs preview
uses: seemethere/upload-artifact-s3@v5
if: ${{ github.event_name == 'pull_request' }}
Expand Down
13 changes: 12 additions & 1 deletion .jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then
export FILES_TO_RUN

# Step 3: Run `make docs` to generate HTML files and static files for these tutorialis
make docs
export PYTHONWARNINGS="all::DeprecationWarning,all::FutureWarning"
mkdir -p _build
make docs 2>&1 | tee _build/build.log
test ${PIPESTATUS[0]} -eq 0

# Step 3.1: Run the post-processing script:
python .jenkins/post_process_notebooks.py
Expand Down Expand Up @@ -125,10 +128,15 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then
bash $DIR/remove_invisible_code_block_batch.sh docs
python .jenkins/validate_tutorials_built.py

# Step 5.1: Generate API deprecation report from build warnings
python -m tools.deprecation_checker.api_report --build-log _build/build.log -o _build/api_report.md || true

# Step 6: Copy generated files to S3, tag with commit ID
if [ "${UPLOAD:-0}" -eq 1 ]; then
7z a worker_${WORKER_ID}.7z docs
awsv2 s3 cp worker_${WORKER_ID}.7z s3://${BUCKET_NAME}/${BUILD_PREFIX}/${COMMIT_ID}/worker_${WORKER_ID}.7z
# Upload build log for the manager to merge across shards
awsv2 s3 cp _build/build.log s3://${BUCKET_NAME}/${BUILD_PREFIX}/${COMMIT_ID}/build_log_${WORKER_ID}.txt || true
fi
elif [[ "${JOB_TYPE}" == "manager" ]]; then
# Step 1: Generate no-plot HTML pages for all tutorials
Expand Down Expand Up @@ -156,6 +164,9 @@ elif [[ "${JOB_TYPE}" == "manager" ]]; then
# Step 5.1: Run post-processing script on .ipynb files:
python .jenkins/post_process_notebooks.py

# Step 5.2: API deprecation report is generated by the GHA workflow after
# merging worker build logs from artifacts. See _build-tutorials-base.yml.

# Step 6: Copy generated HTML files and static files to S3
7z a manager.7z docs
awsv2 s3 cp manager.7z s3://${BUCKET_NAME}/${BUILD_PREFIX}/${COMMIT_ID}/manager.7z
Expand Down
Empty file added tools/__init__.py
Empty file.
Empty file.
Loading
Loading