Dear Girder experts,
I’m now interested in girder-worker (using python tasks first). I spent time reading the following document:
- https://girder-worker.readthedocs.io
- girder_worker/TRANSITION.md at master · girder/girder_worker · GitHub
- girder_worker/HACKING.md at master · girder/girder_worker · GitHub
I follow the steps indicated in the documentation and tutorial:
- install girder-worker and rabbitmq-server [done]
- creating a task [done]
- getting start tutorial of girder-worker [done]
Question
My objective is to use Girder Worker with Girder (using python tasks first). From my basic understanding, the celeri approach make thing quite simple. But I missed one important information. I got the following error when creating the job in a girder plugin. Could you indicate to what refer the missing link ? Where should I define the getWorkerApiUrl ? Please find below additionnal information regarding the status/location of both girder server and girder worker:
Thanks in advance,
Valéry
async_result = fibonacci.delay(2)
Traceback (most recent call last):
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_worker/app.py", line 55, in girder_before_task_publish
job = context.create_task_job(
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_worker/context/girder_context.py", line 27, in create_task_job
job = job_model.createJob(
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_jobs/models/job.py", line 251, in createJob
job = self.save(job)
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_jobs/models/job.py", line 271, in save
job = super().save(job, *args, **kwargs)
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder/models/model_base.py", line 506, in save
events.trigger('model.%s.save.after' % self.name, document)
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder/events.py", line 292, in trigger
handler(e)
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_worker/girder_plugin/event_handlers.py", line 159, in attachJobInfoSpec
Job().updateJob(job, otherFields={'jobInfoSpec': jobInfoSpec(job)})
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_worker/girder_plugin/utils.py", line 167, in jobInfoSpec
'url': '/'.join((getWorkerApiUrl(), 'job', str(job['_id']))),
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder_worker/girder_plugin/utils.py", line 51, in getWorkerApiUrl
return apiUrl or getApiUrl()
File "/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/girder/api/rest.py", line 84, in getApiUrl
raise GirderException('Could not determine API root in %s.' % url)
girder.exceptions.GirderException: Could not determine API root in /.
Additionnal information
- Girder-server and girder worker are both install on the some computer.
- On the girder-server side, I use the defaut link, the girder worker plugin seems activated (see picture)
- On the girder-worker side, I used the following comand : celery worker -A girder_worker.app -l info that return
on passe dans le plugin GwTaskPlugin pour importer la tache
/home/valeryozenne/Dev/Girder/test-girder/lib/python3.8/site-packages/celery/backends/amqp.py:65: CPendingDeprecationWarning:
The AMQP result backend is scheduled for deprecation in version 4.0 and removal in version v5.0. Please use RPC backend or a persistent backend.
deprecated.warn(
-------------- celery@ihusux001 v4.4.7 (cliffs)
--- ***** -----
-- ******* ---- Linux-5.4.0-91-generic-x86_64-with-glibc2.29 2022-01-14 16:52:48
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: girder_worker:0x7fd7ca7858b0
- ** ---------- .> transport: amqp://guest:**@localhost:5672//
- ** ---------- .> results: amqp://
- *** --- * --- .> concurrency: 80 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
[tasks]
. girder_worker.docker.tasks.docker_run
. gw_task_plugin.tasks.example_task
. gw_task_plugin.tasks.fibonacci
. gw_task_plugin.tasks.my_plus_task
. gwexample.analyses.tasks.fibonacci
. slicer_cli_web.girder_worker_plugin.direct_docker_run.run
[2022-01-14 16:52:50,912: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2022-01-14 16:52:50,922: INFO/MainProcess] mingle: searching for neighbors
[2022-01-14 16:52:51,940: INFO/MainProcess] mingle: all alone
[2022-01-14 16:52:51,964: INFO/MainProcess] celery@ihusux001 ready.
[2022-01-14 16:54:11,066: INFO/MainProcess] Received task: gw_task_plugin.tasks.example_task[3d06956d-b0e7-44c3-a433-f514b43d9434]
[2022-01-14 16:54:11,069: WARNING/ForkPoolWorker-64] [2022-01-14 16:54:11,069] WARNING: No jobInfoSpec. Setting job_manager to None.
[2022-01-14 16:54:11,069: WARNING/ForkPoolWorker-64] No jobInfoSpec. Setting job_manager to None.
[2022-01-14 16:54:11,107: INFO/ForkPoolWorker-64] Task gw_task_plugin.tasks.example_task[3d06956d-b0e7-44c3-a433-f514b43d9434] succeeded in 0.022846607957035303s: 'hello world'
[2022-01-14 16:54:52,159: INFO/MainProcess] Received task: gw_task_plugin.tasks.fibonacci[93a2d814-5a77-4c9f-8627-ab7f5636aba7]
[2022-01-14 16:54:52,161: WARNING/ForkPoolWorker-64] [2022-01-14 16:54:52,161] WARNING: No jobInfoSpec. Setting job_manager to None.
[2022-01-14 16:54:52,161: WARNING/ForkPoolWorker-64] No jobInfoSpec. Setting job_manager to None.
[2022-01-14 16:54:52,182: INFO/ForkPoolWorker-64] Task gw_task_plugin.tasks.fibonacci[93a2d814-5a77-4c9f-8627-ab7f5636aba7] succeeded in 0.011903629172593355s: 55
[2022-01-14 16:55:05,128: INFO/MainProcess] Received task: gw_task_plugin.tasks.fibonacci[1828bf21-d78e-451b-93c5-5344deeba107]
[2022-01-14 16:55:05,130: WARNING/ForkPoolWorker-64] [2022-01-14 16:55:05,130] WARNING: No jobInfoSpec. Setting job_manager to None.
[2022-01-14 16:55:05,130: WARNING/ForkPoolWorker-64] No jobInfoSpec. Setting job_manager to None.
[2022-01-14 16:55:25,266: INFO/ForkPoolWorker-64] Task gw_task_plugin.tasks.fibonacci[1828bf21-d78e-451b-93c5-5344deeba107] succeeded in 20.12778534181416s: 832040
[2022-01-14 17:04:40,151: INFO/MainProcess] Received task: gw_task_plugin.tasks.fibonacci[8c4b0c79-501d-45d0-94f9-4865cde5580f]
[2022-01-14 17:04:40,153: WARNING/ForkPoolWorker-64] [2022-01-14 17:04:40,153] WARNING: No jobInfoSpec. Setting job_manager to None.
[2022-01-14 17:04:40,153: WARNING/ForkPoolWorker-64] No jobInfoSpec. Setting job_manager to None.
[2022-01-14 17:04:40,167: INFO/ForkPoolWorker-64] Task gw_task_plugin.tasks.fibonacci[8c4b0c79-501d-45d0-94f9-4865cde5580f] succeeded in 0.006332071032375097s: 1