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
| 40 | |
| 41 | @dataclass |
| 42 | class 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 | |
| 68 | def parse_progress_file(progress_file_path): |
no outgoing calls
no test coverage detected