Example #1
0
def exec_ctx(temp_runtime, scheduler):
    if fixtures.USER_CONFIG_FILE and scheduler.registered_name != 'local':
        rt = temp_runtime(fixtures.USER_CONFIG_FILE, fixtures.USER_SYSTEM)
    else:
        rt = temp_runtime(fixtures.TEST_CONFIG_FILE, 'generic')

    next(rt)
    if scheduler.registered_name == 'squeue':
        # slurm backend fulfills the functionality of the squeue backend, so
        # if squeue is not configured, use slurm instead
        partition = (fixtures.partition_by_scheduler('squeue')
                     or fixtures.partition_by_scheduler('slurm'))
    else:
        partition = fixtures.partition_by_scheduler(scheduler.registered_name)

    if partition is None:
        pytest.skip(f"scheduler '{scheduler.registered_name}' not configured")

    return partition
Example #2
0
def local_user_exec_ctx(user_system):
    partition = fixtures.partition_by_scheduler('local')
    if partition is None:
        pytest.skip('no local jobs are supported')

    try:
        environ = partition.environs[0]
    except IndexError:
        pytest.skip(
            f'no environments configured for partition: {partition.fullname}')

    yield partition, environ
Example #3
0
def remote_exec_ctx(user_system):
    partition = fixtures.partition_by_scheduler()
    if partition is None:
        pytest.skip('job submission not supported')

    try:
        environ = partition.environs[0]
    except IndexError:
        pytest.skip(
            f'no environments configured for partition: {partition.fullname}')

    yield partition, environ
Example #4
0
def remote_exec_ctx(user_exec_ctx):
    partition = fixtures.partition_by_scheduler()
    if not partition:
        pytest.skip('job submission not supported')

    return partition, partition.environs[0]