3535 cpus: {cpus}.0
3636"""
3737
38+ _NF_CONFIG_CONTENT : str = """
39+ docker {
40+ enabled = true
41+ runOptions = '-u $(id -u):$(id -g)'
42+ }
43+ """
44+
3845
3946def _get_docker_compose_version () -> str :
4047
@@ -66,6 +73,7 @@ def __init__(self, collection: str,
6673 job : str ,
6774 test : str ,
6875 image : str ,
76+ image_type : str ,
6977 memory : str ,
7078 cores : int ,
7179 project_directory : str ,
@@ -85,6 +93,7 @@ def __init__(self, collection: str,
8593 self ._job : str = job
8694 self ._test : str = test
8795 self ._image : str = image
96+ self ._image_type : str = image_type
8897 self ._cores : int = cores
8998 self ._project_directory : str = project_directory
9099 self ._working_directory : str = working_directory
@@ -121,7 +130,9 @@ def create(self) -> str:
121130 Compose ._COMPOSE_VERSION = _get_docker_compose_version ()
122131 print (f'# docker-compose ({ Compose ._COMPOSE_VERSION } )' )
123132
124- # Make the test directory...
133+ # Make the test directory
134+ # (where the test is launched from)
135+ # and the project directory (a /project sud-directory of test)
125136 test_path = self .get_test_path ()
126137 project_path : str = self .get_test_project_path ()
127138 inst_path : str = f'{ project_path } /{ INSTANCE_DIRECTORY } '
@@ -152,6 +163,14 @@ def create(self) -> str:
152163 with open (compose_path , 'wt' , encoding = 'UTF-8' ) as compose_file :
153164 compose_file .write (compose_content )
154165
166+ if self ._image_type == 'nextflow' :
167+ # Write a nextflow config to the project path
168+ # (this is where the non-container-based nextflow is executed)
169+ # and where nextflow will, by default, look for the config.
170+ nf_cfg_path : str = f'{ project_path } /nextflow.config'
171+ with open (nf_cfg_path , 'wt' , encoding = 'UTF-8' ) as nf_cfg_file :
172+ nf_cfg_file .write (_NF_CONFIG_CONTENT )
173+
155174 print ('# Created' )
156175
157176 return project_path
0 commit comments