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
100 changes: 100 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,103 @@ html[data-theme="dark"] .navbar-brand .title {
html[data-theme="dark"] p {
color: #d1d5db !important;
}

.current.active>a {
background-color: aliceblue !important;
}

.bd-sidebar-primary li.has-children .caption,
.bd-sidebar-primary li.has-children>.reference {
margin-right: inherit;
}

nav.bd-links li>a {
margin-right: inherit;
}

.table tbody tr:hover {
background: none !important;
}

.wy-table-responsive table td,
.wy-table-responsive table th {
white-space: normal;
}

.wy-table-responsive {
margin-bottom: 24px;
max-width: 100%;
overflow: visible;
}

.pagination {
display: inline-block;
}

.pagination a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
}

.pagination a.active {
background-color: #2a80b9;
color: white;
}

.pagination a:hover:not(.active) {
background-color: #ddd;
}


dl.py.class dt.sig.sig-object.py {
display: table;
margin: 6px 0;
font-size: 90%;
line-height: normal;
background: #e7f2fa !important;
color: #2980b9 !important;
border-top: 3px solid #6ab0de !important;
padding: 6px;
position: relative;
}

dl.py.method dt.sig.sig-object.py {
display: table;
margin: 6px 0;
font-size: 90%;
line-height: normal;
background: #e7f2fa !important;
color: #2980b9 !important;
border-left: 3px solid #6ab0de !important;
border-top: none !important;
padding: 6px;
position: relative;
}

dl.py.attribute dt.sig.sig-object.py {
margin-bottom: 6px;
border: none;
border-left: 3px solid #ccc;
background: #f0f0f0 !important;
color: #555 !important;
border-top: none !important;
}

.sig-prename.descclassname {
color: #000;
}

.field-list {
display: grid !important;
grid-template-columns: 0.5fr 2fr !important;
}

.field-list dt {
background: transparent !important;
}

.py.class dl {
margin: 1rem 0 !important;
}
39 changes: 39 additions & 0 deletions doc/cli/cli_index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#############
CLI Reference
#############

.. toctree::
:hidden:
:maxdepth: 2

cluster
inference
training

Complete reference for the SageMaker HyperPod CLI commands.

.. container::

.. grid:: 1 1 3 3
:gutter: 3

.. grid-item-card:: Cluster CLI
:link: cluster
:link-type: doc
:class-card: sd-border-secondary

Cluster management CLI commands and parameters.

.. grid-item-card:: Inference CLI
:link: inference
:link-type: doc
:class-card: sd-border-secondary

Inference CLI commands and parameters.

.. grid-item-card:: Training CLI
:link: training
:link-type: doc
:class-card: sd-border-secondary

Training CLI commands and parameters.
41 changes: 41 additions & 0 deletions doc/cli/cluster.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Cluster CLI
===========

This page documents the CLI commands for managing HyperPod clusters.

Cluster Information Commands
----------------------------

List Clusters
~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.cluster:list_cluster
:prog: hyp list-cluster
:show-nested:

Cluster Context Commands
------------------------

Set Cluster Context
~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.cluster:set_cluster_context
:prog: hyp set-cluster-context
:show-nested:

Get Cluster Context
~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.cluster:get_cluster_context
:prog: hyp get-cluster-context
:show-nested:

Monitoring Commands
-------------------

Get Monitoring Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.cluster:get_monitoring
:prog: hyp get-monitoring
:show-nested:
44 changes: 44 additions & 0 deletions doc/cli/inference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Inference CLI
=============

This page documents the CLI commands for managing inference endpoints.

.. note::
Create commands use dynamic parameter generation and are documented in the :doc:`../cli_reference` page.

Invoke Commands
---------------

Invoke Custom Endpoint
~~~~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.inference:custom_invoke
:prog: hyp invoke
:show-nested:

List Commands
-------------

List Jumpstart Endpoints
~~~~~~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.inference:js_list
:prog: hyp list
:show-nested:

List Custom Endpoints
~~~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.inference:custom_list
:prog: hyp list
:show-nested:

Describe Commands
-----------------

Describe Jumpstart Endpoint
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.inference:js_describe
:prog: hyp describe
:show-nested:
54 changes: 54 additions & 0 deletions doc/cli/training.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Training CLI
============

