Skip to content

Commit b026de9

Browse files
authored
MRG: Merge pull request #536 from octue/fix/use-octue-JSON-encoder-when-uploading-manifests
Fix manifest upload and analysis error logging
2 parents 24b0ba0 + 993bbb1 commit b026de9

File tree

10 files changed

+303
-180
lines changed

10 files changed

+303
-180
lines changed

docs/source/inter_service_compatibility.rst

Lines changed: 117 additions & 115 deletions
Large diffs are not rendered by default.

octue/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def run(service_config, input_dir, output_file, output_manifest_file, monitor_me
158158
handle_monitor_message=monitor_message_handler,
159159
)
160160

161-
click.echo(json.dumps(analysis.output_values))
161+
click.echo(json.dumps(analysis.output_values, cls=OctueJSONEncoder))
162162

163163
if analysis.output_values and output_file:
164164
if not os.path.exists(os.path.dirname(output_file)):

octue/cloud/emulators/_pub_sub.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from octue.cloud.pub_sub import Subscription, Topic
88
from octue.cloud.pub_sub.service import Service
99
from octue.resources import Manifest
10+
from octue.utils.encoders import OctueJSONEncoder
1011

1112

1213
logger = logging.getLogger(__name__)
@@ -306,7 +307,8 @@ def ask(
306307
self.children[service_id].answer(
307308
MockMessage(
308309
data=json.dumps(
309-
{"input_values": input_values, "input_manifest": input_manifest, "children": children}
310+
{"input_values": input_values, "input_manifest": input_manifest, "children": children},
311+
cls=OctueJSONEncoder,
310312
).encode(),
311313
question_uuid=question_uuid,
312314
forward_logs=subscribe_to_logs,

octue/cloud/pub_sub/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def _send_monitor_message(self, data, topic, timeout=30):
459459
self._send_message(
460460
{
461461
"type": "monitor_message",
462-
"data": json.dumps(data),
462+
"data": json.dumps(data, cls=OctueJSONEncoder),
463463
"message_number": topic.messages_published,
464464
},
465465
topic=topic,

octue/metadata/recorded_questions.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@
5454
{"parent_sdk_version": "0.39.0", "question": {"data": "{\"input_values\": {\"height\": 4, \"width\": 72}, \"input_manifest\": \"{\\n \\\"datasets\\\": {\\n \\\"my_dataset\\\": \\\"/var/folders/sk/hf5fbp616c77tsys9lz55qn40000gp/T/tmp664lr951\\\"\\n },\\n \\\"id\\\": \\\"57a78545-f40f-4971-bff9-b138bf1d6292\\\",\\n \\\"name\\\": null\\n}\", \"children\": null}", "attributes": {"question_uuid": "7a8eed0b-bd2d-4eb7-93b3-5eb8244c812d", "forward_logs": "1", "allow_save_diagnostics_data_on_crash": "1", "octue_sdk_version": "0.39.0"}}}
5555
{"parent_sdk_version": "0.40.0", "question": {"data": "{\"input_values\": {\"height\": 4, \"width\": 72}, \"input_manifest\": \"{\\n \\\"datasets\\\": {\\n \\\"my_dataset\\\": \\\"/var/folders/sk/hf5fbp616c77tsys9lz55qn40000gp/T/tmppnbc6rcc\\\"\\n },\\n \\\"id\\\": \\\"31440887-beef-41a3-935f-08adbe8dbbdc\\\",\\n \\\"name\\\": null\\n}\", \"children\": null}", "attributes": {"question_uuid": "f66edd6e-517c-4c26-9d60-16cb508e5fe1", "forward_logs": "1", "allow_save_diagnostics_data_on_crash": "1", "octue_sdk_version": "0.40.0"}}}
5656
{"parent_sdk_version": "0.40.1", "question": {"data": "{\"input_values\": {\"height\": 4, \"width\": 72}, \"input_manifest\": \"{\\n \\\"datasets\\\": {\\n \\\"my_dataset\\\": \\\"/var/folders/sk/hf5fbp616c77tsys9lz55qn40000gp/T/tmppnbc6rcc\\\"\\n },\\n \\\"id\\\": \\\"31440887-beef-41a3-935f-08adbe8dbbdc\\\",\\n \\\"name\\\": null\\n}\", \"children\": null}", "attributes": {"question_uuid": "f66edd6e-517c-4c26-9d60-16cb508e5fe1", "forward_logs": "1", "allow_save_diagnostics_data_on_crash": "1", "octue_sdk_version": "0.40.1"}}}
57+
{"parent_sdk_version": "0.40.2", "question": {"data": "{\"input_values\": {\"height\": 4, \"width\": 72}, \"input_manifest\": \"{\\n \\\"datasets\\\": {\\n \\\"my_dataset\\\": \\\"/var/folders/sk/hf5fbp616c77tsys9lz55qn40000gp/T/tmprj5sl5al\\\"\\n },\\n \\\"id\\\": \\\"6ce744fb-fce6-4346-949a-109675ca7a5a\\\",\\n \\\"name\\\": null\\n}\", \"children\": null}", "attributes": {"question_uuid": "42d9a880-8672-4be6-a3ae-b8518a9e58db", "forward_logs": "1", "allow_save_diagnostics_data_on_crash": "1", "octue_sdk_version": "0.40.2"}}}

0 commit comments

Comments
 (0)