Support workers without revisions
Arkindex 1.5.2 will make WorkerVersion.revision
and Worker.repository
nullable, in the case where a worker is created manually in the frontend. It is possible to specify a Docker image reference when creating a worker version in the frontend, so there can be a WorkerVersion without a revision but that has a Docker image.
Adding a worker with this method then running it causes the worker to crash:
Traceback (most recent call last):
File "/usr/local/bin/worker-ufcn", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/worker_ufcn/worker.py", line 467, in main
UFCNDetector(description="U-FCN", support_cache=True).run()
File "/usr/local/lib/python3.10/dist-packages/arkindex_worker/worker/__init__.py", line 170, in run
self.configure()
File "/usr/local/lib/python3.10/dist-packages/worker_ufcn/worker.py", line 213, in configure
super().configure()
File "/usr/local/lib/python3.10/dist-packages/arkindex_worker/worker/__init__.py", line 160, in configure
super().configure()
File "/usr/local/lib/python3.10/dist-packages/arkindex_worker/worker/base.py", line 251, in configure
f"Loaded worker {self.worker_details['name']} revision {worker_version['revision']['hash'][0:7]} from API"
TypeError: 'NoneType' object is not subscriptable