This page documents the CLI commands for managing PyTorch training jobs.

.. note::
Create commands use dynamic parameter generation and are documented in the :doc:`../cli_training` page.

List Commands
-------------

List PyTorch Jobs
~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.training:list_jobs
:prog: hyp list
:show-nested:

Describe Commands
-----------------

Describe PyTorch Job
~~~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.training:pytorch_describe
:prog: hyp describe
:show-nested:

Delete Commands
---------------

Delete PyTorch Job
~~~~~~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.training:pytorch_delete
:prog: hyp delete
:show-nested:

Pod Management Commands
-----------------------

List Job Pods
~~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.training:pytorch_list_pods
:prog: hyp list-pods
:show-nested:

Get Pod Logs
~~~~~~~~~~~~

.. click:: sagemaker.hyperpod.cli.commands.training:pytorch_get_logs
:prog: hyp get-logs
:show-nested:
62 changes: 61 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,42 @@

def setup(app):
"""Register our sphinx hooks."""
# Add CLI source path for sphinx-click
cli_path = Path(__file__).parent.parent / "src"
sys.path.insert(0, str(cli_path))

# Mock the problematic decorators
from unittest.mock import MagicMock

# Create a mock that acts like a decorator
def mock_generate_click_command(*args, **kwargs):
def decorator(func):
# Return the original function with minimal Click attributes
func.__click_params__ = []
return func
return decorator

# Mock telemetry decorator
def mock_telemetry_emitter(*args, **kwargs):
def decorator(func):
# Return the original function unchanged
return func
return decorator

# Mock the entire inference_utils module
mock_inference_utils = MagicMock()
mock_inference_utils.generate_click_command = mock_generate_click_command
sys.modules['sagemaker.hyperpod.cli.inference_utils'] = mock_inference_utils

# Mock the training_utils module
mock_training_utils = MagicMock()
mock_training_utils.generate_click_command = mock_generate_click_command
sys.modules['sagemaker.hyperpod.cli.training_utils'] = mock_training_utils

# Mock the telemetry module
mock_telemetry = MagicMock()
mock_telemetry._hyperpod_telemetry_emitter = mock_telemetry_emitter
sys.modules['sagemaker.hyperpod.common.telemetry.telemetry_logging'] = mock_telemetry


# Get version from setup.py
Expand Down Expand Up @@ -71,10 +107,34 @@ def get_version():
"sphinx_copybutton",
"sphinx.ext.autosummary",
"sphinx.ext.autosectionlabel",
"sphinx_click",
]


autodoc_mock_imports = ["pyspark", "feature_store_pyspark", "py4j"]
autodoc_mock_imports = [
"pyspark",
"feature_store_pyspark",
"py4j",
"hyperpod_jumpstart_inference_template",
"hyperpod_custom_inference_template",
"hyperpod_pytorch_job_template",
"hyperpod_pytorch_job_template.registry",
"sagemaker_core",
"boto3",
"botocore",
"tabulate",
"kubernetes",
"kubernetes.client",
"ratelimit",
"sagemaker.hyperpod.cli.clients.kubernetes_client",
"sagemaker.hyperpod.cli.inference_utils",
"sagemaker.hyperpod.cli.inference_utils.generate_click_command",
"sagemaker.hyperpod.inference.hp_jumpstart_endpoint",
"sagemaker.hyperpod.inference.hp_endpoint",
"sagemaker.hyperpod.common.telemetry.telemetry_logging",
"sagemaker.hyperpod.common.telemetry.constants",
"sagemaker.hyperpod.common.utils"
]

source_suffix = {
'.rst': 'restructuredtext',
Expand Down
1 change: 1 addition & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ keywords:
Installation <installation>
Getting Started <getting_started>
CLI Reference <cli_reference>
<!-- CLI API Reference <cli/cli_index> -->
SDK reference <api/api_index>
Advanced Resources <advanced_resources>
```
Expand Down
4 changes: 4 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ linkify-it-py>=2.0.0
sphinx-design>=0.5.0
sphinx-tabs>=3.4.1
sphinx-copybutton
sphinx-click
pydantic
kubernetes
docutils>=0.18.1,<=0.19