Versions Compared

    Key

    • This line was added.
    • This line was removed.
    • Formatting was changed.
    Comment: Published by Scroll Versions from this space and version 6.8-4

    It's possible to submit a job that will remain in a "blocked" state until a certain time on a specific day, at which time it will then automatically go into a "pending" state and be the next job dispatched to the farm

    With WranglerView

    WV_delayed_start.png

    With ArtistView

    Screen Shot 2016-09-14 at 11.15.57 AM.png

    With the API

    This in an example of how to submit a job that will start at a later time.  

    Lines of interest are:

    • line 14, where the start time is set
    • line 28, where the trigger condition is set 
    Code Block
    titleSubmit a job that will run in 1 hour
    linenumberstrue
    languagepy
    #!/usr/bin/env python
    
    import sys
    import os
    import time
    
    sys.path.append(os.environ['QBDIR'])
    import qb
    
    task = []
    agenda = qb.genframes('1-2')
    
    now = int(time.time())
    later = now + 3600 - qb.QB_TIME_EPOCH_OFFSET
    
    job = {
        'prototype': 'cmdrange',
        'name': 'wait time test',
        'status': 'blocked',
        'package': {'cmdline': 'sleep 30'},
        'agenda': agenda,
        'callbacks': [],
        'hosts': 'rhel52-64,rhel53-64,rhel54-64'
    }
    
    cb = {
        'language': 'qube',
        'triggers': 'dummy-time-self-%d' % later,
        'code': 'unblock-self'
    }
    
    job['callbacks'].append(cb)
    
    task.append(job)
    
    submitted = qb.submit(task)
    
    for job in submitted:
        print 'submitted job %(id)s: %(name)s' % job