Kitware / UPennContrast

UPenn ?
https://upenn-contrast.netlify.com/
Apache License 2.0
8 stars 6 forks source link

Broken worker: parent_child_worker #721

Closed arjunrajlab closed 1 month ago

arjunrajlab commented 1 month ago

It seems that the update that changed some of the endpoints has resulted in the parent_child_worker breaking. It's in the image_analysis_project repository. It's a simple property worker that just returns some numbers to help link up parent and child annotations, and it used to work just fine. When I run it now, I get the following error in the logs of worker:

2024-06-20 10:15:00     return self.client.post(
2024-06-20 10:15:00            ^^^^^^^^^^^^^^^^^
2024-06-20 10:15:00   File "/root/miniconda3/envs/worker/lib/python3.11/site-packages/girder_client/__init__.py", line 477, in post
2024-06-20 10:15:00 [2024-06-20 14:15:00,426: WARNING/ForkPoolWorker-4]     return self.sendRestRequest('POST', path, parameters, files=files,
2024-06-20 10:15:00            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-20 10:15:00   File "/root/miniconda3/envs/worker/lib/python3.11/site-packages/girder_client/__init__.py", line 462, in sendRestRequest
2024-06-20 10:15:00     raise HttpError(
2024-06-20 10:15:00 girder_client.HttpError: HTTP error 400: POST http://girder:8080/api/v1//annotation_property_values?datasetId=6673eb90988f4a307a074ca2&annotationId=66743279988f4a307a074ce1
2024-06-20 10:15:00 Response text: {"message": "data.values.66743765988f4a307a074cf0 cannot be validated by any definition", "type": "validation"}
2024-06-20 10:15:00 [2024-06-20 14:15:00,538: WARNING/ForkPoolWorker-4] ERROR conda.cli.main_run:execute(124): `conda run python3 /entrypoint.py --apiUrl http://girder:8080/api/v1 --token ZInxk9BPalbD7tPcyR0Aqou200Q5VohDjzgqI5U59WYy4ixV0gF9AYd9SjmUN13D --request compute --parameters {"id": "66743765988f4a307a074cf0", "name": "AF488rent and child", "image": "properties/parent_child:latest", "tags": {"exclusive": false, "tags": ["AF488-T3 blob"]}, "shape": "polygon", "workerInterface": {}, "scales": {"pixelSize": {"unit": "mm", "value": 0.00031196289981213983}, "tStep": {"unit": "s", "value": 1}, "zStep": {"unit": "m", "value": 1}}} --datasetId 6673eb90988f4a307a074ca2` failed. (See above for error)
2024-06-20 10:15:01 [2024-06-20 14:15:01,213: ERROR/ForkPoolWorker-4] Task girder_worker.docker.tasks.docker_run[50079a03-7fad-4e6c-ac29-39c20a7c9e46] raised unexpected: DockerException('Non-zero exit code from docker container (1).')

It seems like some sort of validation is not working anymore? Not sure.

bruyeret commented 1 month ago

I see in the parent_child_worker code this line:

None  # This is a special value that indicates no parent or child

But values can only be numbers as shown in the schema of property values:

"values": {
    "id": recursiveValuesId,
    "type": "object",
    "additionalProperties": {
        "anyOf": [
            {
                "type": "number",
            },
            {
                "$ref": recursiveValuesId,
            },
        ],
    },
},

Should we also accept None as a valid value?

bruyeret commented 1 month ago

Also, this worker send property values one by one instead of using the new function: add_multiple_annotation_property_values

arjunrajlab commented 1 month ago

Oh interesting! Yes, I think we should allow None. It's possible that a worker may want to return numbers for some subproperties but not others, as is the case here.

And yes I have a few workers I still have to update :).

arjunrajlab commented 1 month ago

Also can we allow strings? Or would that create other problems?