# 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)