Skip to content

Conversation

@Aditi2424
Copy link
Owner

This PR adds comprehensive API documentation for SageMaker Python SDK v3 using Sphinx autodoc and autosummary.

Changes

  • Configure Sphinx autodoc to import actual sagemaker modules instead of mocks
  • Add API reference pages for all four main modules (core, train, serve, mlops)
  • Include all v3-examples in documentation navigation
  • Reduce build warnings from 2167 to under 50

Benefits

  • Users can now see real class signatures, methods, and docstrings
  • API documentation shows actual functionality instead of empty mock objects
  • Comprehensive coverage of all available classes and functions
  • Clean build process with minimal warnings

The API documentation now provides useful, actionable information for developers using the SageMaker Python SDK v3.

Aditi2424 and others added 6 commits December 31, 2025 10:31
- Add ReadTheDocs configuration with sphinx-book-theme
- Create comprehensive overview, installation, and quickstart pages
- Set up documentation structure for all core capabilities
- Add custom CSS and Sphinx configuration
- Create symlinks to v3-examples and sagemaker-core directories
- Add docs/_build/ to .gitignore to exclude build artifacts

Co-authored-by: adishaa <adishaa@amazon.com>
…ops and sagemaker core (aws#5446)

* feat: Add basic V3 documentation structure and configuration

- Add ReadTheDocs configuration with sphinx-book-theme
- Create comprehensive overview, installation, and quickstart pages
- Set up documentation structure for all core capabilities
- Add custom CSS and Sphinx configuration
- Create symlinks to v3-examples and sagemaker-core directories
- Add docs/_build/ to .gitignore to exclude build artifacts

* feat: Add comprehensive training, inference, and model customization content

- Add detailed model customization with SFTTrainer, DPOTrainer, RLAIFTrainer, RLVRTrainer
- Include unified ModelTrainer interface for training workflows
- Add ModelBuilder for streamlined inference deployment
- Cover LoRA, full fine-tuning, and advanced ML techniques
- Include migration guides and production-ready examples

* feat: Add ML Ops and SageMaker Core documentation

- Add comprehensive MLOps pipeline orchestration and monitoring
- Include SageMaker Core low-level API documentation
- Cover advanced pipeline features and governance capabilities

---------

Co-authored-by: adishaa <adishaa@amazon.com>
- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks
- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons
- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

Co-authored-by: adishaa <adishaa@amazon.com>
Copy link

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This PR adds comprehensive API documentation for SageMaker Python SDK V3 using Sphinx autodoc and autosummary. While the overall approach is sound, there are several critical configuration issues that must be addressed before merge.

Critical Issues Found:

  1. 🛑 Sphinx Configuration Errors - Duplicate html_theme_options and suppress_warnings definitions that overwrite important settings
  2. 🛑 Security Vulnerability - XSS risk in JavaScript feedback component using insertAdjacentHTML with template literals
  3. Logic Error - Duplicate variable assignment in notebook example that causes confusion

Issues Summary:

  • Configuration Issues: 2 critical Sphinx configuration problems that will break documentation builds
  • Security Issues: 1 XSS vulnerability in JavaScript code
  • Code Quality: 1 variable assignment issue in example notebook
  • Dependency Management: Missing version constraints in requirements.txt

Recommendations:

  1. Fix the duplicate configuration definitions in docs/conf.py
  2. Replace insertAdjacentHTML with safer DOM manipulation methods
  3. Add proper version constraints to all dependencies
  4. Resolve the duplicate variable assignment in the notebook

The documentation structure and content are well-organized, but these configuration and security issues must be resolved to ensure a successful and secure documentation build process.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment on lines 6 to 9
ipykernel
jupyter
pandas
numpy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add version constraints for all dependencies to ensure reproducible builds. Missing version constraints can lead to build failures when newer incompatible versions are released.

Suggested change
ipykernel
jupyter
pandas
numpy
sphinx>=4.0.0
sphinx-book-theme>=1.0.0
myst-nb>=0.17.0
jupyter-book>=0.15.0
sphinx-design>=0.4.0
ipykernel>=6.0.0
jupyter>=1.0.0
pandas>=1.3.0
numpy>=1.21.0

</div>
`;

article.insertAdjacentHTML('beforeend', feedbackHTML);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Security Vulnerability: Using insertAdjacentHTML with template literals creates a potential XSS vulnerability. User input could be injected into the HTML template. Use createElement and textContent instead for safer DOM manipulation.

Comment on lines +736 to +742
"s3_checkpoint_path = get_s3_manifest(training_output_s3_uri)\n",
"\n",
"\n",
"bedrock_client = boto3.Session().client(service_name=\"bedrock\", region_name=REGION)\n",
"\n",
"\n",
"s3_checkpoint_path = describe_training_response[\"CheckpointConfig\"][\"S3Uri\"]\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable s3_checkpoint_path is assigned twice with different values. The first assignment from get_s3_manifest() is overwritten by the second assignment from describe_training_response["CheckpointConfig"]["S3Uri"]. This creates confusion and potential runtime errors.

Suggested change
"s3_checkpoint_path = get_s3_manifest(training_output_s3_uri)\n",
"\n",
"\n",
"bedrock_client = boto3.Session().client(service_name=\"bedrock\", region_name=REGION)\n",
"\n",
"\n",
"s3_checkpoint_path = describe_training_response[\"CheckpointConfig\"][\"S3Uri\"]\n",
s3_checkpoint_path = get_s3_manifest(training_output_s3_uri)
bedrock_client = boto3.Session().client(service_name="bedrock", region_name=REGION)
# Use the checkpoint path from the manifest
# s3_checkpoint_path = describe_training_response["CheckpointConfig"]["S3Uri"] # Remove this duplicate assignment

Aditi2424 and others added 23 commits January 2, 2026 01:45
)

* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

---------

Co-authored-by: adishaa <adishaa@amazon.com>
* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

* doc: Documentation v3 improvements

* docs: Update requirements.txt for documentation build

* docs: Add sphinx-design to requirements.txt for ReadTheDocs build

---------

Co-authored-by: adishaa <adishaa@amazon.com>
* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

* doc: Documentation v3 improvements

* docs: Update requirements.txt for documentation build

* docs: Add sphinx-design to requirements.txt for ReadTheDocs build

* docs: Remove unsupported LoRAConfig/TrainingConfig and update preference_dataset to training_dataset

* doc: Update inference docs

---------

Co-authored-by: adishaa <adishaa@amazon.com>
* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

* doc: Documentation v3 improvements

* docs: Update requirements.txt for documentation build

* docs: Add sphinx-design to requirements.txt for ReadTheDocs build

* docs: Remove unsupported LoRAConfig/TrainingConfig and update preference_dataset to training_dataset

* doc: Update inference docs

* docs: Update ModelBuilder example in overview.rst with correct V3 workflow

* Clear Clarify notebook output

---------

Co-authored-by: adishaa <adishaa@amazon.com>
- Fix duplicate html_theme_options in conf.py that was hiding GitHub repo and issues buttons
- Update overview note to mention V3 breaking changes and link to release notes
* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

* doc: Documentation v3 improvements

* docs: Update requirements.txt for documentation build

* docs: Add sphinx-design to requirements.txt for ReadTheDocs build

* docs: Remove unsupported LoRAConfig/TrainingConfig and update preference_dataset to training_dataset

* doc: Update inference docs

* docs: Update ModelBuilder example in overview.rst with correct V3 workflow

* Clear Clarify notebook output

* Fix GitHub buttons and update V3 breaking changes note

- Fix duplicate html_theme_options in conf.py that was hiding GitHub repo and issues buttons
- Update overview note to mention V3 breaking changes and link to release notes

* doc: Update MLOps example notebook titles

* doc: Update notebook titles

* doc: Update model customization page

---------

Co-authored-by: adishaa <adishaa@amazon.com>
* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

* doc: Documentation v3 improvements

* docs: Update requirements.txt for documentation build

* docs: Add sphinx-design to requirements.txt for ReadTheDocs build

* docs: Remove unsupported LoRAConfig/TrainingConfig and update preference_dataset to training_dataset

* doc: Update inference docs

* docs: Update ModelBuilder example in overview.rst with correct V3 workflow

* Clear Clarify notebook output

* Fix GitHub buttons and update V3 breaking changes note

- Fix duplicate html_theme_options in conf.py that was hiding GitHub repo and issues buttons
- Update overview note to mention V3 breaking changes and link to release notes

* doc: Update MLOps example notebook titles

* doc: Update notebook titles

* doc: Update model customization page

* doc: Address latest feedback to bring parity with aws docs

* doc: fix what's new heading

---------

Co-authored-by: adishaa <adishaa@amazon.com>
adishaa and others added 6 commits January 8, 2026 13:31
* feat: Add comprehensive V3 documentation with enhanced UI

- Add complete documentation structure for SageMaker Python SDK V3
- Implement eye-catching card-based UI for 'What's New' section
- Position model customization as flagship V3 feature with prominent highlighting
- Add comprehensive content for training, inference, ML ops, and core modules
- Include collapsed navigation with model customization emphasis
- Set up ReadTheDocs configuration and Sphinx documentation system
- Add installation guide, quickstart, and overview pages
- Link to staging repository examples and notebooks

* feat: Add comprehensive feedback component with light theme

- Add thumbs up/down feedback buttons with SVG icons
- Show detailed feedback options when thumbs down is selected
- Include 5 checkbox options: hard to understand, code doesn't work, couldn't find, out of date, other
- Add textarea for additional feedback details
- Implement light theme styling with proper contrast
- Position component at bottom of each documentation page
- Include analytics tracking for feedback data
- Support multiple selection of feedback reasons

* Add API documentation using autodoc and autosummary

* doc: Documentation v3 improvements

* docs: Update requirements.txt for documentation build

* docs: Add sphinx-design to requirements.txt for ReadTheDocs build

* docs: Remove unsupported LoRAConfig/TrainingConfig and update preference_dataset to training_dataset

* doc: Update inference docs

* docs: Update ModelBuilder example in overview.rst with correct V3 workflow

* Clear Clarify notebook output

* Fix GitHub buttons and update V3 breaking changes note

- Fix duplicate html_theme_options in conf.py that was hiding GitHub repo and issues buttons
- Update overview note to mention V3 breaking changes and link to release notes

* doc: Update MLOps example notebook titles

* doc: Update notebook titles

* doc: Update model customization page

* doc: Address latest feedback to bring parity with aws docs

* doc: fix what's new heading

* doc: Reorganize model customization

---------

Co-authored-by: adishaa <adishaa@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants