mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-26 18:16:15 +00:00
Fix sending task logs fails when agent is not running in the same tenant
This commit is contained in:
parent
1d5c118b70
commit
6e7fb5f331
@ -3798,7 +3798,6 @@ class Worker(ServiceCommandSection):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
agent_install_bash_script = []
|
|
||||||
if os.environ.get('FORCE_LOCAL_CLEARML_AGENT_WHEEL'):
|
if os.environ.get('FORCE_LOCAL_CLEARML_AGENT_WHEEL'):
|
||||||
local_wheel = os.path.expanduser(os.environ.get('FORCE_LOCAL_CLEARML_AGENT_WHEEL'))
|
local_wheel = os.path.expanduser(os.environ.get('FORCE_LOCAL_CLEARML_AGENT_WHEEL'))
|
||||||
docker_wheel = '/tmp/{}'.format(basename(local_wheel))
|
docker_wheel = '/tmp/{}'.format(basename(local_wheel))
|
||||||
@ -3839,9 +3838,6 @@ class Worker(ServiceCommandSection):
|
|||||||
if preprocess_bash_script:
|
if preprocess_bash_script:
|
||||||
bash_script = preprocess_bash_script + bash_script
|
bash_script = preprocess_bash_script + bash_script
|
||||||
|
|
||||||
if agent_install_bash_script:
|
|
||||||
bash_script += agent_install_bash_script
|
|
||||||
|
|
||||||
docker_bash_script = " ; ".join([line for line in bash_script if line]) \
|
docker_bash_script = " ; ".join([line for line in bash_script if line]) \
|
||||||
if not isinstance(bash_script, str) else bash_script
|
if not isinstance(bash_script, str) else bash_script
|
||||||
|
|
||||||
|
@ -816,14 +816,6 @@ class K8sIntegration(Worker):
|
|||||||
except (KeyError, TypeError, AttributeError):
|
except (KeyError, TypeError, AttributeError):
|
||||||
print("No tasks in queue {}".format(queue))
|
print("No tasks in queue {}".format(queue))
|
||||||
continue
|
continue
|
||||||
events_service.send_log_events(
|
|
||||||
self.worker_id,
|
|
||||||
task_id=task_id,
|
|
||||||
lines="task {} pulled from {} by worker {}".format(
|
|
||||||
task_id, queue, self.worker_id
|
|
||||||
),
|
|
||||||
level="INFO",
|
|
||||||
)
|
|
||||||
|
|
||||||
task_session = None
|
task_session = None
|
||||||
if self._impersonate_as_task_owner:
|
if self._impersonate_as_task_owner:
|
||||||
@ -843,6 +835,16 @@ class K8sIntegration(Worker):
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
events_service.send_log_events(
|
||||||
|
self.worker_id,
|
||||||
|
task_id=task_id,
|
||||||
|
lines="task {} pulled from {} by worker {}".format(
|
||||||
|
task_id, queue, self.worker_id
|
||||||
|
),
|
||||||
|
level="INFO",
|
||||||
|
session=task_session,
|
||||||
|
)
|
||||||
|
|
||||||
self.report_monitor(ResourceMonitor.StatusReport(queues=queues, queue=queue, task=task_id))
|
self.report_monitor(ResourceMonitor.StatusReport(queues=queues, queue=queue, task=task_id))
|
||||||
self.run_one_task(queue, task_id, worker_params, task_session)
|
self.run_one_task(queue, task_id, worker_params, task_session)
|
||||||
self.report_monitor(ResourceMonitor.StatusReport(queues=self.queues))
|
self.report_monitor(ResourceMonitor.StatusReport(queues=self.queues))
|
||||||
|
Loading…
Reference in New Issue
Block a user