Skip to content

Revamp Sagemaker doc #1706

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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 8 additions & 4 deletions .github/workflows/sagemaker_build_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Build sagemaker documentation
name: Build SageMaker Documentation

on:
push:
paths:
- "docs/sagemaker/**"
branches:
- main
- doc-builder*
paths:
- docs/sagemaker/**
- .github/workflows/sagemaker_build_documentation.yaml

jobs:
build:
Expand All @@ -14,7 +16,9 @@ jobs:
commit_sha: ${{ github.sha }}
package: hub-docs
package_name: sagemaker
path_to_docs: hub-docs/docs/sagemaker/
path_to_docs: hub-docs/docs/sagemaker/source
additional_args: --not_python_module
pre_command: cd hub-docs/docs/sagemaker && make docs
secrets:
token: ${{ secrets.HUGGINGFACE_PUSH }}
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
8 changes: 5 additions & 3 deletions .github/workflows/sagemaker_build_pr_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Build sagemaker PR Documentation
name: Build SageMaker PR Documentation

on:
pull_request:
paths:
- "docs/sagemaker/**"
- docs/sagemaker/**
- .github/workflows/sagemaker_build_pr_documentation.yaml

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -17,5 +18,6 @@ jobs:
pr_number: ${{ github.event.number }}
package: hub-docs
package_name: sagemaker
path_to_docs: hub-docs/docs/sagemaker/
path_to_docs: hub-docs/docs/sagemaker/source
additional_args: --not_python_module
pre_command: cd hub-docs/docs/sagemaker && make docs
3 changes: 1 addition & 2 deletions .github/workflows/sagemaker_delete_doc_comment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Delete sagemaker doc comment trigger
name: Delete SageMaker PR Documentation Comment

on:
pull_request:
types: [ closed ]


jobs:
delete:
uses: huggingface/doc-builder/.github/workflows/delete_doc_comment_trigger.yml@main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sagemaker_upload_pr_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Upload sagemaker PR Documentation
name: Upload SageMaker PR Documentation

on:
workflow_run:
workflows: ["Build sagemaker PR Documentation"]
workflows: ["Build SageMaker PR Documentation"]
types:
- completed

Expand All @@ -13,4 +13,4 @@ jobs:
package_name: sagemaker
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
34 changes: 34 additions & 0 deletions docs/sagemaker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: docs clean help

docs: clean
@echo "Processing README.md files from examples/gke, examples/cloud-run, and examples/vertex-ai..."
@mkdir -p source/examples
@echo "Converting Jupyter Notebooks to MDX..."
@doc-builder notebook-to-mdx notebooks/sagemaker-sdk/
@echo "Auto-generating example files for documentation..."
@python scripts/auto-generate-examples.py
@echo "Cleaning up generated Markdown Notebook files..."
@find notebooks/sagemaker-sdk -name "sagemaker-notebook.md" -type f -delete
@echo "Generating YAML tree structure and appending to _toctree.yml..."
@python scripts/auto-update-toctree.py
@echo "YAML tree structure appended to docs/source/_toctree.yml"
@echo "Documentation setup complete."

clean:
@echo "Cleaning up generated documentation..."
@rm -rf source/examples
@awk '/^# GENERATED CONTENT DO NOT EDIT!/,/^# END GENERATED CONTENT/{next} {print}' source/_toctree.yml > source/_toctree.yml.tmp && mv source/_toctree.yml.tmp source/_toctree.yml
@echo "Cleaning up generated Markdown Notebook files (if any)..."
@find notebooks/sagemaker-sdk -name "sagemaker-notebook.md" -type f -delete
@echo "Cleanup complete."

serve:
@echo "Serving documentation via doc-builder"
doc-builder preview sagemaker source/ --not_python_module

help:
@echo "Usage:"
@echo " make docs - Auto-generate the examples for the docs"
@echo " make clean - Remove the auto-generated docs"
@echo " make help - Display this help message"

10 changes: 0 additions & 10 deletions docs/sagemaker/_toctree.yml

This file was deleted.

84 changes: 0 additions & 84 deletions docs/sagemaker/index.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading