AssertionError when executing a worker version created manually with a Docker image reference
While testing frontend!1579 (merged), I created a worker version with a Docker image reference. This makes it available
as expected, so I tried to run it in a process.
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner
response = get_response(request)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 55, in wrapped_view
return view_func(*args, **kwargs)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in view
return self.dispatch(request, *args, **kwargs)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/drf_spectacular/utils.py", line 448, in wrapped_method
return method(self, request, *args, **kwargs)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/generics.py", line 190, in post
return self.create(request, *args, **kwargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/api.py", line 591, in create
self.perform_create(serializer)
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/mixins.py", line 24, in perform_create
serializer.save()
File "/home/lucidiot/.virtualenvs/backend/lib/python3.10/site-packages/rest_framework/serializers.py", line 200, in save
self.instance = self.update(self.instance, validated_data)
File "/home/lucidiot/dev/ark/backend/arkindex/process/serializers/imports.py", line 508, in update
process.run()
File "/usr/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/home/lucidiot/dev/ark/backend/arkindex/process/models.py", line 420, in run
process_builder.build()
File "/home/lucidiot/dev/ark/backend/arkindex/process/builder.py", line 371, in build
_build(*args, **kwargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/builder.py", line 45, in _wraps
func(self, *args, **kwargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/builder.py", line 356, in build_dataset
task, parent_slugs = worker_run.build_task(
File "/home/lucidiot/dev/ark/backend/arkindex/process/models.py", line 887, in build_task
assert self.version.revision_id, 'The worker version must be linked to a revision in order to build a task'
AssertionError: The worker version must be linked to a revision in order to build a task
2023-11-07 12:38:04,044 [ERROR] "POST /api/v1/process/9009719d-6080-40fb-a32d-1a68f3316bd5/start/ HTTP/1.1" 500 27613
We need to support starting a WorkerVersion that has no revision.