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
| 34 | |
| 35 | @dataclass |
| 36 | class Progress: |
| 37 | """ |
| 38 | Schema of the progress file. |
| 39 | |
| 40 | :param taskId: UUID of task, passed from env variables. |
| 41 | :param percentComplete: an int value between 0 and 100 to demonstrate percent complete. |
| 42 | :param name: name of result folder/artifact to upload to NGC |
| 43 | :param lastUpdatedAt: timestamp in RFC 3339 Nano format. |
| 44 | :param metadata: a dict of additional data to include |
| 45 | """ |
| 46 | def __init__(self, |
| 47 | taskId: str, |
| 48 | percentComplete: int, |
| 49 | name: str, |
| 50 | lastUpdatedAt: str, |
| 51 | metadata: dict): |
| 52 | self.taskId = taskId |
| 53 | self.percentComplete = percentComplete |
| 54 | self.name = name |
| 55 | self.lastUpdatedAt = lastUpdatedAt |
| 56 | self.metadata = metadata |
| 57 | |
| 58 | def output_to_json(self): |
| 59 | return json.dumps(self.__dict__) |
| 60 | |
| 61 | |
| 62 | def parse_progress_file(progress_file_path): |
no outgoing calls
no test coverage detected