6
6
7
7
from .state import ApplicationState
8
8
9
- from app_pack_generator import GitManager , DockerUtil , ApplicationNotebook , CWL , Descriptor
9
+ from app_pack_generator import GitManager , DockerUtil , ApplicationNotebook
10
+ from app_pack_generator import ProcessCWL , BundledDataStagingCWL , Descriptor
10
11
11
12
from unity_sds_client .services .application_service import DockstoreAppCatalog
12
13
@@ -55,9 +56,9 @@ def push_to_docker_registry(self, docker_registry, image_tag=None):
55
56
# Push to remote repository
56
57
self .app_state .docker_url = self .docker_util .push_image (docker_registry , self .app_state .docker_image_tag )
57
58
58
- def _generate_dockstore_cwl (self , cwl_output_path ):
59
+ def _generate_dockstore_cwl (self , cwl_output_path , target_cwl_filename ):
59
60
60
- template = """
61
+ template = f """
61
62
cwlVersion: v1.0
62
63
63
64
class: Workflow
@@ -66,14 +67,15 @@ def _generate_dockstore_cwl(self, cwl_output_path):
66
67
67
68
steps:
68
69
step:
69
- run: workflow.cwl
70
+ run: { target_cwl_filename }
70
71
"""
72
+
71
73
# Hard code file name because it is a hard coded re
72
74
dockstore_cwl_filename = os .path .join (cwl_output_path , "Dockstore.cwl" )
73
75
with open (dockstore_cwl_filename , "w" ) as cwl_file :
74
76
cwl_file .write (template .lstrip ())
75
77
76
- def create_cwl (self , cwl_output_path = None , docker_url = None ):
78
+ def create_cwl (self , cwl_output_path = None , docker_url = None , monolithic = False ):
77
79
78
80
# Fall through using docker_image_tag if docker_url does not exist because no push has occurred
79
81
# Or if docker_url is supplied as an argument use that
@@ -100,13 +102,20 @@ def create_cwl(self, cwl_output_path=None, docker_url=None):
100
102
101
103
logger .info ("Parameters:\n " + app .parameter_summary ())
102
104
103
- cwl = CWL (app )
105
+ if monolithic :
106
+ cwl = BundledDataStagingCWL (app )
107
+ else :
108
+ cwl = ProcessCWL (app )
109
+
104
110
desc = Descriptor (app , self .repo_info )
105
111
106
- files = cwl .generate_all (cwl_output_path , docker_url )
112
+ files = cwl .generate_all (cwl_output_path , dockerurl = docker_url )
107
113
files .append (desc .generate_descriptor (cwl_output_path , docker_url ))
108
114
109
- self ._generate_dockstore_cwl (cwl_output_path )
115
+ if monolithic :
116
+ self ._generate_dockstore_cwl (cwl_output_path , "workflow.cwl" )
117
+ else :
118
+ self ._generate_dockstore_cwl (cwl_output_path , "process.cwl" )
110
119
111
120
def notebook_parameters (self ):
112
121
0 commit comments