class_docstr: ``CheckpointContext`` gives access to checkpoint-related features of a Determined cluster.
class_docstr_tok: ["``","CheckpointContext","``","gives","access","to","checkpoint-related","features","of","a","Determined","cluster","."]
docstr: After having uploaded a checkpoint, report its existence to the master.
docstr_tok: ["After","having","uploaded","a","checkpoint",",","report","its","existence","to","the","master","."]
code: def _report_checkpoint(
      self,
      storage_id: str,
      resources: Optional[Dict[str, int]] = None,
      metadata: Optional[Dict[str, Any]] = None,
  ) -> None:
      """
      After having uploaded a checkpoint, report its existence to the master.
      """
      resources = resources or {}
      metadata = metadata or {}
  
      if "steps_completed" not in metadata:
          raise ValueError(
              "metadata for reported checkpoints, in the current implementation, requires a "
              "'steps_completed' item, which has not been provided"
          )
  
      ckpt = bindings.v1Checkpoint(
          allocationId=self._allocation_id,
          metadata=metadata,
          resources={k: str(v) for k, v in resources.items()},
          taskId=self._task_id,
          training=bindings.v1CheckpointTrainingMetadata(),
          uuid=storage_id,
          reportTime=datetime.datetime.now(
              datetime.timezone.utc
          ).isoformat(),
          state=bindings.checkpointv1State.COMPLETED,
      )
      bindings.post_ReportCheckpoint(self._session, body=ckpt)
      logger.info(f"Reported checkpoint to master {storage_id}")
  
      # Also sync tensorboard.
      if self._tensorboard_mode == core.TensorboardMode.AUTO:
          assert self._tensorboard_manager is not None
          self._tensorboard_manager.sync()
  
imports: import contextlib
  import datetime
  import enum
  import hashlib
  import json
  import logging
  import os
  import pathlib
  import uuid
  from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Union
  from determined import core, tensorboard
  from determined.common import api, storage
  from determined.common.api import bindings
label_desc: Use image node_id 16 for calling the CheckpointContext obj's underlying member method code with example usage: obj._report_checkpoint(storage_id, resources, metadata) without return types