Commit 02e8a862 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Fixes.

parent 27994634
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ RUN mkdir /home/testuser/.ssh
COPY keys/id_rsa.pub /home/testuser/.ssh/authorized_keys
RUN dnf install -y python wget

# Install iputils (ping)
RUN dnf install -y iputils
# Install iputils (fpr ping) and openssh-clients (for scp)
RUN dnf install -y iputils openssh-clients

# TODO: Add the rosettta user

# Copy registries.conf to allow insecure access to dregistry
COPY registries.conf /etc/containers/registries.conf
+6 −3
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ print(port)
                return HttpResponse('Port not valid (got "{}")'.format(task_interface_port))
              
            # Set fields
            logger.info('Setting task "{}" to ip "{}" and port "{}"'.format(task.uuid, task_interface_ip, task_interface_port))
            logger.info('Agent API setting task "{}" to ip "{}" and port "{}"'.format(task.uuid, task_interface_ip, task_interface_port))
            task.status = TaskStatuses.running
            task.interface_ip = task_interface_ip
            
@@ -349,7 +349,7 @@ print(port)
            # Notify the user that the task called back home if using a WMS
            if task.computing.wms:
                if settings.DJANGO_EMAIL_APIKEY:
                    logger.info('Sending task ready mail notification to "{}"'.format(task.user.email))
                    logger.info('Agent API 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)
                    try:
@@ -449,7 +449,7 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
            else:
                raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
        if '$USER' in base_path_expanded:
            base_path_expanded = base_path_expanded.replace('$USER', user.name)
            base_path_expanded = base_path_expanded.replace('$USER', user.username)

        # If the path is not starting with the base path, do it
        if not path.startswith(base_path_expanded):
@@ -757,6 +757,9 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
                    if not storage.type=='generic_posix'  and storage.access_mode=='ssh+cli':
                        continue
                    
                    if storage.access_through_computing and not storage.computing.manager.is_configured_for(user=request.user):
                        continue
                    
                    data['data'].append({
                                         'id': '/{}/'.format(storage.id),
                                         'type': 'folder',
+6 −6
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ class SSHStandaloneComputingManager(StandaloneComputingManager, SSHComputingMana
                        else:
                            raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
                    if '$USER' in expanded_base_path:
                        expanded_base_path = expanded_base_path.replace('$USER', self.task.user.name)
                        expanded_base_path = expanded_base_path.replace('$USER', task.user.username)
                        
                    # Expand the bind_path
                    expanded_bind_path = storage.bind_path        
@@ -259,7 +259,7 @@ class SSHStandaloneComputingManager(StandaloneComputingManager, SSHComputingMana
                        else:
                            raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
                    if '$USER' in expanded_bind_path:
                        expanded_bind_path = expanded_bind_path.replace('$USER', self.task.user.name)
                        expanded_bind_path = expanded_bind_path.replace('$USER', task.user.username)
                        
                    # Add the bind
                    if not binds:
@@ -309,7 +309,7 @@ class SSHStandaloneComputingManager(StandaloneComputingManager, SSHComputingMana
                        else:
                            raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
                    if '$USER' in expanded_base_path:
                        expanded_base_path = expanded_base_path.replace('$USER', self.task.user.name)
                        expanded_base_path = expanded_base_path.replace('$USER', task.user.username)
                        
                    # Expand the bind_path
                    expanded_bind_path = storage.bind_path        
@@ -319,7 +319,7 @@ class SSHStandaloneComputingManager(StandaloneComputingManager, SSHComputingMana
                        else:
                            raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
                    if '$USER' in expanded_bind_path:
                        expanded_bind_path = expanded_bind_path.replace('$USER', self.task.user.name)
                        expanded_bind_path = expanded_bind_path.replace('$USER', task.user.username)
                        
                    # Add the bind
                    if not binds:
@@ -502,7 +502,7 @@ class SlurmSSHClusterComputingManager(ClusterComputingManager, SSHComputingManag
                        else:
                            raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
                    if '$USER' in expanded_base_path:
                        expanded_base_path = expanded_base_path.replace('$USER', self.task.user.name)
                        expanded_base_path = expanded_base_path.replace('$USER', task.user.username)
                        
                    # Expand the bind_path
                    expanded_bind_path = storage.bind_path        
@@ -512,7 +512,7 @@ class SlurmSSHClusterComputingManager(ClusterComputingManager, SSHComputingManag
                        else:
                            raise NotImplementedError('Accessing a storage with ssh+cli without going through its computing resource is not implemented')
                    if '$USER' in expanded_bind_path:
                        expanded_bind_path = expanded_bind_path.replace('$USER', self.task.user.name)
                        expanded_bind_path = expanded_bind_path.replace('$USER', task.user.username)
                        
                    # Add the bind
                    if not binds: