Commit 8a66566f authored by Marc's avatar Marc
Browse files

database directory is written automatically in nextflow config (docker or singularity scope)

parent 5e64d135
......@@ -11,7 +11,7 @@ class Repository:
def load_config(self):
'''return a dictionary with the whole configuration for this repository'''
config = self.load_config_file()
config['profiles'] = self.load_profiles(config)
config['profiles'] = self.load_profiles()
config['modules'] = self.load_modules(config)
self.normalize_profiles(config['profiles'])
return config
......@@ -41,7 +41,7 @@ class Repository:
config = yaml.load(f)
return config
def load_profiles(self, config):
def load_profiles(self):
profiles = []
for manifest in self.get_profile_manifests():
with (open(manifest)) as f:
......
......@@ -73,6 +73,7 @@ def generate_execution(config, args):
execution['output'] = os.path.abspath(args.output)
execution['install_path'] = config['install_path']
execution['helpers_path'] = config['helpers_path']
execution['database_path'] = config['databases']['localpath']
execution['docker'] = args.docker
execution['singularity'] = args.singularity
if 'venv' in config:
......
......@@ -337,6 +337,7 @@ def generate_nextflow_script(execution):
def generate_nextflow_config(execution):
modules = execution['modules']
database_path = execution['database_path']
fragments = []
......@@ -344,15 +345,15 @@ def generate_nextflow_config(execution):
fragments.append('''docker {
enabled = 'true'
fixOwnership = 'true'
runOptions = '--volume=/home/ubuntu/db:/databases'
runOptions = '--volume={path}/databases'
}
''')
'''.format(path=database_path))
elif execution['singularity']:
fragments.append('''singularity {
enabled = 'true'
runOptions = '--bind /home/ubuntu/db:/databases'
runOptions = '--bind {path}:/databases'
}
''')
'''.format(path=database_path))
fragments.append('''process { ''')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment