Skip to content
Snippets Groups Projects
Commit e43feab1 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Merge branch 'develop'

parents ac5a8245 603f4ef8
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ services: ...@@ -4,6 +4,7 @@ services:
- docker - docker
before_install: before_install:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- rosetta/setup - rosetta/setup
- rosetta/build - rosetta/build
- rosetta/run - rosetta/run
......
...@@ -314,23 +314,24 @@ class SlurmComputingManager(ComputingManager): ...@@ -314,23 +314,24 @@ class SlurmComputingManager(ComputingManager):
# Get webapp conn string # Get webapp conn string
from.utils import get_webapp_conn_string from.utils import get_webapp_conn_string
webapp_conn_string = get_webapp_conn_string() webapp_conn_string = get_webapp_conn_string()
# Initialize sbatch args (force 1 task for now)
sbatch_args = '-N1 '
# Get task computing parameters and set sbatch args # Get task computing parameters and set sbatch args
sbatch_args = ''
if task.computing_options: if task.computing_options:
task_partition = task.computing_options.get('partition', None) task_partition = task.computing_options.get('partition', None)
task_cpus = task.computing_options.get('cpus', None) task_cpus = task.computing_options.get('cpus', None)
task_memory = task.computing_options.get('memory', None) task_memory = task.computing_options.get('memory', None)
# Set sbatch args # Set sbatch args
sbatch_args = ''
if task_partition: if task_partition:
sbatch_args += '-p {} '.format(task_partition) sbatch_args += '-p {} '.format(task_partition)
#if task_cpus: if task_cpus:
# sbatch_args += '-c {} '.format() sbatch_args += '-c {} '.format(task_cpus)
#if task_memory: if task_memory:
# sbatch_args += '-m {} '.format() sbatch_args += '--mem {} '.format(task_memory)
# Set output and error files # Set output and error files
sbatch_args += ' --output=\$HOME/{}.log --error=\$HOME/{}.log '.format(task.uuid, task.uuid) sbatch_args += ' --output=\$HOME/{}.log --error=\$HOME/{}.log '.format(task.uuid, task.uuid)
......
...@@ -226,7 +226,7 @@ class Command(BaseCommand): ...@@ -226,7 +226,7 @@ class Command(BaseCommand):
# Create demo slurm sys computing conf # Create demo slurm sys computing conf
ComputingSysConf.objects.create(computing = demo_slurm_computing, ComputingSysConf.objects.create(computing = demo_slurm_computing,
data = {'master': 'slurmclustermaster-main'}) data = {'master': 'slurmclustermaster-main', 'default_partition': 'partition1'})
# Create demo slurm user computing conf # Create demo slurm user computing conf
ComputingUserConf.objects.create(user = testuser, ComputingUserConf.objects.create(user = testuser,
......
...@@ -211,6 +211,14 @@ class Computing(models.Model): ...@@ -211,6 +211,14 @@ class Computing(models.Model):
return None return None
return param_value return param_value
@property
def conf_params(self):
class ConfParams():
def __init__(self, computing):
self.computing = computing
def __getitem__(self, key):
return self.computing.get_conf_param(key)
return ConfParams(self)
@property @property
def manager(self): def manager(self):
......
...@@ -185,9 +185,9 @@ ...@@ -185,9 +185,9 @@
<td><b>Computing options</b></td> <td><b>Computing options</b></td>
<td> <td>
<table> <table>
<tr><td>Partition</td><td><input type="text" name="computing_partition" value="" placeholder="" size="20" /></td></tr> <tr><td>Partition</td><td><input type="text" name="computing_partition" value="{{ data.task_computing.conf_params.default_partition }}" placeholder="" size="20" /></td></tr>
<tr><td>Cpus</td><td><input type="text" name="computing_cpus" value="" placeholder="" size="5" /></td></tr> <tr><td>Cpus</td><td><input type="text" name="computing_cpus" value="{{ data.task_computing.conf_params.default_cpus }}" placeholder="" size="5" /></td></tr>
<tr><td>Memory</td><td><input type="text" name="computing_memory" value="" placeholder="" size="5" /></td></tr> <tr><td>Memory</td><td><input type="text" name="computing_memory" value="{{ data.task_computing.conf_params.default_memory }}" placeholder="" size="5" /></td></tr>
</table> </table>
</td> </td>
</tr> </tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment