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
| 69 | |
| 70 | @dataclass |
| 71 | class Progress: |
| 72 | """ |
| 73 | Schema of the progress file. |
| 74 | |
| 75 | :param taskId: UUID of task, passed from env variables. |
| 76 | :param percentComplete: an int value between 0 and 100 to demonstrate percent complete. |
| 77 | :param name: name of result folder/artifact to upload to NGC |
| 78 | :param lastUpdatedAt: timestamp in RFC 3339 Nano format. |
| 79 | :param metadata: a dict of additional data to include |
| 80 | """ |
| 81 | |
| 82 | def __init__( |
| 83 | self, |
| 84 | taskId: str, |
| 85 | percentComplete: int, |
| 86 | name: str, |
| 87 | lastUpdatedAt: str, |
| 88 | metadata: dict, |
| 89 | ): |
| 90 | self.taskId = taskId |
| 91 | self.percentComplete = percentComplete |
| 92 | self.name = name |
| 93 | self.lastUpdatedAt = lastUpdatedAt |
| 94 | self.metadata = metadata |
| 95 | |
| 96 | def output_to_json(self): |
| 97 | return json.dumps(self.__dict__) |
| 98 | |
| 99 | |
| 100 | def parse_progress_file(progress_file_path): |
no outgoing calls
no test coverage detected