示例#1
0
    def test_slurm_command_priority(self):
        run = ContainerRun(pk=99)
        run.user = User(username='******')
        run.app = ContainerApp()
        run.app.container = Container()
        run.app.container.family = ContainerFamily(name='my container')
        slurm_queues = (('low', 'kive-low'),
                        ('medium', 'kive-medium'),
                        ('high', 'kive-high'))
        run.priority = 2
        run.sandbox_path = 'run23'
        expected_command = [
            'sbatch',
            '-J', 'r99 my container',
            '--parsable',
            '--output', '/tmp/kive_media/run23/logs/job%J_node%N_stdout.txt',
            '--error', '/tmp/kive_media/run23/logs/job%J_node%N_stderr.txt',
            '-c', '1',
            '--mem', '6000',
            '-p', 'kive-high',
            EXPECTED_MANAGE_PATH,
            'runcontainer',
            '99']

        command = run.build_slurm_command(slurm_queues)

        self.assertListEqual(expected_command, command)
示例#2
0
 def build_run(self):
     run = ContainerRun()
     run.app = ContainerApp()
     run.app.container = Container()
     run.app.container.file = Namespace(path='/tmp/foo.simg')
     run.sandbox_path = '/tmp/box23'
     run.app.arguments.create(type=ContainerArgument.INPUT, name='in_csv')
     run.app.arguments.create(type=ContainerArgument.OUTPUT, name='out_csv')
     return run
示例#3
0
 def build_run(self):
     run = ContainerRun()
     run.app = ContainerApp()
     run.app.container = Container()
     run.app.container.file = Namespace(path='/tmp/foo.simg')
     run.sandbox_path = '/tmp/box23'
     run.app.arguments.create(type=ContainerArgument.INPUT, name='in_csv')
     run.app.arguments.create(type=ContainerArgument.OUTPUT, name='out_csv')
     return run
示例#4
0
    def test_slurm_command_custom_memory(self):
        run = ContainerRun(pk=99)
        run.user = User(username='******')
        run.app = ContainerApp(threads=3, memory=100)
        run.app.container = Container()
        run.app.container.family = ContainerFamily(name='my container')
        run.sandbox_path = 'run23'
        expected_command = [
            'sbatch', '-J', 'r99 my container', '--parsable', '--output',
            '/tmp/kive_media/run23/logs/job%J_node%N_stdout.txt', '--error',
            '/tmp/kive_media/run23/logs/job%J_node%N_stderr.txt', '-c', '3',
            '--mem', '100', EXPECTED_MANAGE_PATH, 'runcontainer', '99'
        ]

        command = run.build_slurm_command()

        self.assertListEqual(expected_command, command)
示例#5
0
    def test_slurm_command_priority(self):
        run = ContainerRun(pk=99)
        run.user = User(username='******')
        run.app = ContainerApp()
        run.app.container = Container()
        run.app.container.family = ContainerFamily(name='my container')
        slurm_queues = (('low', 'kive-low'), ('medium', 'kive-medium'),
                        ('high', 'kive-high'))
        run.priority = 2
        run.sandbox_path = 'run23'
        expected_command = [
            'sbatch', '-J', 'r99 my container', '--parsable', '--output',
            '/tmp/kive_media/run23/logs/job%J_node%N_stdout.txt', '--error',
            '/tmp/kive_media/run23/logs/job%J_node%N_stderr.txt', '-c', '1',
            '--mem', '6000', '-p', 'kive-high', EXPECTED_MANAGE_PATH,
            'runcontainer', '99'
        ]

        command = run.build_slurm_command(slurm_queues)

        self.assertListEqual(expected_command, command)
示例#6
0
    def test_slurm_command_custom_memory(self):
        run = ContainerRun(pk=99)
        run.user = User(username='******')
        run.app = ContainerApp(threads=3, memory=100)
        run.app.container = Container()
        run.app.container.family = ContainerFamily(name='my container')
        run.sandbox_path = 'run23'
        expected_command = [
            'sbatch',
            '-J', 'r99 my container',
            '--parsable',
            '--output', '/tmp/kive_media/run23/logs/job%J_node%N_stdout.txt',
            '--error', '/tmp/kive_media/run23/logs/job%J_node%N_stderr.txt',
            '-c', '3',
            '--mem', '100',
            EXPECTED_MANAGE_PATH,
            'runcontainer',
            '99']

        command = run.build_slurm_command()

        self.assertListEqual(expected_command, command)