mirror of
https://github.com/clearml/clearml
synced 2025-01-31 09:07:00 +00:00
Add Task.get_task_output_log_web_page() class method
This commit is contained in:
parent
7ab1168532
commit
3b16553ba3
@ -1907,10 +1907,10 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
|
|
||||||
:return: http/s URL link.
|
:return: http/s URL link.
|
||||||
"""
|
"""
|
||||||
return '{}/projects/{}/experiments/{}/output/log'.format(
|
return self.get_task_output_log_web_page(
|
||||||
self._get_app_server(),
|
task_id=self.id,
|
||||||
self.project if self.project is not None else '*',
|
project_id=self.project,
|
||||||
self.id,
|
app_server_host=self._get_app_server()
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_reported_scalars(
|
def get_reported_scalars(
|
||||||
@ -2714,6 +2714,30 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
task = get_single_result(entity='task', query=task_name, results=res.response.tasks)
|
task = get_single_result(entity='task', query=task_name, results=res.response.tasks)
|
||||||
return cls(task_id=task.id)
|
return cls(task_id=task.id)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_task_output_log_web_page(cls, task_id, project_id=None, app_server_host=None):
|
||||||
|
# type: (str, Optional[str], Optional[str]) -> str
|
||||||
|
"""
|
||||||
|
Return the Task results & outputs web page address.
|
||||||
|
For example: https://demoapp.demo.clear.ml/projects/216431/experiments/60763e04/output/log
|
||||||
|
|
||||||
|
:param str task_id: Task ID.
|
||||||
|
:param str project_id: Project ID for this task.
|
||||||
|
:param str app_server_host: ClearML Application server host name.
|
||||||
|
If not provided, the current session will be used to resolve the host name.
|
||||||
|
:return: http/s URL link.
|
||||||
|
"""
|
||||||
|
if not app_server_host:
|
||||||
|
if not hasattr(cls, "__cached_app_server_host"):
|
||||||
|
cls.__cached_app_server_host = Session.get_app_server_host()
|
||||||
|
app_server_host = cls.__cached_app_server_host
|
||||||
|
|
||||||
|
return "{}/projects/{}/experiments/{}/output/log".format(
|
||||||
|
app_server_host.rstrip("/"),
|
||||||
|
project_id if project_id is not None else '*',
|
||||||
|
task_id,
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_project_name(cls, project_id):
|
def _get_project_name(cls, project_id):
|
||||||
res = cls._send(cls._get_default_session(), projects.GetByIdRequest(project=project_id), raise_on_errors=False)
|
res = cls._send(cls._get_default_session(), projects.GetByIdRequest(project=project_id), raise_on_errors=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user