From 9ccb4d8c0a0335764e60d8c068788aa6d53ad9b8 Mon Sep 17 00:00:00 2001 From: ml bonhomme <bonhomme@teklia.com> Date: Wed, 26 Jun 2024 12:49:49 +0000 Subject: [PATCH] Remove docker_image field on WorkerVersion model --- arkindex/documents/fixtures/data.json | 1171 ++++++++--------- .../management/commands/bootstrap.py | 2 - .../documents/management/commands/cleanup.py | 38 +- .../documents/tests/commands/test_cleanup.py | 169 +-- .../tests/commands/test_load_export.py | 2 +- arkindex/process/admin.py | 8 +- .../0035_remove_workerversion_dockerimage.py | 38 + arkindex/process/models.py | 25 +- arkindex/process/serializers/imports.py | 4 +- arkindex/process/serializers/workers.py | 14 +- .../process/tests/test_corpus_worker_runs.py | 4 - arkindex/process/tests/test_create_process.py | 2 - .../tests/test_docker_worker_version.py | 13 - arkindex/process/tests/test_processes.py | 5 +- arkindex/process/tests/test_templates.py | 22 +- .../process/tests/test_user_workerruns.py | 8 - arkindex/process/tests/test_workerruns.py | 78 +- arkindex/process/tests/test_workers.py | 108 +- arkindex/project/checks.py | 10 +- arkindex/sql_validation/indexer_prefetch.sql | 2 - 20 files changed, 697 insertions(+), 1026 deletions(-) create mode 100644 arkindex/process/migrations/0035_remove_workerversion_dockerimage.py diff --git a/arkindex/documents/fixtures/data.json b/arkindex/documents/fixtures/data.json index 69cac4dcf9..4d450c7a14 100644 --- a/arkindex/documents/fixtures/data.json +++ b/arkindex/documents/fixtures/data.json @@ -1,18 +1,18 @@ [ { "model": "process.process", - "pk": "426e5df7-9504-453b-8fa4-7186427d8c8c", + "pk": "1aa3eabd-fa22-45fb-936c-c2652a5c861b", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "name": "Process fixture", + "name": null, "creator": 2, - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "mode": "workers", + "corpus": null, + "mode": "local", "activity_state": "disabled", "started": null, "finished": null, - "farm": "fb4aa7c7-0231-4a1c-ad7a-2a3b947fba9d", + "farm": null, "element": null, "folder_type": null, "element_type": null, @@ -30,12 +30,12 @@ }, { "model": "process.process", - "pk": "837d6a44-73e6-4fbf-89c6-83f48cbf9d6c", + "pk": "2b02cf57-5d8d-485c-8a07-e8b0674312aa", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "name": null, - "creator": 2, + "creator": 1, "corpus": null, "mode": "local", "activity_state": "disabled", @@ -59,18 +59,18 @@ }, { "model": "process.process", - "pk": "84c93d80-49e9-47c8-b28d-e2572d08287e", + "pk": "587010b9-0da3-4b88-9eec-746721dde134", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "name": null, - "creator": 1, - "corpus": null, - "mode": "local", + "name": "Process fixture", + "creator": 2, + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "mode": "workers", "activity_state": "disabled", "started": null, "finished": null, - "farm": null, + "farm": "56908aa7-93cf-449a-9232-bca7d3dd8a32", "element": null, "folder_type": null, "element_type": null, @@ -88,156 +88,156 @@ }, { "model": "process.repository", - "pk": "429c9e5b-e9a5-4c1f-9c1e-ac2b87d3df42", + "pk": "1d379142-c1cb-4753-b753-7af8417ad291", "fields": { "url": "http://gitlab/repo" } }, { "model": "process.repository", - "pk": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", + "pk": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", "fields": { "url": "http://my_repo.fake/workers/worker" } }, { "model": "process.revision", - "pk": "3a8b413f-5414-44dc-b553-a4119f7c03f3", + "pk": "9e67a4ec-4973-4f9c-aade-e9febd1d597d", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "repo": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", - "hash": "1337", - "message": "My w0rk3r", - "author": "Test user" + "repo": "1d379142-c1cb-4753-b753-7af8417ad291", + "hash": "42", + "message": "Salve", + "author": "Some user" } }, { "model": "process.revision", - "pk": "69286310-9ee2-4cfa-9e42-d04185b15463", + "pk": "ba271522-2a06-4df9-a061-a389c5769afb", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "repo": "429c9e5b-e9a5-4c1f-9c1e-ac2b87d3df42", - "hash": "42", - "message": "Salve", - "author": "Some user" + "repo": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", + "hash": "1337", + "message": "My w0rk3r", + "author": "Test user" } }, { "model": "process.worker", - "pk": "2678f913-03fc-47d8-a787-521fd791abfa", + "pk": "0a9a6931-d9a8-4fb3-814d-d8957ee889a4", "fields": { - "name": "Generic worker with a Model", - "slug": "generic", - "type": "683b4336-b36d-4deb-8d0e-e3214b78f545", + "name": "Recognizer", + "slug": "reco", + "type": "b31018d4-2b5e-4a5a-ad6b-c7e87471d3de", "description": "", - "repository": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", + "repository": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", "public": false, "archived": null } }, { "model": "process.worker", - "pk": "279ec75c-2bd0-47af-a689-f72d4f19164b", + "pk": "2e41d3f5-9853-411a-a547-3a8051a9acba", "fields": { - "name": "Document layout analyser", - "slug": "dla", - "type": "a215f2a3-2c4e-42b3-a22b-929897ae0bf4", + "name": "Custom worker", + "slug": "custom", + "type": "4e2e6432-4810-48b6-8e72-8a56b5f71adb", "description": "", - "repository": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", + "repository": null, "public": false, "archived": null } }, { "model": "process.worker", - "pk": "2905858b-3b74-4401-9b1b-1a81d5c867bd", + "pk": "333ad70e-ae76-4b64-9405-3d55785f742e", "fields": { - "name": "Elements Initialisation Worker", - "slug": "initialisation", - "type": "917449af-54d2-415a-9439-1ec8da27ee89", + "name": "Document layout analyser", + "slug": "dla", + "type": "4bbbf45a-338f-4919-a480-e862d04e485b", "description": "", - "repository": null, + "repository": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", "public": false, "archived": null } }, { "model": "process.worker", - "pk": "30412f39-754e-467c-9f13-30027dac778e", + "pk": "4744b77e-7baa-487e-a5fc-9be7d85c1983", "fields": { "name": "File import", "slug": "file_import", - "type": "599a3bbf-157d-4d19-8597-e42abe300bdb", + "type": "fdd11dcc-8f32-4bcb-861f-98052a15d8d0", "description": "", - "repository": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", + "repository": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", "public": false, "archived": null } }, { "model": "process.worker", - "pk": "6722ef9a-80b4-4948-a846-a00513fdd51f", + "pk": "8629fa11-910a-4a45-bde0-063f2d4bbb45", "fields": { - "name": "Worker requiring a GPU", - "slug": "worker-gpu", - "type": "a43b20a7-62df-4fd5-84b8-60a777e2aa17", + "name": "Elements Initialisation Worker", + "slug": "initialisation", + "type": "5c6797c7-7de2-407d-a8e4-a540590582d1", "description": "", - "repository": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", + "repository": null, "public": false, "archived": null } }, { "model": "process.worker", - "pk": "8e505c08-34bc-4f5c-98df-57cfd825376f", + "pk": "df07a349-feab-4349-8a16-e802ca3d5d1d", "fields": { - "name": "Recognizer", - "slug": "reco", - "type": "683b4336-b36d-4deb-8d0e-e3214b78f545", + "name": "Generic worker with a Model", + "slug": "generic", + "type": "b31018d4-2b5e-4a5a-ad6b-c7e87471d3de", "description": "", - "repository": "b9e52237-66c4-47e8-9043-7dd7d8169ef2", + "repository": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", "public": false, "archived": null } }, { "model": "process.worker", - "pk": "d29f84ae-6adc-4d26-80f1-6b48bb1945fd", + "pk": "df331338-3926-4473-9009-b41cf7e5554e", "fields": { - "name": "Custom worker", - "slug": "custom", - "type": "fac8c366-144d-4af7-906c-10a4ea36fba9", + "name": "Worker requiring a GPU", + "slug": "worker-gpu", + "type": "b8abaec2-27d7-45f2-9d74-fd7043935ee5", "description": "", - "repository": null, + "repository": "d7e908bb-54a2-4ba8-b44a-f1d98375efda", "public": false, "archived": null } }, { "model": "process.workertype", - "pk": "599a3bbf-157d-4d19-8597-e42abe300bdb", + "pk": "4bbbf45a-338f-4919-a480-e862d04e485b", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "slug": "import", - "display_name": "Import" + "slug": "dla", + "display_name": "Document Layout Analysis" } }, { "model": "process.workertype", - "pk": "683b4336-b36d-4deb-8d0e-e3214b78f545", + "pk": "4e2e6432-4810-48b6-8e72-8a56b5f71adb", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "slug": "recognizer", - "display_name": "Recognizer" + "slug": "custom", + "display_name": "Custom" } }, { "model": "process.workertype", - "pk": "917449af-54d2-415a-9439-1ec8da27ee89", + "pk": "5c6797c7-7de2-407d-a8e4-a540590582d1", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", @@ -247,17 +247,17 @@ }, { "model": "process.workertype", - "pk": "a215f2a3-2c4e-42b3-a22b-929897ae0bf4", + "pk": "b31018d4-2b5e-4a5a-ad6b-c7e87471d3de", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "slug": "dla", - "display_name": "Document Layout Analysis" + "slug": "recognizer", + "display_name": "Recognizer" } }, { "model": "process.workertype", - "pk": "a43b20a7-62df-4fd5-84b8-60a777e2aa17", + "pk": "b8abaec2-27d7-45f2-9d74-fd7043935ee5", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", @@ -267,66 +267,63 @@ }, { "model": "process.workertype", - "pk": "fac8c366-144d-4af7-906c-10a4ea36fba9", + "pk": "fdd11dcc-8f32-4bcb-861f-98052a15d8d0", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "slug": "custom", - "display_name": "Custom" + "slug": "import", + "display_name": "Import" } }, { "model": "process.workerversion", - "pk": "1b57e070-2124-435a-82c9-8476f1ff9fa9", + "pk": "0530b330-e966-4902-8245-b7120e253a4d", "fields": { - "worker": "2678f913-03fc-47d8-a787-521fd791abfa", - "revision": "3a8b413f-5414-44dc-b553-a4119f7c03f3", - "version": null, + "worker": "8629fa11-910a-4a45-bde0-063f2d4bbb45", + "revision": null, + "version": 1, "configuration": { - "test": 42 + "docker": { + "command": "worker-init-elements" + } }, "state": "available", "gpu_usage": "disabled", - "model_usage": "required", - "docker_image": null, - "docker_image_iid": "registry.somewhere.com/something:latest", + "model_usage": "disabled", + "docker_image_iid": "registry.gitlab.teklia.com/arkindex/workers/init-elements:latest", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" } }, { "model": "process.workerversion", - "pk": "2a5bab6e-2b9c-4275-a728-7ca2ea72d593", + "pk": "5d585d34-83e5-4631-b10c-ea54c81e119a", "fields": { - "worker": "d29f84ae-6adc-4d26-80f1-6b48bb1945fd", - "revision": null, - "version": 1, - "configuration": { - "custom": "value" - }, - "state": "created", + "worker": "4744b77e-7baa-487e-a5fc-9be7d85c1983", + "revision": "ba271522-2a06-4df9-a061-a389c5769afb", + "version": null, + "configuration": {}, + "state": "available", "gpu_usage": "disabled", "model_usage": "disabled", - "docker_image": null, - "docker_image_iid": null, + "docker_image_iid": "registry.somewhere.com/something:latest", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" } }, { "model": "process.workerversion", - "pk": "ad580f59-7159-4637-a238-55288c8afa3c", + "pk": "a29dd9e7-dac3-4d79-ba09-c4741e5a08b0", "fields": { - "worker": "279ec75c-2bd0-47af-a689-f72d4f19164b", - "revision": "3a8b413f-5414-44dc-b553-a4119f7c03f3", + "worker": "df331338-3926-4473-9009-b41cf7e5554e", + "revision": "ba271522-2a06-4df9-a061-a389c5769afb", "version": null, "configuration": { "test": 42 }, "state": "available", - "gpu_usage": "disabled", + "gpu_usage": "required", "model_usage": "disabled", - "docker_image": null, "docker_image_iid": "registry.somewhere.com/something:latest", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" @@ -334,18 +331,17 @@ }, { "model": "process.workerversion", - "pk": "b4360014-ae61-4445-a8d5-05be65a4edc6", + "pk": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "fields": { - "worker": "6722ef9a-80b4-4948-a846-a00513fdd51f", - "revision": "3a8b413f-5414-44dc-b553-a4119f7c03f3", + "worker": "0a9a6931-d9a8-4fb3-814d-d8957ee889a4", + "revision": "ba271522-2a06-4df9-a061-a389c5769afb", "version": null, "configuration": { "test": 42 }, "state": "available", - "gpu_usage": "required", + "gpu_usage": "disabled", "model_usage": "disabled", - "docker_image": null, "docker_image_iid": "registry.somewhere.com/something:latest", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" @@ -353,16 +349,17 @@ }, { "model": "process.workerversion", - "pk": "b47d5a18-ed1e-4a67-821f-a34d8769ee6d", + "pk": "ce4b9548-d01e-4fa5-b0fe-c6167589c10a", "fields": { - "worker": "30412f39-754e-467c-9f13-30027dac778e", - "revision": "3a8b413f-5414-44dc-b553-a4119f7c03f3", + "worker": "333ad70e-ae76-4b64-9405-3d55785f742e", + "revision": "ba271522-2a06-4df9-a061-a389c5769afb", "version": null, - "configuration": {}, + "configuration": { + "test": 42 + }, "state": "available", "gpu_usage": "disabled", "model_usage": "disabled", - "docker_image": null, "docker_image_iid": "registry.somewhere.com/something:latest", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" @@ -370,39 +367,35 @@ }, { "model": "process.workerversion", - "pk": "e4fdaded-dd3d-40d7-a638-abe8ab702fb6", + "pk": "dc759c42-4982-4f7b-bbe1-a38a5a83053d", "fields": { - "worker": "2905858b-3b74-4401-9b1b-1a81d5c867bd", + "worker": "2e41d3f5-9853-411a-a547-3a8051a9acba", "revision": null, "version": 1, "configuration": { - "docker": { - "command": "worker-init-elements" - } + "custom": "value" }, - "state": "available", + "state": "created", "gpu_usage": "disabled", "model_usage": "disabled", - "docker_image": null, - "docker_image_iid": "registry.gitlab.teklia.com/arkindex/workers/init-elements:latest", + "docker_image_iid": null, "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" } }, { "model": "process.workerversion", - "pk": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "pk": "ebc1af0c-16b3-4984-937f-b5bb2f180510", "fields": { - "worker": "8e505c08-34bc-4f5c-98df-57cfd825376f", - "revision": "3a8b413f-5414-44dc-b553-a4119f7c03f3", + "worker": "df07a349-feab-4349-8a16-e802ca3d5d1d", + "revision": "ba271522-2a06-4df9-a061-a389c5769afb", "version": null, "configuration": { "test": 42 }, "state": "available", "gpu_usage": "disabled", - "model_usage": "disabled", - "docker_image": null, + "model_usage": "required", "docker_image_iid": "registry.somewhere.com/something:latest", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z" @@ -410,10 +403,10 @@ }, { "model": "process.workerrun", - "pk": "2deaccaf-bdd8-418b-9be8-783426f7a516", + "pk": "e2122f93-ab53-4a94-8228-a20ae965f81c", "fields": { - "process": "426e5df7-9504-453b-8fa4-7186427d8c8c", - "version": "e4fdaded-dd3d-40d7-a638-abe8ab702fb6", + "process": "587010b9-0da3-4b88-9eec-746721dde134", + "version": "0530b330-e966-4902-8245-b7120e253a4d", "model_version": null, "parents": "[]", "configuration": null, @@ -425,14 +418,14 @@ }, { "model": "process.workerrun", - "pk": "245414f5-3648-46da-8675-ea9249ca9ea1", + "pk": "108decda-974e-4195-a5aa-99cf5e644654", "fields": { - "process": "426e5df7-9504-453b-8fa4-7186427d8c8c", - "version": "ad580f59-7159-4637-a238-55288c8afa3c", + "process": "587010b9-0da3-4b88-9eec-746721dde134", + "version": "ce4b9548-d01e-4fa5-b0fe-c6167589c10a", "model_version": null, - "parents": "[\"2deaccaf-bdd8-418b-9be8-783426f7a516\"]", + "parents": "[\"e2122f93-ab53-4a94-8228-a20ae965f81c\"]", "configuration": null, - "summary": "Worker Document layout analyser @ ad580f", + "summary": "Worker Document layout analyser @ ce4b95", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "has_results": false @@ -440,14 +433,14 @@ }, { "model": "process.workerrun", - "pk": "94ec79b9-2061-4c8c-9ee4-b048fba2b58a", + "pk": "3dd031f5-c154-47e5-b496-d322071d3213", "fields": { - "process": "837d6a44-73e6-4fbf-89c6-83f48cbf9d6c", - "version": "2a5bab6e-2b9c-4275-a728-7ca2ea72d593", + "process": "587010b9-0da3-4b88-9eec-746721dde134", + "version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "model_version": null, - "parents": "[]", + "parents": "[\"108decda-974e-4195-a5aa-99cf5e644654\"]", "configuration": null, - "summary": "Worker Custom worker @ version 1", + "summary": "Worker Recognizer @ bb5b48", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "has_results": false @@ -455,14 +448,14 @@ }, { "model": "process.workerrun", - "pk": "e33d74f4-9bea-4f8f-80f6-4c574b90a8d2", + "pk": "6264ea27-309d-4e81-9d21-dad52d48da99", "fields": { - "process": "426e5df7-9504-453b-8fa4-7186427d8c8c", - "version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "process": "1aa3eabd-fa22-45fb-936c-c2652a5c861b", + "version": "dc759c42-4982-4f7b-bbe1-a38a5a83053d", "model_version": null, - "parents": "[\"245414f5-3648-46da-8675-ea9249ca9ea1\"]", + "parents": "[]", "configuration": null, - "summary": "Worker Recognizer @ f00617", + "summary": "Worker Custom worker @ version 1", "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "has_results": false @@ -470,10 +463,10 @@ }, { "model": "process.workerrun", - "pk": "f8d3343a-186a-4660-b534-ef3979192bd7", + "pk": "ecd471e3-5921-4e0d-8da7-5ddc1a48603c", "fields": { - "process": "84c93d80-49e9-47c8-b28d-e2572d08287e", - "version": "2a5bab6e-2b9c-4275-a728-7ca2ea72d593", + "process": "2b02cf57-5d8d-485c-8a07-e8b0674312aa", + "version": "dc759c42-4982-4f7b-bbe1-a38a5a83053d", "model_version": null, "parents": "[]", "configuration": null, @@ -485,7 +478,7 @@ }, { "model": "documents.corpus", - "pk": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", + "pk": "75425382-912b-40fd-ae59-a39667324735", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", @@ -498,23 +491,23 @@ }, { "model": "documents.elementtype", - "pk": "2046b2ce-bf98-4c29-82a5-5b16604a7db5", + "pk": "506569e7-065d-4b70-bb81-cda33ec97c16", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "slug": "act", - "display_name": "Act", - "folder": false, + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "slug": "volume", + "display_name": "Volume", + "folder": true, "indexable": false, "color": "28b62c" } }, { "model": "documents.elementtype", - "pk": "42624fe0-a82a-444a-9329-51bf7d4e3462", + "pk": "77477168-f4bd-478a-8817-c1eb30c5cd9b", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "slug": "surface", - "display_name": "Surface", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "slug": "page", + "display_name": "Page", "folder": false, "indexable": false, "color": "28b62c" @@ -522,11 +515,11 @@ }, { "model": "documents.elementtype", - "pk": "4f5cdf06-6df6-423d-a47a-67c082fb5099", + "pk": "86d4848f-3531-44ef-937d-90faa72551d7", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "slug": "text_line", - "display_name": "Line", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "slug": "act", + "display_name": "Act", "folder": false, "indexable": false, "color": "28b62c" @@ -534,23 +527,23 @@ }, { "model": "documents.elementtype", - "pk": "573da26c-e860-4e98-aa7e-56e7f040eeee", + "pk": "a5f5df91-2f4a-4e6e-80be-5bb543211690", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "slug": "volume", - "display_name": "Volume", - "folder": true, + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "slug": "text_line", + "display_name": "Line", + "folder": false, "indexable": false, "color": "28b62c" } }, { "model": "documents.elementtype", - "pk": "9e698b00-1a35-4dae-9026-781504f05585", + "pk": "ce711ca5-fc25-4545-b038-2e3da65ece10", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "slug": "page", - "display_name": "Page", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "slug": "word", + "display_name": "Word", "folder": false, "indexable": false, "color": "28b62c" @@ -558,11 +551,11 @@ }, { "model": "documents.elementtype", - "pk": "d22d7782-aa3e-43bf-b448-fa4996f98033", + "pk": "d0ac1408-8575-4e51-9e54-d066dac523de", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "slug": "word", - "display_name": "Word", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "slug": "surface", + "display_name": "Surface", "folder": false, "indexable": false, "color": "28b62c" @@ -570,279 +563,279 @@ }, { "model": "documents.elementpath", - "pk": "002e7dc3-29f1-4bce-b424-1e55d518332d", - "fields": { - "element": "d2673a72-5bce-410c-9250-c38552c37e1a", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 1 - } -}, -{ - "model": "documents.elementpath", - "pk": "01af45ed-fc29-4b94-a9db-abfb83dd284c", + "pk": "1119eeb1-49e2-41ed-9350-b62c47f4df11", "fields": { - "element": "1980fd7b-611f-403f-be8b-199051fcb381", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"4dc9662a-0c78-4f61-b2b2-d066f9e50be9\"]", + "element": "11028ff8-f842-4e72-92f4-e5ee93cd1fed", + "path": "[\"57a12ec3-8eca-4bcd-b9ef-0c1041138f58\"]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "0cb872df-e32e-4200-a9b1-e2851e81c72e", + "pk": "159cd688-bbff-4115-b4c9-eb8a866f3fa6", "fields": { - "element": "a91fd052-0be7-4baa-a381-c74432f5ab8a", + "element": "57a12ec3-8eca-4bcd-b9ef-0c1041138f58", "path": "[]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "20fbb9a1-9bf0-4435-9eb1-28636fa48dbb", + "pk": "1b85b1ca-1c84-48d5-819f-add638172264", "fields": { - "element": "ae5e750a-12d5-44b8-95e5-36b9bc18b0e0", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"ec6cb9f9-793b-4b45-9d8a-f743ffcb3606\"]", + "element": "a7c66de0-aaf9-433c-a2a7-a2292d459b59", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"7d6abd28-990a-41bf-bd43-8b006f0d0a70\"]", "ordering": 2 } }, { "model": "documents.elementpath", - "pk": "22f3292e-b05d-4fd4-9c8b-648fa4657ad3", + "pk": "2d474ffc-5377-41d3-95c9-16a5160c3a37", "fields": { - "element": "4d3a637a-8112-4f74-808a-2e6110c72a35", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"4dc9662a-0c78-4f61-b2b2-d066f9e50be9\"]", - "ordering": 1 + "element": "ce62c3da-c737-4aac-bf13-0b7e5ca29942", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", + "ordering": 3 } }, { "model": "documents.elementpath", - "pk": "35f67ee4-e5c4-4ee4-9810-a1adaf0520a6", + "pk": "31638d28-51f6-4054-8388-d98828ae70a2", "fields": { - "element": "12696972-1dae-449d-80c5-a0c5110156d9", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 7 + "element": "83341e32-e2ce-4e0b-b7c2-2aa4f721af97", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"83cfa57d-e55d-4312-bc2a-18cd675c809c\"]", + "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "3afcb369-6be7-4939-8193-185a4da1738c", + "pk": "435e145c-60dd-414a-a96c-2c88f55daaa1", "fields": { - "element": "4712384f-c4fa-42a2-b900-9b0d0aa7c1c7", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"640f7d63-1ce9-4932-b909-d59fd8382e0d\"]", - "ordering": 0 + "element": "7630868f-43b3-4ff1-b2a7-e135ab965904", + "path": "[\"57a12ec3-8eca-4bcd-b9ef-0c1041138f58\"]", + "ordering": 1 } }, { "model": "documents.elementpath", - "pk": "43411b33-1614-481b-84ca-b6bca97ff991", + "pk": "4e6e25cd-a0a2-4826-9667-f1e5c68a2e62", "fields": { - "element": "640f7d63-1ce9-4932-b909-d59fd8382e0d", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 2 + "element": "bc7ded19-2d60-4e1f-ab6e-3a823b24d592", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"c3d4eead-5222-4d1f-b8d6-707152886600\"]", + "ordering": 1 } }, { "model": "documents.elementpath", - "pk": "4a2c411c-5fd1-478c-865f-02dabd72cc69", + "pk": "5d3be54d-0842-4a2a-84a7-76d603f0923c", "fields": { - "element": "f87f773e-7622-4342-a5e8-446acc3600d3", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"ec6cb9f9-793b-4b45-9d8a-f743ffcb3606\"]", - "ordering": 0 + "element": "3e343e73-539f-49c2-b649-ca1de6292d87", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", + "ordering": 6 } }, { "model": "documents.elementpath", - "pk": "5a11ea5e-36fa-41fc-9dc0-59047f895ba0", + "pk": "66f61147-a6d9-44f9-9ab8-639a42e91d2f", "fields": { - "element": "25d5ae34-f6fc-4a6d-90ff-1a63181c7f6b", - "path": "[\"a91fd052-0be7-4baa-a381-c74432f5ab8a\"]", + "element": "f6dc0f9b-def7-4d77-bccf-aca2ffd2cec0", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"bbefa496-f47e-4742-b619-3d11e8f64395\"]", "ordering": 2 } }, { "model": "documents.elementpath", - "pk": "6778be86-94bd-42f3-9340-6f5718a5daa1", + "pk": "6a9f6a5c-87fb-418d-b23c-f4e6b795e5a9", "fields": { - "element": "61556be7-5e75-40c1-a551-ff329a4ecfe8", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"19fa4694-1579-4e3b-9c78-f2953f402d55\"]", + "element": "74e5d7f2-28d5-4d3c-9179-10f606be80f1", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"7d6abd28-990a-41bf-bd43-8b006f0d0a70\"]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "731d58c5-7e6d-4360-a024-17905ace3986", + "pk": "7346d91b-b92c-4446-a206-3c868d0681ac", "fields": { - "element": "d1cd81f4-0be7-4d85-a39c-405190e412ac", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"13dcc584-4c57-4939-8ebf-38a3997d6681\"]", - "ordering": 0 + "element": "4022ca03-6946-4229-aeeb-9f214aa7d5ed", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"bbefa496-f47e-4742-b619-3d11e8f64395\"]", + "ordering": 1 } }, { "model": "documents.elementpath", - "pk": "8737b82b-4a9b-443d-963f-bd26c00aaf71", + "pk": "7c45411a-f0ad-4793-99ce-6ec1255512dc", "fields": { - "element": "ec6cb9f9-793b-4b45-9d8a-f743ffcb3606", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 0 + "element": "bbefa496-f47e-4742-b619-3d11e8f64395", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", + "ordering": 1 } }, { "model": "documents.elementpath", - "pk": "874e8e1e-8802-456f-8518-2c779cc47f36", + "pk": "8ce9d1ec-ddfc-42b4-9ab7-73c30381df2e", "fields": { - "element": "813de565-e1b7-4c4e-8e51-67ae486a7616", - "path": "[]", + "element": "3cafcf30-f1bb-4a2e-9f0a-392413ca2fef", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"3e343e73-539f-49c2-b649-ca1de6292d87\"]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "8951ae13-b5d0-4049-b633-6ca44c628cce", + "pk": "93cded6e-8f38-4135-98e5-1957f9ac7982", "fields": { - "element": "cc1d9aed-7e02-4bc0-a883-a3803d375370", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"d2673a72-5bce-410c-9250-c38552c37e1a\"]", - "ordering": 0 + "element": "9a11f92a-64a2-417c-8c26-4ad3829c396d", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"7d6abd28-990a-41bf-bd43-8b006f0d0a70\"]", + "ordering": 1 } }, { "model": "documents.elementpath", - "pk": "8c586310-1b56-4ea1-a848-5ee7d259eeb7", + "pk": "93d4e605-ac28-4348-8b91-adeb82da4962", "fields": { - "element": "fe7d0a83-3138-48bf-961c-cd5b98f42423", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"ec6cb9f9-793b-4b45-9d8a-f743ffcb3606\"]", + "element": "6b9437f3-61ce-452a-be20-aef28c60b12e", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"83cfa57d-e55d-4312-bc2a-18cd675c809c\"]", "ordering": 1 } }, { "model": "documents.elementpath", - "pk": "8e09ebe4-4354-4c53-ba38-5bf4d0a0f8d8", + "pk": "95e6853e-e6b5-4cb6-86b9-1a23b64f2d53", "fields": { - "element": "5380459b-67b4-4756-991b-af5838034a5d", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"ec6cb9f9-793b-4b45-9d8a-f743ffcb3606\"]", - "ordering": 3 + "element": "c3d4eead-5222-4d1f-b8d6-707152886600", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", + "ordering": 4 } }, { "model": "documents.elementpath", - "pk": "8f788444-e1db-4364-b65e-a2291063cf62", + "pk": "a0400152-31de-42ba-80f7-60f752f56f57", "fields": { - "element": "13dcc584-4c57-4939-8ebf-38a3997d6681", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 3 + "element": "82050278-d20b-4997-af7d-06bfdd233c0d", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"bbefa496-f47e-4742-b619-3d11e8f64395\"]", + "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "a181faa6-fd38-43d9-b8da-125519c75492", + "pk": "a1ccb129-34ed-4acc-8cdc-1e4d204c1a47", "fields": { - "element": "95eab395-3caf-4308-91af-bd2de4e3f903", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"2d7f3ffc-0d68-4ce6-9501-192fb7389439\"]", + "element": "2a417a0b-5d12-4bc4-8cc8-a0484d7f3546", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", + "ordering": 7 + } +}, +{ + "model": "documents.elementpath", + "pk": "ac79d61d-25fd-4ffd-8f70-c93906eb1262", + "fields": { + "element": "1afeb81f-ebcb-4c01-b0b0-464939ab4792", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"ce62c3da-c737-4aac-bf13-0b7e5ca29942\"]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "b0d741cb-4bb0-4d93-8418-951eec9dbad9", + "pk": "bd9fa4c7-a42e-4b80-ade5-c17c0a5cea4e", "fields": { - "element": "9bb9ac52-bf63-4855-8de1-33507d69ff61", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"12696972-1dae-449d-80c5-a0c5110156d9\"]", + "element": "e58a12a9-7c74-4859-b7c1-0be44e00421a", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"2a417a0b-5d12-4bc4-8cc8-a0484d7f3546\"]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "b2ecc8f4-325a-43b0-aca3-c45c7f32404b", + "pk": "d10d9da8-1e7d-4617-a1b9-49dace50ecb1", "fields": { - "element": "d5120897-d198-45b8-99fc-c806128dc492", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"d2673a72-5bce-410c-9250-c38552c37e1a\"]", - "ordering": 2 + "element": "0efb6820-ee5a-4095-9586-ba600b8ef04c", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"c3d4eead-5222-4d1f-b8d6-707152886600\"]", + "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "b54366f8-3904-441a-8808-b295f7ef53bf", + "pk": "d47792c3-776f-4136-9722-a5f98084012f", "fields": { - "element": "19fa4694-1579-4e3b-9c78-f2953f402d55", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", + "element": "48a60d32-727f-4c0b-a082-23770ff5aaa5", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", "ordering": 5 } }, { "model": "documents.elementpath", - "pk": "c2e48b44-1b52-41c1-ab38-6f6bd75c2a8f", + "pk": "d80309f9-13bf-48a0-8ca2-ad2cd1c0477c", "fields": { - "element": "498fc569-228a-4bef-b777-524edf9aa357", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"640f7d63-1ce9-4932-b909-d59fd8382e0d\"]", - "ordering": 1 + "element": "7d6abd28-990a-41bf-bd43-8b006f0d0a70", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", + "ordering": 2 } }, { "model": "documents.elementpath", - "pk": "c8fe0b3b-ae9f-4a4f-a781-2d04b11d471c", + "pk": "dcaac81a-d3ff-4eb6-a56f-fca200d21f2f", "fields": { - "element": "b9f61d7c-d230-4a2e-8cb7-29f0df30223b", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"d2673a72-5bce-410c-9250-c38552c37e1a\"]", - "ordering": 1 + "element": "a0c83c35-0941-4967-b8f1-882e479f3357", + "path": "[\"57a12ec3-8eca-4bcd-b9ef-0c1041138f58\"]", + "ordering": 2 } }, { "model": "documents.elementpath", - "pk": "c9f8a64c-5328-4d23-8e6c-4662e7f49558", + "pk": "fa6b343c-83ea-4d7c-9d8d-43dfb85b2cdd", "fields": { - "element": "4dc9662a-0c78-4f61-b2b2-d066f9e50be9", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 4 + "element": "6ef28cb1-224f-4059-a5b0-8d8d5863702b", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"83cfa57d-e55d-4312-bc2a-18cd675c809c\"]", + "ordering": 3 } }, { "model": "documents.elementpath", - "pk": "d1d74e3f-4398-4e61-a3a7-fd2cef8a9b99", + "pk": "fc1d1e3d-f694-44bf-a09a-ce1131202427", "fields": { - "element": "d532d5f6-3f00-4cde-888e-ac1dfb23270e", - "path": "[\"a91fd052-0be7-4baa-a381-c74432f5ab8a\"]", + "element": "83cfa57d-e55d-4312-bc2a-18cd675c809c", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\"]", "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "d2801368-b054-4027-9218-9f79a20a97f6", + "pk": "fd0e8fe2-98ed-4719-b72e-e527263583d4", "fields": { - "element": "0b831f72-d975-466c-b627-415974d39728", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\", \"640f7d63-1ce9-4932-b909-d59fd8382e0d\"]", - "ordering": 2 + "element": "1b166d81-4d99-4d6b-a721-92bc2c62fe88", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"48a60d32-727f-4c0b-a082-23770ff5aaa5\"]", + "ordering": 0 } }, { "model": "documents.elementpath", - "pk": "dfdc3c49-0b34-4164-9d45-8e092c0439cf", + "pk": "fdea0525-4b69-47f4-85ff-27b808922776", "fields": { - "element": "d1beed1a-1651-407a-9ffb-ee57dabca7bc", - "path": "[\"a91fd052-0be7-4baa-a381-c74432f5ab8a\"]", - "ordering": 1 + "element": "e4ba2e60-7416-47de-bbef-ae651b4e1fcf", + "path": "[\"7aef9d76-178f-4b58-bf92-a28b51cbc4d3\", \"83cfa57d-e55d-4312-bc2a-18cd675c809c\"]", + "ordering": 2 } }, { "model": "documents.elementpath", - "pk": "e0a77f72-30fd-4322-a7d8-9a0f65af48c3", + "pk": "fec4ce0a-daeb-4d03-b665-ac9f6581561f", "fields": { - "element": "2d7f3ffc-0d68-4ce6-9501-192fb7389439", - "path": "[\"813de565-e1b7-4c4e-8e51-67ae486a7616\"]", - "ordering": 6 + "element": "7aef9d76-178f-4b58-bf92-a28b51cbc4d3", + "path": "[]", + "ordering": 0 } }, { "model": "documents.element", - "pk": "0b831f72-d975-466c-b627-415974d39728", + "pk": "0efb6820-ee5a-4095-9586-ba600b8ef04c", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "DATUM", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "d0ac1408-8575-4e51-9e54-d066dac523de", + "name": "Surface B", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", - "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", + "image": "870187ce-4d32-4a39-84fd-603a3398146b", + "polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -850,18 +843,18 @@ }, { "model": "documents.element", - "pk": "12696972-1dae-449d-80c5-a0c5110156d9", + "pk": "11028ff8-f842-4e72-92f4-e5ee93cd1fed", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "2046b2ce-bf98-4c29-82a5-5b16604a7db5", - "name": "Act 5", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "77477168-f4bd-478a-8817-c1eb30c5cd9b", + "name": "Volume 2, page 1r", "creator": null, "worker_version": null, "worker_run": null, - "image": null, - "polygon": null, + "image": "62e9090c-cf98-4c1f-8d3e-639bf60cc187", + "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -869,18 +862,18 @@ }, { "model": "documents.element", - "pk": "13dcc584-4c57-4939-8ebf-38a3997d6681", + "pk": "1afeb81f-ebcb-4c01-b0b0-464939ab4792", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "2046b2ce-bf98-4c29-82a5-5b16604a7db5", - "name": "Act 1", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "d0ac1408-8575-4e51-9e54-d066dac523de", + "name": "Surface A", "creator": null, "worker_version": null, "worker_run": null, - "image": null, - "polygon": null, + "image": "870187ce-4d32-4a39-84fd-603a3398146b", + "polygon": "LINEARRING (0 0, 0 600, 600 600, 600 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -888,18 +881,18 @@ }, { "model": "documents.element", - "pk": "1980fd7b-611f-403f-be8b-199051fcb381", + "pk": "1b166d81-4d99-4d6b-a721-92bc2c62fe88", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "42624fe0-a82a-444a-9329-51bf7d4e3462", - "name": "Surface B", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "d0ac1408-8575-4e51-9e54-d066dac523de", + "name": "Surface D", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", - "polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", + "polygon": "LINEARRING (0 0, 0 300, 300 300, 300 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -907,13 +900,13 @@ }, { "model": "documents.element", - "pk": "19fa4694-1579-4e3b-9c78-f2953f402d55", + "pk": "2a417a0b-5d12-4bc4-8cc8-a0484d7f3546", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "2046b2ce-bf98-4c29-82a5-5b16604a7db5", - "name": "Act 3", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "86d4848f-3531-44ef-937d-90faa72551d7", + "name": "Act 5", "creator": null, "worker_version": null, "worker_run": null, @@ -926,18 +919,18 @@ }, { "model": "documents.element", - "pk": "25d5ae34-f6fc-4a6d-90ff-1a63181c7f6b", + "pk": "3cafcf30-f1bb-4a2e-9f0a-392413ca2fef", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "9e698b00-1a35-4dae-9026-781504f05585", - "name": "Volume 2, page 2r", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "d0ac1408-8575-4e51-9e54-d066dac523de", + "name": "Surface E", "creator": null, "worker_version": null, "worker_run": null, - "image": "b2aabf63-61a8-4651-b5cd-33bc2a85e36e", - "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", + "polygon": "LINEARRING (300 300, 300 600, 600 600, 600 300, 300 300)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -945,12 +938,12 @@ }, { "model": "documents.element", - "pk": "2d7f3ffc-0d68-4ce6-9501-192fb7389439", + "pk": "3e343e73-539f-49c2-b649-ca1de6292d87", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "2046b2ce-bf98-4c29-82a5-5b16604a7db5", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "86d4848f-3531-44ef-937d-90faa72551d7", "name": "Act 4", "creator": null, "worker_version": null, @@ -964,18 +957,18 @@ }, { "model": "documents.element", - "pk": "4712384f-c4fa-42a2-b900-9b0d0aa7c1c7", + "pk": "4022ca03-6946-4229-aeeb-9f214aa7d5ed", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "PARIS", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "ROY", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", - "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", + "image": "d3ac3480-b41b-48e7-a6e8-1bd85d64b7d7", + "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -983,18 +976,18 @@ }, { "model": "documents.element", - "pk": "498fc569-228a-4bef-b777-524edf9aa357", + "pk": "48a60d32-727f-4c0b-a082-23770ff5aaa5", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "ROY", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "86d4848f-3531-44ef-937d-90faa72551d7", + "name": "Act 3", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", - "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", + "image": null, + "polygon": null, "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1002,18 +995,18 @@ }, { "model": "documents.element", - "pk": "4d3a637a-8112-4f74-808a-2e6110c72a35", + "pk": "57a12ec3-8eca-4bcd-b9ef-0c1041138f58", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "42624fe0-a82a-444a-9329-51bf7d4e3462", - "name": "Surface C", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "506569e7-065d-4b70-bb81-cda33ec97c16", + "name": "Volume 2", "creator": null, "worker_version": null, "worker_run": null, - "image": "739b25d6-065c-4309-b2e4-f8ac000e6741", - "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", + "image": null, + "polygon": null, "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1021,18 +1014,18 @@ }, { "model": "documents.element", - "pk": "4dc9662a-0c78-4f61-b2b2-d066f9e50be9", + "pk": "6b9437f3-61ce-452a-be20-aef28c60b12e", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "2046b2ce-bf98-4c29-82a5-5b16604a7db5", - "name": "Act 2", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "ROY", "creator": null, "worker_version": null, "worker_run": null, - "image": null, - "polygon": null, + "image": "870187ce-4d32-4a39-84fd-603a3398146b", + "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1040,17 +1033,17 @@ }, { "model": "documents.element", - "pk": "5380459b-67b4-4756-991b-af5838034a5d", + "pk": "6ef28cb1-224f-4059-a5b0-8d8d5863702b", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "4f5cdf06-6df6-423d-a47a-67c082fb5099", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "a5f5df91-2f4a-4e6e-80be-5bb543211690", "name": "Text line", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", + "image": "870187ce-4d32-4a39-84fd-603a3398146b", "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "rotation_angle": 0, "mirrored": false, @@ -1059,18 +1052,18 @@ }, { "model": "documents.element", - "pk": "61556be7-5e75-40c1-a551-ff329a4ecfe8", + "pk": "74e5d7f2-28d5-4d3c-9179-10f606be80f1", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "42624fe0-a82a-444a-9329-51bf7d4e3462", - "name": "Surface D", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "PARIS", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", - "polygon": "LINEARRING (0 0, 0 300, 300 300, 300 0, 0 0)", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", + "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1078,17 +1071,17 @@ }, { "model": "documents.element", - "pk": "640f7d63-1ce9-4932-b909-d59fd8382e0d", + "pk": "7630868f-43b3-4ff1-b2a7-e135ab965904", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "9e698b00-1a35-4dae-9026-781504f05585", - "name": "Volume 1, page 2r", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "77477168-f4bd-478a-8817-c1eb30c5cd9b", + "name": "Volume 2, page 1v", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", + "image": "1e6bbb51-78f6-455f-8571-5b08d538a8f3", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, @@ -1097,12 +1090,12 @@ }, { "model": "documents.element", - "pk": "813de565-e1b7-4c4e-8e51-67ae486a7616", + "pk": "7aef9d76-178f-4b58-bf92-a28b51cbc4d3", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "573da26c-e860-4e98-aa7e-56e7f040eeee", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "506569e7-065d-4b70-bb81-cda33ec97c16", "name": "Volume 1", "creator": null, "worker_version": null, @@ -1116,18 +1109,18 @@ }, { "model": "documents.element", - "pk": "95eab395-3caf-4308-91af-bd2de4e3f903", + "pk": "7d6abd28-990a-41bf-bd43-8b006f0d0a70", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "42624fe0-a82a-444a-9329-51bf7d4e3462", - "name": "Surface E", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "77477168-f4bd-478a-8817-c1eb30c5cd9b", + "name": "Volume 1, page 2r", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", - "polygon": "LINEARRING (300 300, 300 600, 600 600, 600 300, 300 300)", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", + "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1135,18 +1128,18 @@ }, { "model": "documents.element", - "pk": "9bb9ac52-bf63-4855-8de1-33507d69ff61", + "pk": "82050278-d20b-4997-af7d-06bfdd233c0d", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "42624fe0-a82a-444a-9329-51bf7d4e3462", - "name": "Surface F", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "PARIS", "creator": null, "worker_version": null, "worker_run": null, - "image": "c8a30310-5071-4eb7-b4f7-00bd700237df", - "polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)", + "image": "d3ac3480-b41b-48e7-a6e8-1bd85d64b7d7", + "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1154,18 +1147,18 @@ }, { "model": "documents.element", - "pk": "a91fd052-0be7-4baa-a381-c74432f5ab8a", + "pk": "83341e32-e2ce-4e0b-b7c2-2aa4f721af97", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "573da26c-e860-4e98-aa7e-56e7f040eeee", - "name": "Volume 2", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "PARIS", "creator": null, "worker_version": null, "worker_run": null, - "image": null, - "polygon": null, + "image": "870187ce-4d32-4a39-84fd-603a3398146b", + "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1173,18 +1166,18 @@ }, { "model": "documents.element", - "pk": "ae5e750a-12d5-44b8-95e5-36b9bc18b0e0", + "pk": "83cfa57d-e55d-4312-bc2a-18cd675c809c", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "DATUM", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "77477168-f4bd-478a-8817-c1eb30c5cd9b", + "name": "Volume 1, page 1r", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", - "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", + "image": "870187ce-4d32-4a39-84fd-603a3398146b", + "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1192,17 +1185,17 @@ }, { "model": "documents.element", - "pk": "b9f61d7c-d230-4a2e-8cb7-29f0df30223b", + "pk": "9a11f92a-64a2-417c-8c26-4ad3829c396d", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", "name": "ROY", "creator": null, "worker_version": null, "worker_run": null, - "image": "739b25d6-065c-4309-b2e4-f8ac000e6741", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "rotation_angle": 0, "mirrored": false, @@ -1211,18 +1204,18 @@ }, { "model": "documents.element", - "pk": "cc1d9aed-7e02-4bc0-a883-a3803d375370", + "pk": "a0c83c35-0941-4967-b8f1-882e479f3357", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "PARIS", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "77477168-f4bd-478a-8817-c1eb30c5cd9b", + "name": "Volume 2, page 2r", "creator": null, "worker_version": null, "worker_run": null, - "image": "739b25d6-065c-4309-b2e4-f8ac000e6741", - "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", + "image": "6b515575-e5b1-4fd1-b191-61950d4440c9", + "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1230,18 +1223,18 @@ }, { "model": "documents.element", - "pk": "d1beed1a-1651-407a-9ffb-ee57dabca7bc", + "pk": "a7c66de0-aaf9-433c-a2a7-a2292d459b59", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "9e698b00-1a35-4dae-9026-781504f05585", - "name": "Volume 2, page 1v", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "DATUM", "creator": null, "worker_version": null, "worker_run": null, - "image": "d1ee80ce-9106-4680-a133-cc96ace159e5", - "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", + "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1249,18 +1242,18 @@ }, { "model": "documents.element", - "pk": "d1cd81f4-0be7-4d85-a39c-405190e412ac", + "pk": "bbefa496-f47e-4742-b619-3d11e8f64395", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "42624fe0-a82a-444a-9329-51bf7d4e3462", - "name": "Surface A", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "77477168-f4bd-478a-8817-c1eb30c5cd9b", + "name": "Volume 1, page 1v", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", - "polygon": "LINEARRING (0 0, 0 600, 600 600, 600 0, 0 0)", + "image": "d3ac3480-b41b-48e7-a6e8-1bd85d64b7d7", + "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1268,17 +1261,17 @@ }, { "model": "documents.element", - "pk": "d2673a72-5bce-410c-9250-c38552c37e1a", + "pk": "bc7ded19-2d60-4e1f-ab6e-3a823b24d592", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "9e698b00-1a35-4dae-9026-781504f05585", - "name": "Volume 1, page 1v", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "d0ac1408-8575-4e51-9e54-d066dac523de", + "name": "Surface C", "creator": null, "worker_version": null, "worker_run": null, - "image": "739b25d6-065c-4309-b2e4-f8ac000e6741", + "image": "d3ac3480-b41b-48e7-a6e8-1bd85d64b7d7", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "rotation_angle": 0, "mirrored": false, @@ -1287,18 +1280,18 @@ }, { "model": "documents.element", - "pk": "d5120897-d198-45b8-99fc-c806128dc492", + "pk": "c3d4eead-5222-4d1f-b8d6-707152886600", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "DATUM", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "86d4848f-3531-44ef-937d-90faa72551d7", + "name": "Act 2", "creator": null, "worker_version": null, "worker_run": null, - "image": "739b25d6-065c-4309-b2e4-f8ac000e6741", - "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", + "image": null, + "polygon": null, "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1306,18 +1299,18 @@ }, { "model": "documents.element", - "pk": "d532d5f6-3f00-4cde-888e-ac1dfb23270e", + "pk": "ce62c3da-c737-4aac-bf13-0b7e5ca29942", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "9e698b00-1a35-4dae-9026-781504f05585", - "name": "Volume 2, page 1r", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "86d4848f-3531-44ef-937d-90faa72551d7", + "name": "Act 1", "creator": null, "worker_version": null, "worker_run": null, - "image": "152f12ae-61dc-42cd-afac-efb2eed8bbee", - "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", + "image": null, + "polygon": null, "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1325,18 +1318,18 @@ }, { "model": "documents.element", - "pk": "ec6cb9f9-793b-4b45-9d8a-f743ffcb3606", + "pk": "e4ba2e60-7416-47de-bbef-ae651b4e1fcf", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "9e698b00-1a35-4dae-9026-781504f05585", - "name": "Volume 1, page 1r", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "DATUM", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", - "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", + "image": "870187ce-4d32-4a39-84fd-603a3398146b", + "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1344,18 +1337,18 @@ }, { "model": "documents.element", - "pk": "f87f773e-7622-4342-a5e8-446acc3600d3", + "pk": "e58a12a9-7c74-4859-b7c1-0be44e00421a", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "PARIS", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "d0ac1408-8575-4e51-9e54-d066dac523de", + "name": "Surface F", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", - "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", + "image": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", + "polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1363,18 +1356,18 @@ }, { "model": "documents.element", - "pk": "fe7d0a83-3138-48bf-961c-cd5b98f42423", + "pk": "f6dc0f9b-def7-4d77-bccf-aca2ffd2cec0", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "type": "d22d7782-aa3e-43bf-b448-fa4996f98033", - "name": "ROY", + "corpus": "75425382-912b-40fd-ae59-a39667324735", + "type": "ce711ca5-fc25-4545-b038-2e3da65ece10", + "name": "DATUM", "creator": null, "worker_version": null, "worker_run": null, - "image": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", - "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", + "image": "d3ac3480-b41b-48e7-a6e8-1bd85d64b7d7", + "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", "rotation_angle": 0, "mirrored": false, "confidence": null @@ -1382,91 +1375,91 @@ }, { "model": "documents.entitytype", - "pk": "14bf7625-6651-4989-a4b0-caccc4efd0bf", + "pk": "0747eee5-d513-489e-bfb5-eb0e9684869b", "fields": { - "name": "person", + "name": "date", "color": "ff0000", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba" + "corpus": "75425382-912b-40fd-ae59-a39667324735" } }, { "model": "documents.entitytype", - "pk": "4e8c67f9-5fda-4242-90f7-ef295f45a52a", + "pk": "5cbe3dd2-91b9-4bec-84ce-8a8dc47f0d6c", "fields": { - "name": "organization", + "name": "person", "color": "ff0000", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba" + "corpus": "75425382-912b-40fd-ae59-a39667324735" } }, { "model": "documents.entitytype", - "pk": "507dd1ed-3b24-46af-90ba-9b90abff9af6", + "pk": "681e59ac-1926-4599-aec3-58c3a6b9f626", "fields": { - "name": "number", + "name": "organization", "color": "ff0000", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba" + "corpus": "75425382-912b-40fd-ae59-a39667324735" } }, { "model": "documents.entitytype", - "pk": "54cf1c46-2e9b-4c09-acb8-8be33a9e033e", + "pk": "dd103cb4-2cb2-4072-a502-ee0310b8dad1", "fields": { "name": "location", "color": "ff0000", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba" + "corpus": "75425382-912b-40fd-ae59-a39667324735" } }, { "model": "documents.entitytype", - "pk": "9d5550f5-49e4-4db7-b1d2-398a84c03092", + "pk": "e6a0757b-7c25-4b05-b262-e92ff9c9a1d8", "fields": { - "name": "date", + "name": "number", "color": "ff0000", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba" + "corpus": "75425382-912b-40fd-ae59-a39667324735" } }, { "model": "documents.transcription", - "pk": "33cc6487-947b-415f-a5e0-e876415db6b0", + "pk": "3d53b273-9888-404c-b0c0-06ab04d5a4ea", "fields": { - "element": "ae5e750a-12d5-44b8-95e5-36b9bc18b0e0", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "6b9437f3-61ce-452a-be20-aef28c60b12e", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "DATUM", + "text": "ROY", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "402e7a5e-918d-4f34-99af-eb5a67bc4a67", + "pk": "3d6347fb-f301-433a-b40f-54d6100c543b", "fields": { - "element": "d5120897-d198-45b8-99fc-c806128dc492", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "83cfa57d-e55d-4312-bc2a-18cd675c809c", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "DATUM", + "text": "Lorem ipsum dolor sit amet", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "be1f59c3-be5a-4a34-a024-e84aca3fa427", + "pk": "410b1572-4d7d-47ed-86a5-01ac7941bead", "fields": { - "element": "cc1d9aed-7e02-4bc0-a883-a3803d375370", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "e4ba2e60-7416-47de-bbef-ae651b4e1fcf", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "PARIS", + "text": "DATUM", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "d16c87b9-e117-499b-ad0d-2dcac95297e2", + "pk": "6dd05988-538e-4b14-b865-e18c15d7f691", "fields": { - "element": "0b831f72-d975-466c-b627-415974d39728", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "f6dc0f9b-def7-4d77-bccf-aca2ffd2cec0", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, "text": "DATUM", "orientation": "horizontal-lr", @@ -1475,111 +1468,111 @@ }, { "model": "documents.transcription", - "pk": "d6f72c12-9b6c-4aef-a995-5a5826c3c6df", + "pk": "83dff01d-8531-4089-88c0-a41b36bcf6f7", "fields": { - "element": "f87f773e-7622-4342-a5e8-446acc3600d3", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "4022ca03-6946-4229-aeeb-9f214aa7d5ed", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "PARIS", + "text": "ROY", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "d709e5d9-51b6-458a-b830-53aa04cea6f3", + "pk": "85094dc3-8bef-43c4-8576-4417da8418ed", "fields": { - "element": "fe7d0a83-3138-48bf-961c-cd5b98f42423", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "82050278-d20b-4997-af7d-06bfdd233c0d", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "ROY", + "text": "PARIS", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "e2871f16-cb0a-4d1a-96fb-f38e03c536bd", + "pk": "a24da88a-1808-4571-a2ab-5cc7d2431b8f", "fields": { - "element": "ec6cb9f9-793b-4b45-9d8a-f743ffcb3606", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "9a11f92a-64a2-417c-8c26-4ad3829c396d", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "Lorem ipsum dolor sit amet", + "text": "ROY", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "eb092b75-6fda-49a9-bd76-25f9429838a6", + "pk": "a984adcb-017b-4057-98c5-28b75748d37f", "fields": { - "element": "b9f61d7c-d230-4a2e-8cb7-29f0df30223b", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "83341e32-e2ce-4e0b-b7c2-2aa4f721af97", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "ROY", + "text": "PARIS", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "ecd6ab17-1d34-4993-9efe-be966a215e5d", + "pk": "b7de8631-b44b-4680-892d-69252e4f860f", "fields": { - "element": "498fc569-228a-4bef-b777-524edf9aa357", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "74e5d7f2-28d5-4d3c-9179-10f606be80f1", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "ROY", + "text": "PARIS", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.transcription", - "pk": "f70df96c-29b5-415a-843b-b2a444054773", + "pk": "c63b4cc5-a44d-474d-8f44-8c1d618ac4cb", "fields": { - "element": "4712384f-c4fa-42a2-b900-9b0d0aa7c1c7", - "worker_version": "f006179d-ff9a-449c-bfc5-c6f6a9e809cf", + "element": "a7c66de0-aaf9-433c-a2a7-a2292d459b59", + "worker_version": "bb5b4802-1c97-4f7d-8cbe-668a110ee641", "worker_run": null, - "text": "PARIS", + "text": "DATUM", "orientation": "horizontal-lr", "confidence": 1.0 } }, { "model": "documents.allowedmetadata", - "pk": "73186b18-6bc2-461e-873d-2c43c59934e8", + "pk": "1a5c028f-998c-4400-a67a-9e3991244d45", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", + "corpus": "75425382-912b-40fd-ae59-a39667324735", "type": "date", "name": "date" } }, { "model": "documents.allowedmetadata", - "pk": "a8b472bf-dfee-4a6a-ac65-a54d6dc546cc", + "pk": "ce23a488-25e1-4b2c-af12-219e51705f27", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", + "corpus": "75425382-912b-40fd-ae59-a39667324735", "type": "location", "name": "location" } }, { "model": "documents.allowedmetadata", - "pk": "d6892f8f-c21a-4c62-996e-95b79e7fe7dd", + "pk": "e4333819-35de-46c9-8e83-5fee63ea59ec", "fields": { - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", + "corpus": "75425382-912b-40fd-ae59-a39667324735", "type": "text", "name": "folio" } }, { "model": "documents.metadata", - "pk": "35542ebc-009e-4f40-9a4a-6b2805b30677", + "pk": "04d6b974-eb3e-4687-b2be-c8a69205bdde", "fields": { - "element": "12696972-1dae-449d-80c5-a0c5110156d9", - "name": "number", + "element": "a0c83c35-0941-4967-b8f1-882e479f3357", + "name": "folio", "type": "text", - "value": "5", + "value": "2r", "entity": null, "worker_version": null, "worker_run": null @@ -1587,9 +1580,9 @@ }, { "model": "documents.metadata", - "pk": "3d657aae-062d-4a43-876b-bc83cd99c641", + "pk": "0c85e1c8-aaf7-42e7-aa24-1551845b6056", "fields": { - "element": "d532d5f6-3f00-4cde-888e-ac1dfb23270e", + "element": "11028ff8-f842-4e72-92f4-e5ee93cd1fed", "name": "folio", "type": "text", "value": "1r", @@ -1600,9 +1593,9 @@ }, { "model": "documents.metadata", - "pk": "54382fa5-4a9b-44a2-86b5-8ec4c7940dd1", + "pk": "1234be09-8436-49a7-b9d2-aad50bc20a6e", "fields": { - "element": "d2673a72-5bce-410c-9250-c38552c37e1a", + "element": "bbefa496-f47e-4742-b619-3d11e8f64395", "name": "folio", "type": "text", "value": "1v", @@ -1613,12 +1606,12 @@ }, { "model": "documents.metadata", - "pk": "7efbfc25-43f3-4dee-a377-7e0dc6bcde9e", + "pk": "1ea37dd7-09ba-45dd-80c6-eddbad5714d0", "fields": { - "element": "13dcc584-4c57-4939-8ebf-38a3997d6681", + "element": "48a60d32-727f-4c0b-a082-23770ff5aaa5", "name": "number", "type": "text", - "value": "1", + "value": "3", "entity": null, "worker_version": null, "worker_run": null @@ -1626,12 +1619,12 @@ }, { "model": "documents.metadata", - "pk": "b8c80d94-430d-4d7f-8f5b-489c97db6366", + "pk": "24cf119f-b0e7-4546-a232-74a457482333", "fields": { - "element": "25d5ae34-f6fc-4a6d-90ff-1a63181c7f6b", - "name": "folio", + "element": "3e343e73-539f-49c2-b649-ca1de6292d87", + "name": "number", "type": "text", - "value": "2r", + "value": "4", "entity": null, "worker_version": null, "worker_run": null @@ -1639,12 +1632,12 @@ }, { "model": "documents.metadata", - "pk": "c4077ea9-9872-464e-acd1-931f539f2baa", + "pk": "475cf82d-6edd-4dec-876b-26d239af1f3d", "fields": { - "element": "2d7f3ffc-0d68-4ce6-9501-192fb7389439", + "element": "ce62c3da-c737-4aac-bf13-0b7e5ca29942", "name": "number", "type": "text", - "value": "4", + "value": "1", "entity": null, "worker_version": null, "worker_run": null @@ -1652,12 +1645,12 @@ }, { "model": "documents.metadata", - "pk": "c447cfa3-510e-491d-b6de-59442d80a6e1", + "pk": "5063a91c-ede7-4299-9541-de7bc454aa0b", "fields": { - "element": "640f7d63-1ce9-4932-b909-d59fd8382e0d", - "name": "folio", + "element": "c3d4eead-5222-4d1f-b8d6-707152886600", + "name": "number", "type": "text", - "value": "2r", + "value": "2", "entity": null, "worker_version": null, "worker_run": null @@ -1665,12 +1658,12 @@ }, { "model": "documents.metadata", - "pk": "d5a77cb6-6435-4055-8910-fbca5a0e0a9f", + "pk": "79ef76b8-ed8d-4710-a4a9-d0545a055cfe", "fields": { - "element": "19fa4694-1579-4e3b-9c78-f2953f402d55", - "name": "number", + "element": "83cfa57d-e55d-4312-bc2a-18cd675c809c", + "name": "folio", "type": "text", - "value": "3", + "value": "1r", "entity": null, "worker_version": null, "worker_run": null @@ -1678,12 +1671,12 @@ }, { "model": "documents.metadata", - "pk": "dbdbbb85-2bf1-415f-8337-1e9ee97054fe", + "pk": "a0c89ffb-48ef-475b-935a-c814eccb26b4", "fields": { - "element": "ec6cb9f9-793b-4b45-9d8a-f743ffcb3606", + "element": "7d6abd28-990a-41bf-bd43-8b006f0d0a70", "name": "folio", "type": "text", - "value": "1r", + "value": "2r", "entity": null, "worker_version": null, "worker_run": null @@ -1691,12 +1684,12 @@ }, { "model": "documents.metadata", - "pk": "e5134aa3-e92e-4f73-95c2-dac3c2830f94", + "pk": "a23729e3-46e6-4a77-bd42-c7981ecc6d59", "fields": { - "element": "4dc9662a-0c78-4f61-b2b2-d066f9e50be9", - "name": "number", + "element": "7630868f-43b3-4ff1-b2a7-e135ab965904", + "name": "folio", "type": "text", - "value": "2", + "value": "1v", "entity": null, "worker_version": null, "worker_run": null @@ -1704,12 +1697,12 @@ }, { "model": "documents.metadata", - "pk": "fb4ab719-6663-4681-b652-f68b2447ddb6", + "pk": "d8cb2764-592b-4894-9803-22c01991dc0e", "fields": { - "element": "d1beed1a-1651-407a-9ffb-ee57dabca7bc", - "name": "folio", + "element": "2a417a0b-5d12-4bc4-8cc8-a0484d7f3546", + "name": "number", "type": "text", - "value": "1v", + "value": "5", "entity": null, "worker_version": null, "worker_run": null @@ -1732,12 +1725,12 @@ }, { "model": "images.image", - "pk": "152f12ae-61dc-42cd-afac-efb2eed8bbee", + "pk": "0b85ac6c-7f87-4d4d-b87d-f2d9212b0795", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "server": 1, - "path": "img4", + "path": "img3", "width": 1000, "height": 1000, "hash": null, @@ -1746,12 +1739,12 @@ }, { "model": "images.image", - "pk": "739b25d6-065c-4309-b2e4-f8ac000e6741", + "pk": "1e6bbb51-78f6-455f-8571-5b08d538a8f3", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "server": 1, - "path": "img2", + "path": "img5", "width": 1000, "height": 1000, "hash": null, @@ -1760,12 +1753,12 @@ }, { "model": "images.image", - "pk": "b2aabf63-61a8-4651-b5cd-33bc2a85e36e", + "pk": "62e9090c-cf98-4c1f-8d3e-639bf60cc187", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "server": 1, - "path": "img6", + "path": "img4", "width": 1000, "height": 1000, "hash": null, @@ -1774,12 +1767,12 @@ }, { "model": "images.image", - "pk": "c8a30310-5071-4eb7-b4f7-00bd700237df", + "pk": "6b515575-e5b1-4fd1-b191-61950d4440c9", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "server": 1, - "path": "img3", + "path": "img6", "width": 1000, "height": 1000, "hash": null, @@ -1788,12 +1781,12 @@ }, { "model": "images.image", - "pk": "d1ee80ce-9106-4680-a133-cc96ace159e5", + "pk": "870187ce-4d32-4a39-84fd-603a3398146b", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "server": 1, - "path": "img5", + "path": "img1", "width": 1000, "height": 1000, "hash": null, @@ -1802,12 +1795,12 @@ }, { "model": "images.image", - "pk": "de1922b2-ec28-41d3-a85d-57da90cf6cfb", + "pk": "d3ac3480-b41b-48e7-a6e8-1bd85d64b7d7", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", "server": 1, - "path": "img1", + "path": "img2", "width": 1000, "height": 1000, "hash": null, @@ -1816,64 +1809,64 @@ }, { "model": "users.right", - "pk": "07908dcf-cd81-4609-83d6-c8b926987984", + "pk": "26ceffe0-ab1d-4b3c-9484-e01caf3ff83f", "fields": { - "user": 3, + "user": 2, "group": null, "content_type": 32, - "content_id": "4010fae2-a254-4435-8d6d-e6fec27cc1e4", - "level": 50 + "content_id": "d8732bf4-8578-4539-af87-9b463f3a52a4", + "level": 100 } }, { "model": "users.right", - "pk": "40f64538-3ff8-4b01-9c60-a4e8b6b100c2", + "pk": "61d0bd66-325f-455a-8b07-1f896a80dfb8", "fields": { "user": 2, "group": null, - "content_type": 11, - "content_id": "fb4aa7c7-0231-4a1c-ad7a-2a3b947fba9d", - "level": 10 + "content_type": 19, + "content_id": "75425382-912b-40fd-ae59-a39667324735", + "level": 100 } }, { "model": "users.right", - "pk": "8505a44b-3984-4c9a-9828-053dc4bcc60e", + "pk": "93a7bd78-cc73-4063-be0c-7626d81217b8", "fields": { "user": 2, "group": null, - "content_type": 32, - "content_id": "4010fae2-a254-4435-8d6d-e6fec27cc1e4", - "level": 100 + "content_type": 11, + "content_id": "56908aa7-93cf-449a-9232-bca7d3dd8a32", + "level": 10 } }, { "model": "users.right", - "pk": "b03aa330-76fa-4cdc-af1d-e3ccdf14cc5c", + "pk": "aa7c968b-4624-4529-a34c-667e0534321f", "fields": { - "user": 2, + "user": 4, "group": null, - "content_type": 19, - "content_id": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", - "level": 100 + "content_type": 32, + "content_id": "d8732bf4-8578-4539-af87-9b463f3a52a4", + "level": 10 } }, { "model": "users.right", - "pk": "eb0c361b-8c4a-4a9e-85d2-b1504fda12cc", + "pk": "e2b78d5b-c64f-4cec-bc8d-95d56fb4b061", "fields": { - "user": 4, + "user": 3, "group": null, "content_type": 32, - "content_id": "4010fae2-a254-4435-8d6d-e6fec27cc1e4", - "level": 10 + "content_id": "d8732bf4-8578-4539-af87-9b463f3a52a4", + "level": 50 } }, { "model": "users.user", "pk": 1, "fields": { - "password": "pbkdf2_sha256$390000$Bzx70AhImHu7uIz6kF1yDV$bPqu3tLjpL8TdxdpiGL5KvZovPbxWn7bz1QU5BdTX70=", + "password": "pbkdf2_sha256$390000$OCDNg5xX8Ur3GfuRGEbORT$s3w3NW3EA37wroqkeFBI3ddXCK2mDaY94Jcs7bMibWo=", "last_login": null, "email": "root@root.fr", "display_name": "Admin", @@ -1888,7 +1881,7 @@ "model": "users.user", "pk": 2, "fields": { - "password": "pbkdf2_sha256$390000$SUY9oKPZalXfjd47H8ZdXJ$ZZ1MymCoMub887/pjOAZwxnI+okJbWb+6gqcxgA1hWA=", + "password": "pbkdf2_sha256$390000$DMBz7ydObdYuv41DJvj3T3$FnHn+sA25juLixnshmxeIKZzzCoDA2yzNtUp4BMpWmA=", "last_login": null, "email": "user@user.fr", "display_name": "Test user", @@ -1931,7 +1924,7 @@ }, { "model": "users.group", - "pk": "4010fae2-a254-4435-8d6d-e6fec27cc1e4", + "pk": "d8732bf4-8578-4539-af87-9b463f3a52a4", "fields": { "name": "User group", "public": false, @@ -3893,19 +3886,19 @@ }, { "model": "ponos.farm", - "pk": "fb4aa7c7-0231-4a1c-ad7a-2a3b947fba9d", + "pk": "56908aa7-93cf-449a-9232-bca7d3dd8a32", "fields": { "name": "Wheat farm", - "seed": "c75f3f28eb0fec73f3bbe3d783ba39def0d1acdc4861d5b65e2d03bb8574559c" + "seed": "6a25cc1380ad7e25f32d7d93b2952f37afd7fb467be03d124008f6cfd2cdcd48" } }, { "model": "training.dataset", - "pk": "02ef42cf-27dc-45b5-aa56-347e4b879b75", + "pk": "b9ec826d-78a2-447f-bba6-37145dce2f4a", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", + "corpus": "75425382-912b-40fd-ae59-a39667324735", "creator": 2, "task": null, "name": "Second Dataset", @@ -3916,11 +3909,11 @@ }, { "model": "training.dataset", - "pk": "d9fa73fa-4e6b-40a3-aabb-3b113e4e4e7c", + "pk": "fa107cef-f927-4e5a-8c06-678378926bfe", "fields": { "created": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z", - "corpus": "9b958f01-72af-4030-ab5c-7bbcb79c96ba", + "corpus": "75425382-912b-40fd-ae59-a39667324735", "creator": 2, "task": null, "name": "First Dataset", @@ -3931,50 +3924,50 @@ }, { "model": "training.datasetset", - "pk": "16660130-8175-4f8c-86f2-3cb0ad1e7426", + "pk": "43fb8192-f0c1-4249-b5cf-95e5910226c8", "fields": { - "name": "train", - "dataset": "02ef42cf-27dc-45b5-aa56-347e4b879b75" + "name": "dev", + "dataset": "b9ec826d-78a2-447f-bba6-37145dce2f4a" } }, { "model": "training.datasetset", - "pk": "2b513ae4-0d44-42f5-b353-9253c2551f11", + "pk": "9f386fc6-9602-46c7-91df-d0167de930ff", "fields": { - "name": "train", - "dataset": "d9fa73fa-4e6b-40a3-aabb-3b113e4e4e7c" + "name": "dev", + "dataset": "fa107cef-f927-4e5a-8c06-678378926bfe" } }, { "model": "training.datasetset", - "pk": "353078ea-131b-4ce3-ab9a-e3cec28115e8", + "pk": "b543de6b-c52c-4ae3-b1ba-3853659449b0", "fields": { "name": "test", - "dataset": "d9fa73fa-4e6b-40a3-aabb-3b113e4e4e7c" + "dataset": "fa107cef-f927-4e5a-8c06-678378926bfe" } }, { "model": "training.datasetset", - "pk": "bd86ece2-8ffc-410e-b746-fcce2b8e2690", + "pk": "bcfe654c-2d88-454a-92eb-8bcbf7abd0e8", "fields": { - "name": "dev", - "dataset": "d9fa73fa-4e6b-40a3-aabb-3b113e4e4e7c" + "name": "train", + "dataset": "fa107cef-f927-4e5a-8c06-678378926bfe" } }, { "model": "training.datasetset", - "pk": "dba75cc5-3642-4ea3-bff4-f72e1104ebfd", + "pk": "e2b648a5-a453-4ee4-bb6b-3023cd82902f", "fields": { - "name": "dev", - "dataset": "02ef42cf-27dc-45b5-aa56-347e4b879b75" + "name": "train", + "dataset": "b9ec826d-78a2-447f-bba6-37145dce2f4a" } }, { "model": "training.datasetset", - "pk": "ed22bb51-e708-496f-8fde-e5784b107c82", + "pk": "f891beb7-37d0-46ee-82fa-46e1fdd6157a", "fields": { "name": "test", - "dataset": "02ef42cf-27dc-45b5-aa56-347e4b879b75" + "dataset": "b9ec826d-78a2-447f-bba6-37145dce2f4a" } } ] diff --git a/arkindex/documents/management/commands/bootstrap.py b/arkindex/documents/management/commands/bootstrap.py index a5024cc462..d2a90f2dc0 100644 --- a/arkindex/documents/management/commands/bootstrap.py +++ b/arkindex/documents/management/commands/bootstrap.py @@ -186,7 +186,6 @@ class Command(BaseCommand): "configuration": {}, "state": WorkerVersionState.Created, "gpu_usage": FeatureUsage.Disabled, - "docker_image": None, "docker_image_iid": None, } ) @@ -219,7 +218,6 @@ class Command(BaseCommand): version.configuration = {} version.state = WorkerVersionState.Created version.gpu_usage = FeatureUsage.Disabled - version.docker_image = None version.docker_image_iid = None version.save() diff --git a/arkindex/documents/management/commands/cleanup.py b/arkindex/documents/management/commands/cleanup.py index ff521f16bd..9911d73042 100644 --- a/arkindex/documents/management/commands/cleanup.py +++ b/arkindex/documents/management/commands/cleanup.py @@ -7,7 +7,7 @@ import django_rq from botocore.exceptions import ClientError from django.conf import settings from django.core.management.base import BaseCommand -from django.db.models import Exists, F, Max, OuterRef, Q +from django.db.models import Exists, Max, OuterRef from django.utils import timezone from rq.utils import as_text @@ -17,14 +17,10 @@ from arkindex.ponos.models import Artifact, Task from arkindex.process.models import ( CorpusWorkerVersion, DataFile, - GitRef, - GitRefType, Process, Worker, WorkerActivity, WorkerRun, - WorkerVersion, - WorkerVersionState, ) from arkindex.project.aws import s3 from arkindex.project.rq_overrides import Job @@ -98,34 +94,10 @@ class Command(BaseCommand): self.stdout.write(self.style.SUCCESS("Successfully cleaned up orphaned Ponos artifacts.")) def cleanup_expired_processes(self): - # Keep processes that built artifacts for WorkerVersions on Git tags or main branches - worker_version_docker_image_processes = ( - GitRef - .objects - .filter( - Q(type=GitRefType.Tag) - | Q(type=GitRefType.Branch, name__in=("master", "main")) - ) - # There might be a revision with no WorkerVersions at all, or a revision with - # no WorkerVersions that have a docker_image, which could cause the process ID - # to be NULL. This query will be used in a NOT IN clause, which would return - # FALSE when a process is in this subquery, and NULL when it isn't, because - # SQL handles NULL values weirdly. This would cause the parent query to evaluate - # a WHERE NULL, which is assumed to be FALSE, so all processes would be excluded. - # - # Excluding NULLs directly with a .exclude(revision__...__process_id=None) - # causes the JOINs to be duplicated, so we use an annotation to make sure the - # ORM understands we are filtering on the column that we are selecting. - .annotate(process_id=F("revision__versions__docker_image__task__process_id")) - .exclude(process_id=None) - .values("process_id") - ) - expired_processes = Process \ .objects \ .annotate(max_expiry=Max("tasks__expiry")) \ - .filter(max_expiry__lt=timezone.now()) \ - .exclude(id__in=worker_version_docker_image_processes) + .filter(max_expiry__lt=timezone.now()) # A Ponos task can be linked to a Dataset when it provides the artifacts for a Dataset in a Complete state. # As Datasets are meant to be stable, we do not want to destroy these tasks and artifacts. @@ -148,12 +120,6 @@ class Command(BaseCommand): except ClientError as e: self.stdout.write(self.style.ERROR(str(e))) - # Worker versions must have a Docker image as their artifact to be available; - # we have to update their state to avoid violating a DB constraint when deleting. - affected_versions = WorkerVersion.objects.filter(state=WorkerVersionState.Available, docker_image__in=artifacts) - self.stdout.write(f"Updating {affected_versions.count()} available worker versions to the Error state…") - affected_versions.update(state=WorkerVersionState.Error) - self.stdout.write(f"Removing {artifacts.count()} artifacts of expired processes…") artifacts.delete() diff --git a/arkindex/documents/tests/commands/test_cleanup.py b/arkindex/documents/tests/commands/test_cleanup.py index 40a215c8c8..e4443f7d0b 100644 --- a/arkindex/documents/tests/commands/test_cleanup.py +++ b/arkindex/documents/tests/commands/test_cleanup.py @@ -20,7 +20,6 @@ from arkindex.process.models import ( Worker, WorkerRun, WorkerVersion, - WorkerVersionState, ) from arkindex.project.tests import FixtureTestCase from arkindex.training.models import Dataset, Model, ModelVersion @@ -39,6 +38,24 @@ class TestCleanupCommand(FixtureTestCase): call_command("cleanup", args + ["--no-color"], stdout=output, stderr=output) return output.getvalue().strip() + def _make_artifact(self): + """ + Create an artifact on an expired process + """ + process = Process.objects.create( + farm=Farm.objects.first(), + mode=ProcessMode.Workers, + corpus=self.corpus, + creator=self.superuser, + ) + task = process.tasks.create( + run=0, + depth=0, + slug="task", + expiry=datetime(1970, 1, 1, tzinfo=timezone.utc), + ) + return task.artifacts.create(path="artichoke", size=99999) + def test_cleanup(self, s3_mock, rq_mock): young_export = self.corpus.exports.create(user=self.superuser) # Use a fake creation time to make old exports @@ -57,7 +74,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -103,7 +119,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -148,7 +163,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -203,7 +217,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -259,7 +272,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -323,7 +335,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -402,7 +413,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -511,7 +521,6 @@ class TestCleanupCommand(FixtureTestCase): Removing artifact s3_key Removing logs for 1 tasks of expired processes from S3… Removing task log s3_key - Updating 0 available worker versions to the Error state… Removing 1 artifacts of expired processes… Removing 1 tasks of expired processes… Successfully cleaned up expired processes. @@ -555,124 +564,6 @@ class TestCleanupCommand(FixtureTestCase): self.assertEqual(s3_mock.Object().delete.call_count, 2) - def _make_revision_artifact(self): - """ - Create an artifact on an expired process and assign it to a worker version. - """ - process = Process.objects.create( - farm=Farm.objects.first(), - mode=ProcessMode.Workers, - corpus=self.corpus, - creator=self.superuser, - ) - task = process.tasks.create( - run=0, - depth=0, - slug="task", - expiry=datetime(1970, 1, 1, tzinfo=timezone.utc), - ) - artifact = task.artifacts.create(path="artichoke", size=99999) - - repo = Repository.objects.get(url="http://my_repo.fake/workers/worker") - revision = repo.revisions.create( - hash=str(uuid.uuid4()), - message="A revision", - author="Someone", - ) - repo.workers.first().versions.create( - revision=revision, - docker_image=artifact, - state=WorkerVersionState.Available, - configuration={}, - ) - - return revision, artifact - - def test_cleanup_expired_processes_docker_images(self, s3_mock, rq_mock): - """ - Artifacts used as Docker images for worker versions from expired processes - should only be deleted if the versions are neither on Git tags or on main branches. - """ - lonely_revision, lonely_artifact = self._make_revision_artifact() - branch_revision, branch_artifact = self._make_revision_artifact() - # These three should not be deleted - master_revision, master_artifact = self._make_revision_artifact() - main_revision, main_artifact = self._make_revision_artifact() - tagged_revision, tagged_artifact = self._make_revision_artifact() - - branch_revision.refs.create(repository=branch_revision.repo, type=GitRefType.Branch, name="my-awesome-branch") - master_revision.refs.create(repository=master_revision.repo, type=GitRefType.Branch, name="master") - main_revision.refs.create(repository=main_revision.repo, type=GitRefType.Branch, name="main") - tagged_revision.refs.create(repository=tagged_revision.repo, type=GitRefType.Tag, name="1.2.3-rc4") - - s3_mock.Object().key = "s3_key" - s3_mock.Object().delete.return_value = None - seal(s3_mock) - - self.assertEqual( - self.cleanup(), - dedent( - """ - Removing archived workers… - Successfully cleaned up 0 archived workers. - Removing orphaned Ponos artifacts… - Successfully cleaned up orphaned Ponos artifacts. - Removing 2 artifacts of expired processes from S3… - Removing artifact s3_key - Removing artifact s3_key - Removing logs for 2 tasks of expired processes from S3… - Removing task log s3_key - Removing task log s3_key - Updating 2 available worker versions to the Error state… - Removing 2 artifacts of expired processes… - Removing 2 tasks of expired processes… - Successfully cleaned up expired processes. - Removing 0 old corpus exports from S3… - Removing 0 old corpus exports… - Successfully cleaned up old corpus exports. - Removing orphaned corpus exports… - Successfully cleaned up orphaned corpus exports. - Deleting 0 DataFiles marked as trashed from S3 and the database… - Successfully cleaned up DataFiles marked as trashed. - Removing orphan images… - Successfully cleaned up orphan images. - Removing orphaned local images… - Successfully cleaned up orphaned local images. - Removing orphaned Ponos logs… - Successfully cleaned up orphaned Ponos logs. - Removing archived models… - Successfully cleaned up 0 archived models. - Removing orphaned model versions archives… - Successfully cleaned up orphaned model versions archives. - Cleaning up deleted jobs from RQ user registries… - Successfully cleaned up 0 deleted jobs from 0 RQ user registries. - """ - ).strip() - ) - - with self.assertRaises(Artifact.DoesNotExist): - lonely_artifact.refresh_from_db() - with self.assertRaises(Task.DoesNotExist): - lonely_artifact.task.refresh_from_db() - with self.assertRaises(Artifact.DoesNotExist): - branch_artifact.refresh_from_db() - with self.assertRaises(Task.DoesNotExist): - branch_artifact.task.refresh_from_db() - - # Those still exist, refreshing works - lonely_artifact.task.process.refresh_from_db() - branch_artifact.task.process.refresh_from_db() - master_artifact.refresh_from_db() - main_artifact.refresh_from_db() - tagged_artifact.refresh_from_db() - lonely_revision.refresh_from_db() - branch_revision.refresh_from_db() - master_revision.refresh_from_db() - main_revision.refresh_from_db() - tagged_revision.refresh_from_db() - - self.assertEqual(s3_mock.Object().delete.call_count, 4) - def test_cleanup_expired_processes_null(self, s3_mock, rq_mock): repo = Repository.objects.get(url="http://my_repo.fake/workers/worker") @@ -701,9 +592,8 @@ class TestCleanupCommand(FixtureTestCase): ) # These artifacts should be cleaned up - lonely_revision, lonely_artifact = self._make_revision_artifact() - branch_revision, branch_artifact = self._make_revision_artifact() - branch_revision.refs.create(repository=branch_revision.repo, type=GitRefType.Branch, name="my-awesome-branch") + lonely_artifact = self._make_artifact() + lonely_artifact_2 = self._make_artifact() s3_mock.Object().key = "s3_key" s3_mock.Object().delete.return_value = None @@ -723,7 +613,6 @@ class TestCleanupCommand(FixtureTestCase): Removing logs for 2 tasks of expired processes from S3… Removing task log s3_key Removing task log s3_key - Updating 2 available worker versions to the Error state… Removing 2 artifacts of expired processes… Removing 2 tasks of expired processes… Successfully cleaned up expired processes. @@ -755,15 +644,13 @@ class TestCleanupCommand(FixtureTestCase): with self.assertRaises(Task.DoesNotExist): lonely_artifact.task.refresh_from_db() with self.assertRaises(Artifact.DoesNotExist): - branch_artifact.refresh_from_db() + lonely_artifact_2.refresh_from_db() with self.assertRaises(Task.DoesNotExist): - branch_artifact.task.refresh_from_db() + lonely_artifact_2.task.refresh_from_db() # Those still exist, refreshing works lonely_artifact.task.process.refresh_from_db() - branch_artifact.task.process.refresh_from_db() - lonely_revision.refresh_from_db() - branch_revision.refresh_from_db() + lonely_artifact_2.task.process.refresh_from_db() empty_revision.refresh_from_db() unavailable_worker_revision.refresh_from_db() @@ -803,7 +690,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -856,7 +742,7 @@ class TestCleanupCommand(FixtureTestCase): image_no_element_old_2 = Image.objects.create(path="path/pathpathpath/img", width=12, height=12, server=img_server) image_no_element_new = Image.objects.create(path="path/pathpath/img", width=12, height=12, server=img_server) - with self.assertNumQueries(21): + with self.assertNumQueries(19): self.assertEqual( self.cleanup(), dedent( @@ -867,7 +753,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -945,7 +830,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -1028,7 +912,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -1110,7 +993,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -1191,7 +1073,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -1285,7 +1166,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. @@ -1355,7 +1235,6 @@ class TestCleanupCommand(FixtureTestCase): Successfully cleaned up orphaned Ponos artifacts. Removing 0 artifacts of expired processes from S3… Removing logs for 0 tasks of expired processes from S3… - Updating 0 available worker versions to the Error state… Removing 0 artifacts of expired processes… Removing 0 tasks of expired processes… Successfully cleaned up expired processes. diff --git a/arkindex/documents/tests/commands/test_load_export.py b/arkindex/documents/tests/commands/test_load_export.py index 7e4c300f4e..0547711709 100644 --- a/arkindex/documents/tests/commands/test_load_export.py +++ b/arkindex/documents/tests/commands/test_load_export.py @@ -37,7 +37,7 @@ class TestLoadExport(FixtureTestCase): "process.repository": ["git_ref_revisions"], "process.worker": [], "process.revision": ["message", "author"], - "process.workerversion": ["created", "updated", "configuration", "state", "docker_image", "docker_image_iid"], + "process.workerversion": ["created", "updated", "configuration", "state", "docker_image_iid"], # The WorkerRuns lose their parents, use different worker versions that just got recreated, # are assigned to the user's local process and not the original one "process.workerrun": ["parents", "version", "process", "summary", "created", "updated"], diff --git a/arkindex/process/admin.py b/arkindex/process/admin.py index 61002d41e3..8523535e00 100644 --- a/arkindex/process/admin.py +++ b/arkindex/process/admin.py @@ -83,8 +83,8 @@ class RepositoryAdmin(admin.ModelAdmin): class WorkerVersionInline(admin.StackedInline): show_change_link = True model = WorkerVersion - fields = ("revision", "state", "configuration", "docker_image_id") - readonly_fields = ("revision", "state", "configuration", "docker_image_id") + fields = ("revision", "state", "configuration", "docker_image_iid") + readonly_fields = ("revision", "state", "configuration", "docker_image_iid") def get_queryset(self, *args, **kwargs): """ @@ -120,9 +120,9 @@ class WorkerTypeAdmin(admin.ModelAdmin): class WorkerVersionAdmin(admin.ModelAdmin): list_display = ("id", "worker", "revision", "version") list_filter = ("worker", ) - fields = ("id", "worker", "revision", "version", "configuration", "model_usage", "gpu_usage") + fields = ("id", "worker", "revision", "version", "configuration", "model_usage", "gpu_usage", "docker_image_iiid") readonly_fields = ("id", ) - raw_id_fields = ("docker_image", "revision") + raw_id_fields = ("revision", ) class WorkerConfigurationAdmin(admin.ModelAdmin): diff --git a/arkindex/process/migrations/0035_remove_workerversion_dockerimage.py b/arkindex/process/migrations/0035_remove_workerversion_dockerimage.py new file mode 100644 index 0000000000..970fcf7c5b --- /dev/null +++ b/arkindex/process/migrations/0035_remove_workerversion_dockerimage.py @@ -0,0 +1,38 @@ +# Generated by Django 4.1.7 on 2024-06-14 15:34 + +from django.db import migrations, models + +import arkindex.process.models + + +class Migration(migrations.Migration): + + dependencies = [ + ("process", "0034_remove_iiif_import_mode"), + ] + + operations = [ + migrations.RemoveConstraint( + model_name="workerversion", + name="workerversion_available_requires_docker_image", + ), + migrations.RemoveField( + model_name="workerversion", + name="docker_image", + ), + migrations.RunSQL( + [ + """ + UPDATE process_workerversion + SET state = 'error' + WHERE state = 'available' AND docker_image_iid IS NULL + """ + ], + reverse_sql=migrations.RunSQL.noop, + elidable=True, + ), + migrations.AddConstraint( + model_name="workerversion", + constraint=models.CheckConstraint(check=models.Q(models.Q(("state", arkindex.process.models.WorkerVersionState["Available"]), _negated=True), models.Q(("docker_image_iid", None), _negated=True), _connector="OR"), name="workerversion_available_requires_docker_image"), + ) + ] diff --git a/arkindex/process/models.py b/arkindex/process/models.py index 86723642f6..d382844063 100644 --- a/arkindex/process/models.py +++ b/arkindex/process/models.py @@ -1,7 +1,5 @@ -import urllib.parse import uuid from functools import partial -from typing import Optional from django.conf import settings from django.contrib.contenttypes.fields import GenericRelation @@ -16,7 +14,7 @@ from enumfields import Enum, EnumField import pgtrigger from arkindex.documents.models import Classification, Element -from arkindex.ponos.models import FINAL_STATES, STATES_ORDERING, Artifact, State, Task, task_token_default +from arkindex.ponos.models import FINAL_STATES, STATES_ORDERING, State, Task, task_token_default from arkindex.process.builder import ProcessBuilder from arkindex.process.managers import ( ActivityManager, @@ -734,10 +732,6 @@ class WorkerVersion(models.Model): gpu_usage = EnumField(FeatureUsage, default=FeatureUsage.Disabled, blank=True) model_usage = EnumField(FeatureUsage, default=FeatureUsage.Disabled, blank=True) - # Foreign key towards the ponos Artifact holding the image content, - # for workers imported via the Git imports - docker_image = models.ForeignKey(Artifact, on_delete=models.SET_NULL, null=True, blank=True) - # The Docker internal image id (sha256:xxx) that can be shared across multiple images # For workers imported with `arkindex workers publish`, the tag of the Docker image docker_image_iid = models.CharField(null=True, blank=True, max_length=512) @@ -754,9 +748,9 @@ class WorkerVersion(models.Model): class Meta: constraints = [ - # Available worker versions must either have a docker_image_id or docker_image_iid set + # Available worker versions must have a docker_image_iid set models.CheckConstraint( - check=~models.Q(state=WorkerVersionState.Available) | ~Q(docker_image_id=None, docker_image_iid=None), + check=~models.Q(state=WorkerVersionState.Available) | ~Q(docker_image_iid=None), name="workerversion_available_requires_docker_image", ), # Require exactly one of revision or version is set @@ -785,14 +779,6 @@ class WorkerVersion(models.Model): return f"{self.worker} for version {self.version}" return f"{self.worker} for revision {self.revision}" - @property - def docker_image_name(self) -> Optional[str]: - # TODO: Remove when Git imports are dropped. This is replaced by the tag set in `docker_image_iid` - if self.worker.repository is None: - return None - parsed_url = urllib.parse.urlparse(self.worker.repository.url) - return f"{parsed_url.netloc}{parsed_url.path}/{self.worker.slug}:{self.id}".lower() - @property def slug(self): return f"{self.worker.slug}_{self.truncated_id}" @@ -940,7 +926,7 @@ class WorkerRun(models.Model): assert ( self.version.state == WorkerVersionState.Available - and (self.version.docker_image_id or self.version.docker_image_iid) + and self.version.docker_image_iid ), ( f"Worker Version {self.version.id} is not available and cannot be used to build a task." ) @@ -967,8 +953,7 @@ class WorkerRun(models.Model): task = Task( command=self.version.docker_command, - image=self.version.docker_image_iid or self.version.docker_image_name, - image_artifact_id=self.version.docker_image_id, + image=self.version.docker_image_iid, env=task_env, shm_size=self.version.docker_shm_size, slug=self.task_slug + slug_suffix, diff --git a/arkindex/process/serializers/imports.py b/arkindex/process/serializers/imports.py index 49ecf605c7..2a30265ce5 100644 --- a/arkindex/process/serializers/imports.py +++ b/arkindex/process/serializers/imports.py @@ -415,7 +415,7 @@ class StartProcessSerializer(serializers.Serializer): missing_model_versions.append(worker_run.version.worker.name) if ( worker_run.version.state != WorkerVersionState.Available - or (worker_run.version.docker_image_id is None and not worker_run.version.docker_image_iid) + or not worker_run.version.docker_image_iid ): unavailable_versions.append(worker_run.version.id) if worker_run.model_version_id and worker_run.model_version.state != ModelVersionState.Available: @@ -541,7 +541,7 @@ class ApplyProcessTemplateSerializer(ProcessACLMixin, serializers.Serializer): # The template's worker runs have already been prefetched, so we can use them to validate directly if any( run.version.state != WorkerVersionState.Available - or (run.version.docker_image_id is None and not run.version.docker_image_iid) + or not run.version.docker_image_iid for run in template_process.worker_runs.all() ): raise ValidationError(detail="This template contains one or more unavailable worker versions and cannot be applied.") diff --git a/arkindex/process/serializers/workers.py b/arkindex/process/serializers/workers.py index ff75ace496..8e1a8cc4f9 100644 --- a/arkindex/process/serializers/workers.py +++ b/arkindex/process/serializers/workers.py @@ -241,20 +241,17 @@ class WorkerVersionSerializer(serializers.ModelSerializer): "configuration", "revision", "version", - "docker_image", "docker_image_iid", - "docker_image_name", "state", "gpu_usage", "model_usage", "worker", "created", ) - read_only_fields = ("docker_image_name", "revision", "version") + read_only_fields = ("revision", "version") # Avoid loading all revisions and all Ponos artifacts when opening this endpoint in a browser extra_kwargs = { "revision": {"style": {"base_template": "input.html"}}, - "docker_image": {"style": {"base_template": "input.html"}}, } def validate_configuration(self, configuration): @@ -277,18 +274,13 @@ class WorkerVersionSerializer(serializers.ModelSerializer): if not state: return data - image = ( - data["docker_image"] if "docker_image" in data - else self.instance and self.instance.docker_image_id - ) image_iid = ( data["docker_image_iid"] if "docker_image_iid" in data else self.instance and self.instance.docker_image_iid ) - if state == WorkerVersionState.Available and not image and not image_iid: + if state == WorkerVersionState.Available and not image_iid: raise ValidationError({"state": [ - "A worker version must either have a Docker image artifact " - "or a `docker_image_iid` set when updated to available." + "A worker version must have a `docker_image_iid` set when updated to available." ]}) return data diff --git a/arkindex/process/tests/test_corpus_worker_runs.py b/arkindex/process/tests/test_corpus_worker_runs.py index 66c125399e..a60dc53b70 100644 --- a/arkindex/process/tests/test_corpus_worker_runs.py +++ b/arkindex/process/tests/test_corpus_worker_runs.py @@ -121,9 +121,7 @@ class TestCorpusWorkerRuns(FixtureAPITestCase): "custom": "value" }, "created": self.local_worker_version.created.isoformat().replace("+00:00", "Z"), - "docker_image": None, "docker_image_iid": None, - "docker_image_name": None, "gpu_usage": "disabled", "id": str(self.local_worker_version.id), "model_usage": FeatureUsage.Disabled.value, @@ -143,9 +141,7 @@ class TestCorpusWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.dla_worker_version.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.dla_worker_version.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/dla:{self.dla_worker_version.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { diff --git a/arkindex/process/tests/test_create_process.py b/arkindex/process/tests/test_create_process.py index 3c5cfc3875..885a1bf5c4 100644 --- a/arkindex/process/tests/test_create_process.py +++ b/arkindex/process/tests/test_create_process.py @@ -621,8 +621,6 @@ class TestCreateProcess(FixtureAPITestCase): self.assertEqual(len(dla_task.token), 44) self.assertNotEqual(reco_task.token, dla_task.token) - self.assertEqual(dla_task.image_artifact, self.version_2.docker_image) - # Check worker activities has been created for concerned elements on both runs self.assertEqual(activities_delay_mock.call_count, 1) self.assertEqual(activities_delay_mock.call_args, call(process_2)) diff --git a/arkindex/process/tests/test_docker_worker_version.py b/arkindex/process/tests/test_docker_worker_version.py index 8117a9145f..13ea925b2b 100644 --- a/arkindex/process/tests/test_docker_worker_version.py +++ b/arkindex/process/tests/test_docker_worker_version.py @@ -230,9 +230,7 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertDictEqual(response.json(), { "id": str(new_version.id), "configuration": {"test": "A"}, - "docker_image": None, "docker_image_iid": "a_docker_image", - "docker_image_name": new_version.docker_image_name, "gpu_usage": FeatureUsage.Disabled.value, "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -294,9 +292,7 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertDictEqual(response.json(), { "id": str(new_version.id), "configuration": {"test": "A"}, - "docker_image": None, "docker_image_iid": "e" * 512, - "docker_image_name": new_version.docker_image_name, "gpu_usage": FeatureUsage.Required.value, "model_usage": FeatureUsage.Supported.value, "revision": { @@ -367,9 +363,7 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertDictEqual(response.json(), { "id": str(new_version.id), "configuration": {"test": "A"}, - "docker_image": None, "docker_image_iid": "e" * 512, - "docker_image_name": new_version.docker_image_name, "gpu_usage": FeatureUsage.Required.value, "model_usage": FeatureUsage.Supported.value, "revision": { @@ -469,9 +463,7 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertDictEqual(response.json(), { "id": str(new_version.id), "configuration": {"test": "A"}, - "docker_image": None, "docker_image_iid": "a_docker_image", - "docker_image_name": new_version.docker_image_name, "gpu_usage": FeatureUsage.Required.value, "model_usage": FeatureUsage.Required.value, "revision": { @@ -532,9 +524,7 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertDictEqual(response.json(), { "id": str(self.version.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": "registry.somewhere.com/something:latest", - "docker_image_name": self.version.docker_image_name, "gpu_usage": FeatureUsage.Disabled.value, "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -601,9 +591,7 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertDictEqual(response.json(), { "id": str(new_version.id), "configuration": {"key": "value"}, - "docker_image": None, "docker_image_iid": "docker_image_42", - "docker_image_name": new_version.docker_image_name, "gpu_usage": FeatureUsage.Disabled.value, "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -637,7 +625,6 @@ class TestDockerWorkerVersion(FixtureAPITestCase): self.assertEqual(new_version.worker.public, False) self.assertEqual(new_version.worker.repository, new_repo) self.assertEqual(new_version.configuration, {"key": "value"}) - self.assertEqual(new_version.docker_image_id, None) self.assertEqual(new_version.docker_image_iid, "docker_image_42") self.assertEqual(new_version.gpu_usage, FeatureUsage.Disabled) self.assertEqual(new_version.model_usage, FeatureUsage.Disabled) diff --git a/arkindex/process/tests/test_processes.py b/arkindex/process/tests/test_processes.py index 1047c1a707..802e11c757 100644 --- a/arkindex/process/tests/test_processes.py +++ b/arkindex/process/tests/test_processes.py @@ -2381,9 +2381,8 @@ class TestProcesses(FixtureAPITestCase): def test_start_process_from_docker_image(self): """ - Start a process with an available WorkerVersion that only has a docker_image_iid + Start a process with an available WorkerVersion with a docker_image_iid """ - self.recognizer.docker_image_id = None self.recognizer.docker_image_iid = "hello-world" self.recognizer.save() self.assertEqual(self.recognizer.state, WorkerVersionState.Available) @@ -2759,7 +2758,7 @@ class TestProcesses(FixtureAPITestCase): "ARKINDEX_WORKER_RUN_ID": str(run.id), "TASK_ELEMENTS": "/data/initialisation/elements.json" }) - self.assertEqual(worker_task.image, run.version.docker_image_iid or run.version.docker_image_name) + self.assertEqual(worker_task.image, run.version.docker_image_iid) self.assertEqual(worker_task.command, run.version.docker_command) self.assertEqual(worker_task.extra_files, { "model": "https://arkindex.localhost" + reverse("api:model-version-download", kwargs={"pk": run.model_version.id}) + f"?token={run.model_version.build_authentication_token_hash()}" diff --git a/arkindex/process/tests/test_templates.py b/arkindex/process/tests/test_templates.py index cc32112c7f..d13b01793c 100644 --- a/arkindex/process/tests/test_templates.py +++ b/arkindex/process/tests/test_templates.py @@ -295,7 +295,8 @@ class TestTemplates(FixtureAPITestCase): ) def test_apply_without_a_template(self): - """Raise 404 if the template is not a template + """ + Raise 404 if the template is not a template """ self.client.force_login(self.user) response = self.client.post( @@ -331,25 +332,6 @@ class TestTemplates(FixtureAPITestCase): self.assertIsNone(child_run.configuration_id) self.assertListEqual(child_run.parents, [parent_run.id]) - def test_apply_docker_image_iid(self): - """ - Either docker_image_id or docker_image_iid attribute can be set - """ - - self.version_2.docker_image_id = None - self.version_2.docker_image_iid = "test" - self.version_2.save() - - self.client.force_login(self.user) - with self.assertNumQueries(9): - response = self.client.post( - reverse("api:apply-process-template", kwargs={"pk": str(self.template.id)}), - data=json.dumps({"process_id": str(self.process.id)}), - content_type="application/json", - ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertEqual(response.json()["template_id"], str(self.template.id)) - def test_apply_delete_previous_worker_runs(self): self.client.force_login(self.user) # Create a process with one worker run already diff --git a/arkindex/process/tests/test_user_workerruns.py b/arkindex/process/tests/test_user_workerruns.py index e4a3072dd2..a205e6ad8a 100644 --- a/arkindex/process/tests/test_user_workerruns.py +++ b/arkindex/process/tests/test_user_workerruns.py @@ -95,9 +95,7 @@ class TestUserWorkerRuns(FixtureAPITestCase): "test": 42 }, "created": self.version_1.created.isoformat().replace("+00:00", "Z"), - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{str(self.version_1.id)}", "gpu_usage": "disabled", "id": str(self.version_1.id), "model_usage": FeatureUsage.Disabled.value, @@ -140,9 +138,7 @@ class TestUserWorkerRuns(FixtureAPITestCase): "custom": "value" }, "created": self.custom_version.created.isoformat().replace("+00:00", "Z"), - "docker_image": None, "docker_image_iid": None, - "docker_image_name": None, "gpu_usage": "disabled", "id": str(self.custom_version.id), "model_usage": FeatureUsage.Disabled.value, @@ -222,9 +218,7 @@ class TestUserWorkerRuns(FixtureAPITestCase): "category": "level 14 djinni" }, "created": self.other_version.created.isoformat().replace("+00:00", "Z"), - "docker_image": None, "docker_image_iid": None, - "docker_image_name": None, "gpu_usage": "disabled", "id": str(self.other_version.id), "model_usage": FeatureUsage.Disabled.value, @@ -429,9 +423,7 @@ class TestUserWorkerRuns(FixtureAPITestCase): "category": "level 14 djinni" }, "created": self.other_version.created.isoformat().replace("+00:00", "Z"), - "docker_image": None, "docker_image_iid": None, - "docker_image_name": None, "gpu_usage": "disabled", "id": str(self.other_version.id), "model_usage": FeatureUsage.Disabled.value, diff --git a/arkindex/process/tests/test_workerruns.py b/arkindex/process/tests/test_workerruns.py index abd504a12e..efd8b2a4e1 100644 --- a/arkindex/process/tests/test_workerruns.py +++ b/arkindex/process/tests/test_workerruns.py @@ -132,9 +132,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -410,9 +408,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -504,9 +500,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -610,9 +604,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(version.id), "configuration": {}, - "docker_image": None, "docker_image_iid": version.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{version.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -665,7 +657,7 @@ class TestWorkerRuns(FixtureAPITestCase): self.worker_1.memberships.update(level=Role.Guest.value) self.client.force_login(self.user) - with self.assertNumQueries(6): + with self.assertNumQueries(5): response = self.client.get( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}) ) @@ -693,9 +685,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -732,7 +722,7 @@ class TestWorkerRuns(FixtureAPITestCase): def test_retrieve(self): self.client.force_login(self.user) - with self.assertNumQueries(6): + with self.assertNumQueries(5): response = self.client.get(reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)})) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -758,9 +748,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -852,9 +840,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_custom.id), "configuration": {"custom": "value"}, - "docker_image": None, "docker_image_iid": None, - "docker_image_name": None, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": None, @@ -910,7 +896,7 @@ class TestWorkerRuns(FixtureAPITestCase): # Check that the gitrefs are retrieved with RetrieveWorkerRun self.client.force_login(self.user) - with self.assertNumQueries(6): + with self.assertNumQueries(5): response = self.client.get(reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)})) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -955,7 +941,7 @@ class TestWorkerRuns(FixtureAPITestCase): run = self.local_process.worker_runs.create(version=self.version_1, parents=[]) self.client.force_login(self.user) - with self.assertNumQueries(7): + with self.assertNumQueries(6): response = self.client.get( reverse("api:worker-run-details", kwargs={"pk": str(run.id)}), ) @@ -966,9 +952,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -1031,7 +1015,7 @@ class TestWorkerRuns(FixtureAPITestCase): # Agent auth is not implemented in CE self.client.force_authenticate(user=self.agent) - with self.assertNumQueries(5): + with self.assertNumQueries(4): response = self.client.get( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), ) @@ -1042,9 +1026,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -1103,7 +1085,7 @@ class TestWorkerRuns(FixtureAPITestCase): def test_update_requires_nothing(self): self.client.force_login(self.user) - with self.assertNumQueries(8): + with self.assertNumQueries(7): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={}, @@ -1265,7 +1247,7 @@ class TestWorkerRuns(FixtureAPITestCase): Process field cannot be updated """ self.client.force_login(self.user) - with self.assertNumQueries(8): + with self.assertNumQueries(7): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={ @@ -1298,9 +1280,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -1333,7 +1313,7 @@ class TestWorkerRuns(FixtureAPITestCase): """ self.client.force_login(self.user) - with self.assertNumQueries(8): + with self.assertNumQueries(7): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={ @@ -1365,9 +1345,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -1400,7 +1378,7 @@ class TestWorkerRuns(FixtureAPITestCase): # Check generated summary, before updating, it should not be that verbose self.assertEqual(self.run_1.summary, f"Worker Recognizer @ {str(self.run_1.version.id)[:6]}") - with self.assertNumQueries(9): + with self.assertNumQueries(8): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": self.run_1.id}), data={ @@ -1440,9 +1418,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -1807,7 +1783,7 @@ class TestWorkerRuns(FixtureAPITestCase): ] for model_version in model_versions: with self.subTest(model_version=model_version): - with self.assertNumQueries(9): + with self.assertNumQueries(8): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": str(run.id)}), data={ @@ -1851,9 +1827,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(version_with_model.id), "configuration": {"test": "test2"}, - "docker_image": None, "docker_image_iid": None, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{version_with_model.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Supported.value, "revision": { @@ -1905,7 +1879,7 @@ class TestWorkerRuns(FixtureAPITestCase): # Check generated summary, before updating, there should be only information about the worker version self.assertEqual(run.summary, f"Worker {self.worker_1.name} @ {str(version_with_model.id)[:6]}") - with self.assertNumQueries(10): + with self.assertNumQueries(9): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": str(run.id)}), data={ @@ -1955,9 +1929,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(version_with_model.id), "configuration": {"test": "test2"}, - "docker_image": None, "docker_image_iid": None, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{version_with_model.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Required.value, "revision": { @@ -2002,7 +1974,7 @@ class TestWorkerRuns(FixtureAPITestCase): ) self.client.force_login(self.user) - with self.assertNumQueries(10): + with self.assertNumQueries(9): response = self.client.put( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={ @@ -2035,9 +2007,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -2240,7 +2210,7 @@ class TestWorkerRuns(FixtureAPITestCase): """ self.client.force_login(self.user) - with self.assertNumQueries(8): + with self.assertNumQueries(7): response = self.client.patch( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={ @@ -2272,9 +2242,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -2307,7 +2275,7 @@ class TestWorkerRuns(FixtureAPITestCase): """ self.client.force_login(self.user) - with self.assertNumQueries(8): + with self.assertNumQueries(7): response = self.client.patch( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={ @@ -2339,9 +2307,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -2373,7 +2339,7 @@ class TestWorkerRuns(FixtureAPITestCase): self.assertEqual(self.run_1.configuration, None) self.assertEqual(self.run_1.summary, f"Worker {self.run_1.version.worker.name} @ {str(self.run_1.version.id)[:6]}") - with self.assertNumQueries(9): + with self.assertNumQueries(8): response = self.client.patch( reverse("api:worker-run-details", kwargs={"pk": self.run_1.id}), data={ @@ -2411,9 +2377,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { @@ -2766,7 +2730,7 @@ class TestWorkerRuns(FixtureAPITestCase): ] for model_version in model_versions: with self.subTest(model_version=model_version): - with self.assertNumQueries(9): + with self.assertNumQueries(8): response = self.client.patch( reverse("api:worker-run-details", kwargs={"pk": str(run.id)}), data={ @@ -2809,9 +2773,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(version_with_model.id), "configuration": {"test": "test2"}, - "docker_image": None, "docker_image_iid": None, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{version_with_model.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Required.value, "revision": { @@ -2862,7 +2824,7 @@ class TestWorkerRuns(FixtureAPITestCase): ) self.assertEqual(run.model_version_id, None) - with self.assertNumQueries(9): + with self.assertNumQueries(8): response = self.client.patch( reverse("api:worker-run-details", kwargs={"pk": str(run.id)}), data={ @@ -2910,9 +2872,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(version_with_model.id), "configuration": {"test": "test2"}, - "docker_image": None, "docker_image_iid": None, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{version_with_model.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Required.value, "revision": { @@ -2956,7 +2916,7 @@ class TestWorkerRuns(FixtureAPITestCase): ) self.client.force_login(self.user) - with self.assertNumQueries(10): + with self.assertNumQueries(9): response = self.client.patch( reverse("api:worker-run-details", kwargs={"pk": str(self.run_1.id)}), data={ @@ -2989,9 +2949,7 @@ class TestWorkerRuns(FixtureAPITestCase): "worker_version": { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, "revision": { diff --git a/arkindex/process/tests/test_workers.py b/arkindex/process/tests/test_workers.py index 280118cab8..3ca0775144 100644 --- a/arkindex/process/tests/test_workers.py +++ b/arkindex/process/tests/test_workers.py @@ -1175,7 +1175,6 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): revision=last_revision, configuration={"a": "bc"}, state=WorkerVersionState.Error, - docker_image=self.version_1.docker_image ) last_version.created = "1999-09-09T09:09:09.090909Z" last_version.save() @@ -1194,9 +1193,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): self.assertDictEqual(first_version, { "id": str(last_version.id), "configuration": {"a": "bc"}, - "docker_image": None, "docker_image_iid": last_version.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{last_version.id}", "state": "error", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, @@ -1354,8 +1351,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): self.assertDictEqual(response.json(), { "state": [ - "A worker version must either have a Docker image artifact " - "or a `docker_image_iid` set when updated to available." + "A worker version must have a `docker_image_iid` set when updated to available." ] }) @@ -1546,9 +1542,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): "id": str(new_version.id), "configuration": {"test": "val"}, "created": new_version.created.isoformat().replace("+00:00", "Z"), - "docker_image": None, "docker_image_iid": None, - "docker_image_name": None, "gpu_usage": FeatureUsage.Disabled.value, "model_usage": FeatureUsage.Required.value, "revision": None, @@ -2176,7 +2170,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): Worker versions may be retrieved with no authentication in order to see the version on public resources """ - with self.assertNumQueries(6): + with self.assertNumQueries(5): response = self.client.get(reverse("api:version-retrieve", kwargs={"pk": str(self.version_1.id)})) self.assertEqual(response.status_code, status.HTTP_200_OK) data = response.json() @@ -2185,9 +2179,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): self.assertDictEqual(data, { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "state": "available", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, @@ -2211,9 +2203,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): self.assertDictEqual(data, { "id": str(self.version_1.id), "configuration": {"test": 42}, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "state": "available", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, @@ -2232,7 +2222,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): reverse("api:version-retrieve", kwargs={"pk": str(self.version_1.id)}), data={ "configuration": {"test": "test2"}, - "docker_image": "12341234-1234-1234-1234-123412341234", + "docker_image_iid": "registry.nerv.co.jp/cruel/angel/thesis:latest", "state": "error", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, @@ -2247,7 +2237,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): reverse("api:version-retrieve", kwargs={"pk": "12341234-1234-1234-1234-123412341234"}), data={ "configuration": {"test": "test2"}, - "docker_image": "12341234-1234-1234-1234-123412341234", + "docker_image_iid": "registry.nerv.co.jp/cruel/angel/thesis:latest", "state": "error", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, @@ -2268,7 +2258,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): reverse("api:version-retrieve", kwargs={"pk": str(self.version_1.id)}), data={ "configuration": {"test": "test2"}, - "docker_image": str(docker_image_iid), + "docker_image_iid": str(docker_image_iid), "state": "error", "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, @@ -2300,15 +2290,13 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): self.version_1.refresh_from_db() self.assertEqual(data["configuration"], {"test": "test2"}) self.assertEqual(data["docker_image_iid"], "eva:unit-01") - self.assertIsNone(data["docker_image"]) self.assertEqual(data["state"], "error") self.assertEqual(data["gpu_usage"], "disabled") def test_cannot_update_worker_version_revision_ignored(self): self.version_1.state = WorkerVersionState.Created - self.version_1.docker_image = None self.version_1.save() - with self.assertNumQueries(8): + with self.assertNumQueries(7): response = self.client.patch( reverse("api:version-retrieve", kwargs={"pk": str(self.version_1.id)}), data={ @@ -2326,7 +2314,6 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): def test_update_version_valid(self): self.version_1.state = WorkerVersionState.Created - self.version_1.docker_image = None self.version_1.save() process = self.corpus.processes.create( @@ -2336,19 +2323,11 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): ) process.run() - task = process.tasks.first() - artifact = task.artifacts.create( - path="path/to/file.json", - size=100, - content_type="application/json", - ) - response = self.client.patch( reverse("api:version-retrieve", kwargs={"pk": str(self.version_1.id)}), data={ "configuration": {"test": "test2"}, - "docker_image": str(artifact.id), - "docker_image_iid": "sha256:deadbeef", + "docker_image_iid": "registry.nerv.co.jp/cruel/angel/thesis:latest", "state": "available", }, format="json", @@ -2358,8 +2337,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): data = response.json() self.assertEqual(data["id"], str(self.version_1.id)) self.assertEqual(data["configuration"], {"test": "test2"}) - self.assertEqual(data["docker_image"], str(artifact.id)) - self.assertEqual(data["docker_image_iid"], "sha256:deadbeef") + self.assertEqual(data["docker_image_iid"], "registry.nerv.co.jp/cruel/angel/thesis:latest") self.assertEqual(data["state"], "available") self.assertEqual(data["gpu_usage"], "disabled") @@ -2377,64 +2355,10 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertDictEqual(response.json(), { "state": [ - "A worker version must either have a Docker image artifact " - "or a `docker_image_iid` set when updated to available." - ] - }) - - def test_update_version_available_docker_image_not_null(self): - process = self.corpus.processes.create( - creator=self.user, - mode=ProcessMode.Workers, - farm=self.farm, - ) - process.run() - task = process.tasks.first() - self.version_1.docker_image_iid = None - self.version_1.docker_image = task.artifacts.create( - path="path/to/file.json", - size=100, - content_type="application/json", - ) - self.version_1.state = WorkerVersionState.Available - self.version_1.save() - - response = self.client.patch( - reverse("api:version-retrieve", kwargs={"pk": str(self.version_1.id)}), - data={"docker_image": None}, - format="json", - HTTP_AUTHORIZATION=f"Ponos {self.task.token}", - ) - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertDictEqual(response.json(), { - "state": [ - "A worker version must either have a Docker image artifact " - "or a `docker_image_iid` set when updated to available." + "A worker version must have a `docker_image_iid` set when updated to available." ] }) - def test_property_docker_image_name_no_repository(self): - self.assertEqual(self.version_custom.docker_image_name, None) - - def test_property_docker_image_name(self): - self.assertEqual(self.version_1.docker_image_name, f"my_repo.fake/workers/worker/reco:{self.version_1.id}") - - def test_property_docker_image_name_explicit(self): - version_2 = WorkerVersion.objects.create( - id="12341234-1234-1234-1234-123412341234", - worker=self.worker_reco, - revision=self.rev2, - configuration={"test": "test1"}, - gpu_usage=FeatureUsage.Disabled - ) - self.assertEqual( - version_2.docker_image_name, - "my_repo.fake/workers/worker/reco:12341234-1234-1234-1234-123412341234" - ) - - def test_property_slug(self): - self.assertEqual(self.version_1.slug, f"reco_{str(self.version_1.id)[0:6]}") - def test_property_slug_explicit(self): version_2 = WorkerVersion.objects.create( id="01234567-89ab-cdef-fedc-ba9876543210", @@ -2490,9 +2414,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_2.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/dla:{self.version_2.id}", "state": "available", "worker": { "id": str(self.worker_dla.id), @@ -2521,9 +2443,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "state": "available", "worker": { "id": str(self.worker_reco.id), @@ -2584,9 +2504,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_2.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/dla:{self.version_2.id}", "state": "available", "worker": { "id": str(self.worker_dla.id), @@ -2615,9 +2533,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_2.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "state": "available", "worker": { "id": str(self.worker_reco.id), @@ -2674,9 +2590,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_2.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/dla:{self.version_2.id}", "state": "available", "worker": { "id": str(self.worker_dla.id), @@ -2720,9 +2634,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "state": "available", "worker": { "id": str(self.worker_reco.id), @@ -2785,9 +2697,7 @@ class TestWorkersWorkerVersions(FixtureAPITestCase): }, "gpu_usage": "disabled", "model_usage": FeatureUsage.Disabled.value, - "docker_image": None, "docker_image_iid": self.version_1.docker_image_iid, - "docker_image_name": f"my_repo.fake/workers/worker/reco:{self.version_1.id}", "state": "available", "worker": { "id": str(self.worker_reco.id), diff --git a/arkindex/project/checks.py b/arkindex/project/checks.py index 769b8932f2..2bf951a840 100644 --- a/arkindex/project/checks.py +++ b/arkindex/project/checks.py @@ -296,25 +296,25 @@ def signup_default_group_check(*args, **kwargs): @only_runserver def init_elements_check(*args, **kwargs): from django.conf import settings - docker_image = settings.INIT_ELEMENTS_DOCKER_IMAGE + docker_image_iid = settings.INIT_ELEMENTS_DOCKER_IMAGE warning = None try: WorkerVersion.objects.init_elements_version except WorkerVersion.DoesNotExist: - warning = f"Worker version with Docker image {docker_image} does not exist." + warning = f"Worker version with Docker image {docker_image_iid} does not exist." except WorkerVersion.MultipleObjectsReturned: - warning = f"Multiple worker versions returned for Docker image {docker_image}." + warning = f"Multiple worker versions returned for Docker image {docker_image_iid}." except ValueError: - warning = f"Worker version with Docker image {docker_image} is not in the Available state." + warning = f"Worker version with Docker image {docker_image_iid} is not in the Available state." if warning: return [Warning( f"{warning}\n" "This worker version is required to initialize elements when running a process on Arkindex.\n" "Starting or retrying processes will fail.", - hint=f"settings.INIT_ELEMENTS_DOCKER_IMAGE = {docker_image}", + hint=f"settings.INIT_ELEMENTS_DOCKER_IMAGE = {docker_image_iid}", id="arkindex.W014", )] diff --git a/arkindex/sql_validation/indexer_prefetch.sql b/arkindex/sql_validation/indexer_prefetch.sql index 65b4a4df62..2777d0d4ef 100644 --- a/arkindex/sql_validation/indexer_prefetch.sql +++ b/arkindex/sql_validation/indexer_prefetch.sql @@ -54,7 +54,6 @@ SELECT "process_workerversion"."id", "process_workerversion"."state", "process_workerversion"."gpu_usage", "process_workerversion"."model_usage", - "process_workerversion"."docker_image_id", "process_workerversion"."docker_image_iid", "process_workerversion"."created", "process_workerversion"."updated" @@ -130,7 +129,6 @@ SELECT "process_workerversion"."id", "process_workerversion"."state", "process_workerversion"."gpu_usage", "process_workerversion"."model_usage", - "process_workerversion"."docker_image_id", "process_workerversion"."docker_image_iid", "process_workerversion"."created", "process_workerversion"."updated" -- GitLab