def get_services(config, jobname):
    """
    Get the service containers that should be started for a particular job
    :param config:
    :param jobname:
    :return:
    """
    job = config.get(jobname)
    services = []
    service_defs = []
    if 'image' in config or 'image' in job:
        all_services = config.get('services', [])
        job_services = job.get('services', [])
        services = all_services + job_services
    for service in services:
        item = {}
        if isinstance(service, str):
            item['name'] = service
        if isinstance(service, dict):
            assert 'name' in service
            item = service
        if item:
            service_defs.append(item)
    return service_defs
