diff --git a/designsafe/apps/auth/tasks.py b/designsafe/apps/auth/tasks.py index ccdfdf8583..5ce6a10472 100644 --- a/designsafe/apps/auth/tasks.py +++ b/designsafe/apps/auth/tasks.py @@ -12,7 +12,7 @@ logger = logging.getLogger(__name__) -@shared_task(default_retry_delay=1*30, max_retries=3) +@shared_task(default_retry_delay=30, max_retries=3) def check_or_create_agave_home_dir(username, systemId): try: # TODO should use OS calls to create directory. @@ -35,8 +35,8 @@ def check_or_create_agave_home_dir(username, systemId): logger.info("Creating the home directory for user=%s then going to run setfacl", username) body = {'action': 'mkdir', 'path': username} fm_response = ag.files.manage(systemId=systemId, - filePath='', - body=body) + filePath='', + body=body) logger.info('mkdir response: {}'.format(fm_response)) ds_admin_client = Agave( @@ -49,14 +49,28 @@ def check_or_create_agave_home_dir(username, systemId): 'AGAVE_SUPER_TOKEN' ), ) - job_body = { - 'parameters': { - 'username': username, - 'directory': 'shared/{}'.format(username) - }, - 'name': 'setfacl', - 'appId': 'setfacl_corral3-0.1' - } + + if systemId == settings.AGAVE_STORAGE_SYSTEM: + job_body = { + 'parameters': { + 'username': username, + 'directory': 'shared/{}'.format(username) + }, + 'name': f'setfacl mydata for user {username}', + 'appId': 'setfacl_corral3-0.1' + } + elif systemId == settings.AGAVE_WORKING_SYSTEM: + job_body = { + 'parameters': { + 'username': username, + }, + 'name': f'setfacl scratch for user {username}', + 'appId': 'setfacl_frontera_scratch-0.1' + } + else: + logger.error('Attempting to set permissions on unsupported system: {}'.format(systemId)) + return + jobs_response = ds_admin_client.jobs.submit(body=job_body) logger.info('setfacl response: {}'.format(jobs_response)) @@ -64,14 +78,13 @@ def check_or_create_agave_home_dir(username, systemId): logger.info("Indexing the home directory for user=%s", username) agave_indexer.apply_async(kwargs={'username': username, 'systemId': systemId, 'filePath': username}, queue='indexing') - except(AgaveException): - #except (HTTPError, AgaveException): + except AgaveException: logger.exception('Failed to create home directory.', extra={'user': username, 'systemId': systemId}) -@shared_task(default_retry_delay=1*30, max_retries=3) +@shared_task(default_retry_delay=30, max_retries=3) def new_user_alert(username): user = get_user_model().objects.get(username=username) send_mail('New User in DesignSafe, need Slack', 'Username: ' + user.username + '\n' + diff --git a/designsafe/static/scripts/data-depot/components/data-depot-nav/data-depot-nav.component.js b/designsafe/static/scripts/data-depot/components/data-depot-nav/data-depot-nav.component.js index 64b3430aec..336556a1d4 100644 --- a/designsafe/static/scripts/data-depot/components/data-depot-nav/data-depot-nav.component.js +++ b/designsafe/static/scripts/data-depot/components/data-depot-nav/data-depot-nav.component.js @@ -46,7 +46,7 @@ class DataDepotNavCtrl { description: 'Private directory for your data' }, { - name: 'Working Files (scratch Frontera)', + name: 'HPC Scratch', collapsible: false, state: 'myDataScratch', description: 'Scratch directory on Frontera for use with JupyterHub' diff --git a/designsafe/static/scripts/data-depot/components/data-depot-toolbar/data-depot-toolbar.component.js b/designsafe/static/scripts/data-depot/components/data-depot-toolbar/data-depot-toolbar.component.js index ac1b8aba71..1758ee8cdb 100644 --- a/designsafe/static/scripts/data-depot/components/data-depot-toolbar/data-depot-toolbar.component.js +++ b/designsafe/static/scripts/data-depot/components/data-depot-toolbar/data-depot-toolbar.component.js @@ -16,7 +16,7 @@ class DataDepotToolbarCtrl { placeholder() { var stateNames = { 'myData': 'My Data', - 'myDataScratch': 'Working Files (scratch Frontera)', + 'myDataScratch': 'HPC Scratch', 'projects.list': 'My Projects', 'sharedData': 'Shared Data', 'boxData': 'Box', diff --git a/designsafe/static/scripts/workspace/components/workspace-data-browser/workspace-data-browser.component.js b/designsafe/static/scripts/workspace/components/workspace-data-browser/workspace-data-browser.component.js index 871329818f..39c03ade47 100644 --- a/designsafe/static/scripts/workspace/components/workspace-data-browser/workspace-data-browser.component.js +++ b/designsafe/static/scripts/workspace/components/workspace-data-browser/workspace-data-browser.component.js @@ -17,7 +17,7 @@ class WorkspaceDataBrowserCtrl { this.options = [ { name: 'myData', label: 'My Data' }, - { name: 'myDataScratch', label: 'Working Files (scratch Frontera)' }, + { name: 'myDataScratch', label: 'HPC Scratch' }, { name: 'myProjects', label: 'My Projects' }, { name: 'publications', label: 'Published' }, { name: 'nees', label: 'Published (NEES)' },