MCPcopy Create free account
hub / github.com/NVIDIA/nvcf / Progress

Class Progress

examples/task-samples/task-simple-sample/main.py:42–65  ·  view source on GitHub ↗

Schema of the progress file. :param taskId: UUID of task, passed from env variables. :param percentComplete: an int value between 0 and 100 to demonstrate percent complete. :param name: name of result folder/artifact to upload to NGC :param lastUpdatedAt: timestamp in RFC 3339

Source from the content-addressed store, hash-verified

40
41@dataclass
42class Progress:
43 """
44 Schema of the progress file.
45
46 :param taskId: UUID of task, passed from env variables.
47 :param percentComplete: an int value between 0 and 100 to demonstrate percent complete.
48 :param name: name of result folder/artifact to upload to NGC
49 :param lastUpdatedAt: timestamp in RFC 3339 Nano format.
50 :param metadata: a dict of additional data to include
51 """
52 def __init__(self,
53 taskId: str,
54 percentComplete: int,
55 name: str,
56 lastUpdatedAt: str,
57 metadata: dict):
58 self.taskId = taskId
59 self.percentComplete = percentComplete
60 self.name = name
61 self.lastUpdatedAt = lastUpdatedAt
62 self.metadata = metadata
63
64 def output_to_json(self):
65 return json.dumps(self.__dict__)
66
67
68def parse_progress_file(progress_file_path):

Callers 3

parse_progress_fileFunction · 0.70
heartbeatFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected