generated from PrivateAIM/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hub): add pp and create containers EP
- Loading branch information
Showing
6 changed files
with
80 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Post-processing methods for passing returned responses to frontend.""" | ||
|
||
|
||
def parse_containers(analysis_response: dict) -> dict: | ||
"""Parse analysis response from the hub.""" | ||
containers = [] | ||
for hit in analysis_response["data"]: | ||
data = { | ||
"id": hit["id"], # id | ||
"name": hit["analysis"]["name"], | ||
"job_id": hit["analysis"]["id"], | ||
"image": hit["analysis"]["master_image_id"], | ||
"state": hit["run_status"], | ||
"status": hit["analysis"]["result_status"], | ||
"next_tag": "Köln", # TODO remove/replace | ||
"repo": "/data", | ||
"train_class_id": "choochoo", | ||
} | ||
containers.append(data) | ||
|
||
return {"containers": containers} | ||
|
||
|
||
def test_print(): | ||
print("test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters