Example #1
0
    def _workflow_engine_env_vars(self):
        """Return necessary environment variables for the workflow engine."""
        env_vars = list(WorkflowRunManager.engine_mapping[self.workflow.type_]
                        ["environment_variables"])
        env_vars.extend([
            {
                "name": "REANA_USER_ID",
                "value": str(self.workflow.owner_id)
            },
            {
                "name": "REANA_WORKFLOW_KERBEROS",
                "value": str(self.requires_kerberos()),
            },
        ])
        cvmfs_volumes = self.retrieve_required_cvmfs_repos() or "false"
        if type(cvmfs_volumes) == list:
            cvmfs_env_var = {
                "name": "REANA_MOUNT_CVMFS",
                "value": str(cvmfs_volumes)
            }
            env_vars.append(cvmfs_env_var)
            for cvmfs_volume in cvmfs_volumes:
                if cvmfs_volume in CVMFS_REPOSITORIES:
                    create_cvmfs_storage_class(cvmfs_volume)
                    create_cvmfs_persistent_volume_claim(cvmfs_volume)

        return env_vars
Example #2
0
    def _workflow_engine_env_vars(self):
        """Return necessary environment variables for the workflow engine."""
        env_vars = list(WorkflowRunManager.engine_mapping[self.workflow.type_]
                        ['environment_variables'])
        env_vars.extend([{
            'name': 'REANA_USER_ID',
            'value': str(self.workflow.owner_id)
        }])
        cvmfs_volumes = 'false'
        for resource, value in self.workflow.reana_specification['workflow'].\
                get('resources', {}).items():
            if 'cvmfs' in resource:
                cvmfs_volumes = value
                break
        if type(cvmfs_volumes) == list:
            cvmfs_env_var = {
                'name': 'REANA_MOUNT_CVMFS',
                'value': str(cvmfs_volumes)
            }
            env_vars.append(cvmfs_env_var)
            for cvmfs_volume in cvmfs_volumes:
                if cvmfs_volume in CVMFS_REPOSITORIES:
                    create_cvmfs_storage_class(cvmfs_volume)
                    create_cvmfs_persistent_volume_claim(cvmfs_volume)

        return (env_vars)
    def _workflow_engine_env_vars(self):
        """Return necessary environment variables for the workflow engine."""
        env_vars = list(WorkflowRunManager.engine_mapping[self.workflow.type_]
                        ['environment_variables'])
        env_vars.extend([{
            'name': 'REANA_USER_ID',
            'value': str(self.workflow.owner_id)
        }])
        cvmfs_volumes = self.retrieve_required_cvmfs_repos() or 'false'
        if type(cvmfs_volumes) == list:
            cvmfs_env_var = {
                'name': 'REANA_MOUNT_CVMFS',
                'value': str(cvmfs_volumes)
            }
            env_vars.append(cvmfs_env_var)
            for cvmfs_volume in cvmfs_volumes:
                if cvmfs_volume in CVMFS_REPOSITORIES:
                    create_cvmfs_storage_class(cvmfs_volume)
                    create_cvmfs_persistent_volume_claim(cvmfs_volume)

        return (env_vars)