# For Singularity, set this only if the container supports custom interface ports
iftask.container.supports_custom_interface_port:
task.interface_port=int(task_interface_port)
else:
# For all other container runtimes, set it in any case
task.interface_port=int(task_interface_port)
# Save the task
task.save()
# Notify the user that the task called back home
ifsettings.DJANGO_EMAIL_APIKEY:
logger.info('Sending task ready mail notification to "{}"'.format(task.user.email))
mail_subject='Your Task "{}" is now starting up'.format(task.container.name)
mail_text='Hello,\n\nyour Task "{}" on {} is now starting up. Check logs or connect here: https://{}/tasks/?uuid={}\n\nThe Rosetta notifications bot.'.format(task.container.name,task.computing,settings.ROSETTA_HOST,task.uuid)
raiseConsistencyException('Don\'t know how to instantiate a computing manager for computing resource of type "{}", access mode "{}" and WMS "{}"'.format(self.type,self.access_mode,self.wms))
returnstr('Task "{}" of user "{}" running on "{}" in status "{}" created at "{}"'.format(self.name,self.user.email,self.computing,self.status,self.created))