Exemplo n.º 1
0
    def validate_populated_mounts(self, exe_configuration):
        """Ensures that all required mounts are defined in the execution configuration

        :param exe_configuration: The execution configuration
        :type exe_configuration: :class:`job.execution.configuration.json.exe_config.ExecutionConfiguration`
        """

        for name, mount_volume in exe_configuration.get_mounts('main').items():
            if mount_volume is None:
                raise MissingMount(name)
Exemplo n.º 2
0
Arquivo: apps.py Projeto: sau29/scale
    def ready(self):
        """Registers components related to jobs"""

        # Register job errors
        from error.exceptions import register_error
        from job.configuration.results.exceptions import InvalidResultsManifest, MissingRequiredOutput, UnexpectedMultipleOutputs
        from job.execution.configuration.exceptions import MissingMount, MissingSetting

        register_error(InvalidResultsManifest(''))
        register_error(MissingMount(''))
        register_error(MissingRequiredOutput(''))
        register_error(UnexpectedMultipleOutputs(''))
        register_error(MissingSetting(''))

        # Register job message types
        from job.messages.blocked_jobs import BlockedJobs
        from job.messages.cancel_jobs import CancelJobs
        from job.messages.cancel_jobs_bulk import CancelJobsBulk
        from job.messages.completed_jobs import CompletedJobs
        from job.messages.create_jobs import CreateJobs
        from job.messages.failed_jobs import FailedJobs
        from job.messages.job_exe_end import CreateJobExecutionEnd
        from job.messages.pending_jobs import PendingJobs
        from job.messages.process_job_input import ProcessJobInput
        from job.messages.publish_job import PublishJob
        from job.messages.purge_jobs import PurgeJobs
        from job.messages.running_jobs import RunningJobs
        from job.messages.spawn_delete_files_job import SpawnDeleteFilesJob
        from job.messages.uncancel_jobs import UncancelJobs
        from job.messages.unpublish_jobs import UnpublishJobs
        from messaging.messages.factory import add_message_type

        add_message_type(BlockedJobs)
        add_message_type(CancelJobs)
        add_message_type(CancelJobsBulk)
        add_message_type(CompletedJobs)
        add_message_type(CreateJobs)
        add_message_type(FailedJobs)
        add_message_type(CreateJobExecutionEnd)
        add_message_type(PendingJobs)
        add_message_type(ProcessJobInput)
        add_message_type(PublishJob)
        add_message_type(PurgeJobs)
        add_message_type(RunningJobs)
        add_message_type(SpawnDeleteFilesJob)
        add_message_type(UncancelJobs)
        add_message_type(UnpublishJobs)