Loading services/webapp/code/rosetta/core_app/computing_managers.py +6 −1 Original line number Diff line number Diff line Loading @@ -332,12 +332,17 @@ class SlurmComputingManager(ComputingManager): else: authstring = '' bindings = task.computing.get_conf_param('bindings', from_sys_only=True ) if not bindings: bindings = '' else: bindings = '-B {}'.format(bindings) run_command = 'ssh -i {} -4 -o StrictHostKeyChecking=no {}@{} '.format(user_keys.private_key_file, user, host) run_command += '\'bash -c "echo \\"#!/bin/bash\nwget {}/api/v1/base/agent/?task_uuid={} -O \$HOME/agent_{}.py &> \$HOME/{}.log && export BASE_PORT=\\\\\\$(python \$HOME/agent_{}.py 2> \$HOME/{}.log) && '.format(webapp_conn_string, task.uuid, task.uuid, task.uuid, task.uuid, task.uuid) run_command += 'export SINGULARITY_NOHTTPS=true && export SINGULARITYENV_BASE_PORT=\\\\\\$BASE_PORT && {} '.format(authstring) run_command += 'exec nohup singularity run --pid --writable-tmpfs --containall --cleanenv ' run_command += 'exec nohup singularity run {} --pid --writable-tmpfs --containall --cleanenv '.format(bindings) # Double to escape for python six for shell (double times three as \\\ escapes a single slash in shell) Loading services/webapp/code/rosetta/core_app/models.py +8 −2 Original line number Diff line number Diff line Loading @@ -152,11 +152,17 @@ class Computing(models.Model): self._user_conf_data = None def get_conf_param(self, param): def get_conf_param(self, param, from_sys_only=False): try: param_value = self.sys_conf_data[param] except (TypeError, KeyError): if not from_sys_only: try: param_value = self.user_conf_data[param] except (TypeError, KeyError): return None else: return None return param_value Loading Loading
services/webapp/code/rosetta/core_app/computing_managers.py +6 −1 Original line number Diff line number Diff line Loading @@ -332,12 +332,17 @@ class SlurmComputingManager(ComputingManager): else: authstring = '' bindings = task.computing.get_conf_param('bindings', from_sys_only=True ) if not bindings: bindings = '' else: bindings = '-B {}'.format(bindings) run_command = 'ssh -i {} -4 -o StrictHostKeyChecking=no {}@{} '.format(user_keys.private_key_file, user, host) run_command += '\'bash -c "echo \\"#!/bin/bash\nwget {}/api/v1/base/agent/?task_uuid={} -O \$HOME/agent_{}.py &> \$HOME/{}.log && export BASE_PORT=\\\\\\$(python \$HOME/agent_{}.py 2> \$HOME/{}.log) && '.format(webapp_conn_string, task.uuid, task.uuid, task.uuid, task.uuid, task.uuid) run_command += 'export SINGULARITY_NOHTTPS=true && export SINGULARITYENV_BASE_PORT=\\\\\\$BASE_PORT && {} '.format(authstring) run_command += 'exec nohup singularity run --pid --writable-tmpfs --containall --cleanenv ' run_command += 'exec nohup singularity run {} --pid --writable-tmpfs --containall --cleanenv '.format(bindings) # Double to escape for python six for shell (double times three as \\\ escapes a single slash in shell) Loading
services/webapp/code/rosetta/core_app/models.py +8 −2 Original line number Diff line number Diff line Loading @@ -152,11 +152,17 @@ class Computing(models.Model): self._user_conf_data = None def get_conf_param(self, param): def get_conf_param(self, param, from_sys_only=False): try: param_value = self.sys_conf_data[param] except (TypeError, KeyError): if not from_sys_only: try: param_value = self.user_conf_data[param] except (TypeError, KeyError): return None else: return None return param_value Loading