Skip to content

Commit 56f401e

Browse files
author
Bryan Crampton
authored
[UI] Revamp Job Details Page with Resources expansion (#239)
1 parent d16041f commit 56f401e

38 files changed

+872
-352
lines changed

api/jobs.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -363,23 +363,26 @@ definitions:
363363
properties:
364364
userId:
365365
type: string
366-
description: The user associated with the job
366+
description: The user associated with the job.
367367
statusDetail:
368368
type: string
369369
description: Longer text description of the job status.
370370
logs:
371371
type: object
372-
description: Map of type of log file to its file location
372+
description: Map of type of log file to its file location.
373373
lastUpdate:
374374
type: string
375375
format: date-time
376-
description: Job last update datetime in ISO8601 format
376+
description: Job last update datetime in ISO8601 format.
377377
envs:
378378
type: object
379-
description: Map of ENV variables associated with the job
379+
description: Map of ENV variables key values associated with the job.
380+
sourceFile:
381+
type: string
382+
description: The text of the script executed by this job.
380383
parentJobId:
381384
type: string
382-
description: The parent job ID for the job
385+
description: The parent job ID for the job.
383386
# TODO: Remove once the diagram is rendered natively.
384387
timingUrl:
385388
type: string

servers/cromwell/jobs/__init__.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
#!/usr/bin/env python
2-
3-
from __main__ import run

servers/cromwell/jobs/models/extended_fields.py

+39-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ExtendedFields(Model):
1313
NOTE: This class is auto generated by the swagger code generator program.
1414
Do not edit the class manually.
1515
"""
16-
def __init__(self, user_id=None, status_detail=None, logs=None, last_update=None, envs=None, parent_job_id=None, timing_url=None, tasks=None):
16+
def __init__(self, user_id=None, status_detail=None, logs=None, last_update=None, envs=None, source_file=None, parent_job_id=None, timing_url=None, tasks=None):
1717
"""
1818
ExtendedFields - a model defined in Swagger
1919
@@ -27,6 +27,8 @@ def __init__(self, user_id=None, status_detail=None, logs=None, last_update=None
2727
:type last_update: datetime
2828
:param envs: The envs of this ExtendedFields.
2929
:type envs: object
30+
:param source_file: The source_file of this ExtendedFields.
31+
:type source_file: str
3032
:param parent_job_id: The parent_job_id of this ExtendedFields.
3133
:type parent_job_id: str
3234
:param timing_url: The timing_url of this ExtendedFields.
@@ -40,6 +42,7 @@ def __init__(self, user_id=None, status_detail=None, logs=None, last_update=None
4042
'logs': object,
4143
'last_update': datetime,
4244
'envs': object,
45+
'source_file': str,
4346
'parent_job_id': str,
4447
'timing_url': str,
4548
'tasks': List[TaskMetadata]
@@ -51,6 +54,7 @@ def __init__(self, user_id=None, status_detail=None, logs=None, last_update=None
5154
'logs': 'logs',
5255
'last_update': 'lastUpdate',
5356
'envs': 'envs',
57+
'source_file': 'sourceFile',
5458
'parent_job_id': 'parentJobId',
5559
'timing_url': 'timingUrl',
5660
'tasks': 'tasks'
@@ -61,6 +65,7 @@ def __init__(self, user_id=None, status_detail=None, logs=None, last_update=None
6165
self._logs = logs
6266
self._last_update = last_update
6367
self._envs = envs
68+
self._source_file = source_file
6469
self._parent_job_id = parent_job_id
6570
self._timing_url = timing_url
6671
self._tasks = tasks
@@ -81,7 +86,7 @@ def from_dict(cls, dikt):
8186
def user_id(self):
8287
"""
8388
Gets the user_id of this ExtendedFields.
84-
The user associated with the job
89+
The user associated with the job.
8590
8691
:return: The user_id of this ExtendedFields.
8792
:rtype: str
@@ -92,7 +97,7 @@ def user_id(self):
9297
def user_id(self, user_id):
9398
"""
9499
Sets the user_id of this ExtendedFields.
95-
The user associated with the job
100+
The user associated with the job.
96101
97102
:param user_id: The user_id of this ExtendedFields.
98103
:type user_id: str
@@ -127,7 +132,7 @@ def status_detail(self, status_detail):
127132
def logs(self):
128133
"""
129134
Gets the logs of this ExtendedFields.
130-
Map of type of log file to its file location
135+
Map of type of log file to its file location.
131136
132137
:return: The logs of this ExtendedFields.
133138
:rtype: object
@@ -138,7 +143,7 @@ def logs(self):
138143
def logs(self, logs):
139144
"""
140145
Sets the logs of this ExtendedFields.
141-
Map of type of log file to its file location
146+
Map of type of log file to its file location.
142147
143148
:param logs: The logs of this ExtendedFields.
144149
:type logs: object
@@ -150,7 +155,7 @@ def logs(self, logs):
150155
def last_update(self):
151156
"""
152157
Gets the last_update of this ExtendedFields.
153-
Job last update datetime in ISO8601 format
158+
Job last update datetime in ISO8601 format.
154159
155160
:return: The last_update of this ExtendedFields.
156161
:rtype: datetime
@@ -161,7 +166,7 @@ def last_update(self):
161166
def last_update(self, last_update):
162167
"""
163168
Sets the last_update of this ExtendedFields.
164-
Job last update datetime in ISO8601 format
169+
Job last update datetime in ISO8601 format.
165170
166171
:param last_update: The last_update of this ExtendedFields.
167172
:type last_update: datetime
@@ -173,7 +178,7 @@ def last_update(self, last_update):
173178
def envs(self):
174179
"""
175180
Gets the envs of this ExtendedFields.
176-
Map of ENV variables associated with the job
181+
Map of ENV variables key values associated with the job.
177182
178183
:return: The envs of this ExtendedFields.
179184
:rtype: object
@@ -184,19 +189,42 @@ def envs(self):
184189
def envs(self, envs):
185190
"""
186191
Sets the envs of this ExtendedFields.
187-
Map of ENV variables associated with the job
192+
Map of ENV variables key values associated with the job.
188193
189194
:param envs: The envs of this ExtendedFields.
190195
:type envs: object
191196
"""
192197

193198
self._envs = envs
194199

200+
@property
201+
def source_file(self):
202+
"""
203+
Gets the source_file of this ExtendedFields.
204+
The text of the script executed by this job.
205+
206+
:return: The source_file of this ExtendedFields.
207+
:rtype: str
208+
"""
209+
return self._source_file
210+
211+
@source_file.setter
212+
def source_file(self, source_file):
213+
"""
214+
Sets the source_file of this ExtendedFields.
215+
The text of the script executed by this job.
216+
217+
:param source_file: The source_file of this ExtendedFields.
218+
:type source_file: str
219+
"""
220+
221+
self._source_file = source_file
222+
195223
@property
196224
def parent_job_id(self):
197225
"""
198226
Gets the parent_job_id of this ExtendedFields.
199-
The parent job ID for the job
227+
The parent job ID for the job.
200228
201229
:return: The parent_job_id of this ExtendedFields.
202230
:rtype: str
@@ -207,7 +235,7 @@ def parent_job_id(self):
207235
def parent_job_id(self, parent_job_id):
208236
"""
209237
Sets the parent_job_id of this ExtendedFields.
210-
The parent job ID for the job
238+
The parent job ID for the job.
211239
212240
:param parent_job_id: The parent_job_id of this ExtendedFields.
213241
:type parent_job_id: str

servers/cromwell/jobs/swagger/swagger.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -371,25 +371,28 @@ definitions:
371371
properties:
372372
userId:
373373
type: "string"
374-
description: "The user associated with the job"
374+
description: "The user associated with the job."
375375
statusDetail:
376376
type: "string"
377377
description: "Longer text description of the job status."
378378
logs:
379379
type: "object"
380-
description: "Map of type of log file to its file location"
380+
description: "Map of type of log file to its file location."
381381
properties: {}
382382
lastUpdate:
383383
type: "string"
384384
format: "date-time"
385-
description: "Job last update datetime in ISO8601 format"
385+
description: "Job last update datetime in ISO8601 format."
386386
envs:
387387
type: "object"
388-
description: "Map of ENV variables associated with the job"
388+
description: "Map of ENV variables key values associated with the job."
389389
properties: {}
390+
sourceFile:
391+
type: "string"
392+
description: "The text of the script executed by this job."
390393
parentJobId:
391394
type: "string"
392-
description: "The parent job ID for the job"
395+
description: "The parent job ID for the job."
393396
timingUrl:
394397
type: "string"
395398
description: "URL for tasks timing diagram."

servers/dsub/jobs/controllers/capabilities_controller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def get_capabilities():
3131
is_required=True,
3232
scopes=[
3333
'https://www.googleapis.com/auth/genomics',
34-
'https://www.googleapis.com/auth/cloudplatformprojects.readonly'
34+
'https://www.googleapis.com/auth/cloudplatformprojects.readonly',
35+
'https://www.googleapis.com/auth/devstorage.read_only',
3536
])
3637

3738
return capabilities

servers/dsub/jobs/controllers/utils/extensions.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ def get_extensions(job):
1111
Returns:
1212
ExtendedFields: Populated extensions on the job
1313
"""
14+
envs = job['envs']
15+
script = None
16+
if envs and envs['_SCRIPT']:
17+
script = envs['_SCRIPT']
18+
del envs['_SCRIPT']
19+
1420
return ExtendedFields(
1521
user_id=job['user-id'],
1622
status_detail=job.get('status-detail'),
1723
logs=logs.dsub_to_api(job),
1824
last_update=job.get('last-update'),
19-
envs=job['envs'])
25+
envs=job['envs'],
26+
source_file=script)

servers/dsub/jobs/controllers/utils/logs.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def dsub_to_api(job):
1111
if job['logging'] and job['logging'].endswith('.log'):
1212
base_log_path = job['logging'][:-4]
1313
return {
14-
'controller-log': '{}.log'.format(base_log_path),
15-
'stderr': '{}-stderr.log'.format(base_log_path),
16-
'stdout': '{}-stdout.log'.format(base_log_path),
14+
'Controller Log': '{}.log'.format(base_log_path),
15+
'Output Log': '{}-stderr.log'.format(base_log_path),
16+
'Error Log': '{}-stdout.log'.format(base_log_path),
1717
}
1818
return None

0 commit comments

Comments
 (0)