File tree Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 19
19
from jupyter_scheduler .orm import Job , Workflow , create_session
20
20
from jupyter_scheduler .parameterize import add_parameters
21
21
from jupyter_scheduler .utils import get_utc_timestamp
22
- from jupyter_scheduler .workflows import DescribeTask , DescribeWorkflow
22
+ from jupyter_scheduler .workflows import DescribeWorkflow
23
23
24
24
25
25
class ExecutionManager (ABC ):
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def __str__(self) -> str:
42
42
43
43
44
44
class Status (str , Enum ):
45
+ DRAFT = "DRAFT"
45
46
CREATED = "CREATED"
46
47
QUEUED = "QUEUED"
47
48
IN_PROGRESS = "IN_PROGRESS"
@@ -86,6 +87,8 @@ class CreateJob(BaseModel):
86
87
output_filename_template : Optional [str ] = OUTPUT_FILENAME_TEMPLATE
87
88
compute_type : Optional [str ] = None
88
89
package_input_folder : Optional [bool ] = None
90
+ depends_on : Optional [str ] = None
91
+ workflow_id : str = None
89
92
90
93
@root_validator
91
94
def compute_input_filename (cls , values ) -> Dict :
@@ -148,6 +151,8 @@ class DescribeJob(BaseModel):
148
151
downloaded : bool = False
149
152
package_input_folder : Optional [bool ] = None
150
153
packaged_files : Optional [List [str ]] = []
154
+ depends_on : Optional [str ] = None
155
+ workflow_id : str = None
151
156
152
157
class Config :
153
158
orm_mode = True
@@ -193,6 +198,7 @@ class UpdateJob(BaseModel):
193
198
status : Optional [Status ] = None
194
199
name : Optional [str ] = None
195
200
compute_type : Optional [str ] = None
201
+ depends_on : Optional [str ] = None
196
202
197
203
198
204
class DeleteJob (BaseModel ):
Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ class Job(CommonColumns, Base):
103
103
url = Column (String (256 ), default = generate_jobs_url )
104
104
pid = Column (Integer )
105
105
idempotency_token = Column (String (256 ))
106
+ depends_on = Column (JsonType (1024 ))
107
+ workflow_id = Column (String (36 ))
106
108
# All new columns added to this table must be nullable to ensure compatibility during database migrations.
107
109
# Any default values specified for new columns will be ignored during the migration process.
108
110
@@ -112,7 +114,7 @@ class Workflow(Base):
112
114
__table_args__ = {"extend_existing" : True }
113
115
workflow_id = Column (String (36 ), primary_key = True , default = generate_uuid )
114
116
tasks = Column (JsonType (1024 ))
115
- status = Column (String (64 ), default = Status .STOPPED )
117
+ status = Column (String (64 ), default = Status .DRAFT )
116
118
# All new columns added to this table must be nullable to ensure compatibility during database migrations.
117
119
# Any default values specified for new columns will be ignored during the migration process.
118
120
Original file line number Diff line number Diff line change @@ -57,9 +57,10 @@ class Config:
57
57
orm_mode = True
58
58
59
59
60
- class DescribeTask (BaseModel ):
61
- dependsOn : List [str ] = []
62
- status : Status = Status .CREATED
60
+ class UpdateWorkflow (BaseModel ):
61
+ workflow_id : str
62
+ tasks : List [str ] = None
63
+ status : Status = None
63
64
64
65
class Config :
65
66
orm_mode = True
Original file line number Diff line number Diff line change @@ -372,6 +372,7 @@ export namespace Scheduler {
372
372
timezone ?: string ;
373
373
active ?: boolean ;
374
374
input_uri ?: string ;
375
+ depends_on ?: string [ ] ;
375
376
}
376
377
377
378
export interface IDescribeJobDefinition {
@@ -418,6 +419,8 @@ export namespace Scheduler {
418
419
output_formats ?: string [ ] ;
419
420
compute_type ?: string ;
420
421
package_input_folder ?: boolean ;
422
+ depends_on ?: string [ ] ;
423
+ workflow_id ?: string ;
421
424
}
422
425
423
426
export interface ICreateJobFromDefinition {
@@ -467,6 +470,8 @@ export namespace Scheduler {
467
470
end_time ?: number ;
468
471
downloaded : boolean ;
469
472
package_input_folder ?: boolean ;
473
+ depends_on ?: string [ ] ;
474
+ workflow_id ?: string ;
470
475
}
471
476
472
477
export interface ICreateJobResponse {
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ export interface ICreateJobModel
100
100
// Is the create button disabled due to a submission in progress?
101
101
createInProgress ?: boolean ;
102
102
packageInputFolder ?: boolean ;
103
+ dependsOn ?: string [ ] ;
104
+ workflowId ?: string ;
103
105
}
104
106
105
107
export const defaultScheduleFields : ModelWithScheduleFields = {
@@ -312,6 +314,8 @@ export interface IJobDetailModel {
312
314
job_files : Scheduler . IJobFile [ ] ;
313
315
downloaded : boolean ;
314
316
packageInputFolder ?: boolean ;
317
+ dependsOn ?: string [ ] ;
318
+ workflowId ?: string ;
315
319
}
316
320
317
321
export interface IJobDefinitionModel {
@@ -388,7 +392,9 @@ export function convertDescribeJobtoJobDetail(
388
392
startTime : describeJob . start_time ,
389
393
endTime : describeJob . end_time ,
390
394
downloaded : describeJob . downloaded ,
391
- packageInputFolder : describeJob . package_input_folder
395
+ packageInputFolder : describeJob . package_input_folder ,
396
+ dependsOn : describeJob . depends_on ,
397
+ workflowId : describeJob . workflow_id
392
398
} ;
393
399
}
394
400
You can’t perform that action at this time.
0 commit comments