File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1249,6 +1249,7 @@ services:
12491249 hostname : " sto-worker-{{.Node.Hostname}}-{{.Task.Slot}}"
12501250 environment :
12511251 << : *storage_environment
1252+ STORAGE_WORKER_NAME : " sto-worker-{{.Node.Hostname}}-{{.Task.Slot}}-{{.Task.ID}}"
12521253 STORAGE_WORKER_MODE : " true"
12531254 CELERY_CONCURRENCY : 100
12541255 networks : *storage_networks
@@ -1259,6 +1260,7 @@ services:
12591260 hostname : " sto-worker-cpu-bound-{{.Node.Hostname}}-{{.Task.Slot}}"
12601261 environment :
12611262 << : *storage_environment
1263+ STORAGE_WORKER_NAME : " sto-worker-cpu-bound-{{.Node.Hostname}}-{{.Task.Slot}}-{{.Task.ID}}"
12621264 STORAGE_WORKER_MODE : " true"
12631265 CELERY_CONCURRENCY : 1
12641266 CELERY_QUEUES : " cpu_bound"
Original file line number Diff line number Diff line change @@ -59,13 +59,15 @@ if [ "${STORAGE_WORKER_MODE}" = "true" ]; then
5959 worker --pool=threads \
6060 --loglevel=" ${SERVER_LOG_LEVEL} " \
6161 --concurrency=" ${CELERY_CONCURRENCY} " \
62+ --hostname=" ${STORAGE_WORKER_NAME} " \
6263 --queues=" ${CELERY_QUEUES:- default} "
6364 else
6465 exec celery \
6566 --app=simcore_service_storage.modules.celery.worker_main:app \
6667 worker --pool=threads \
6768 --loglevel=" ${SERVER_LOG_LEVEL} " \
6869 --concurrency=" ${CELERY_CONCURRENCY} " \
70+ --hostname=" ${STORAGE_WORKER_NAME} " \
6971 --queues=" ${CELERY_QUEUES:- default} "
7072 fi
7173else
Original file line number Diff line number Diff line change 2020
2121
2222import os
23- import socket
2423import subprocess
2524import sys
2625from urllib .request import urlopen
3736
3837app_settings = ApplicationSettings .create_from_envs ()
3938
39+
4040def _is_celery_worker_healthy ():
4141 assert app_settings .STORAGE_CELERY
4242 broker_url = app_settings .STORAGE_CELERY .CELERY_RABBIT_BROKER .dsn
@@ -50,7 +50,7 @@ def _is_celery_worker_healthy():
5050 "inspect" ,
5151 "ping" ,
5252 "--destination" ,
53- "celery@" + socket . gethostname ( ),
53+ "celery@" + os . getenv ( "STORAGE_WORKER_NAME" , "worker" ),
5454 ],
5555 capture_output = True ,
5656 text = True ,
You can’t perform that action at this time.
0 commit comments