def build_prep(model_path='.', server_config=None, server_port=9090):
    'Prepares the model to be Dockerised by generating a dockerimage'
    model_path = osp.abspath(model_path)
    (model_tag, model_version) = get_model_tag_and_version(model_path)
    if (server_config is None):
        server_config = 'false'
    kwargs = {'catwalk_version': catwalk_version, 'model_tag': model_tag, 'model_version': model_version, 'server_config': server_config, 'server_port': server_port}
    files_to_create = ['Dockerfile', '.dockerignore']
    env = Environment(loader=PackageLoader('catwalk', 'templates'))
    for f in files_to_create:
        template_file = (f + '.j2')
        if (template_file[0] == '.'):
            template_file = template_file[1:]
        template = env.get_template(template_file)
        rendered = template.render(**kwargs)
        out_path = osp.join(model_path, f)
        with open(out_path, 'w') as fp:
            fp.write(rendered)
        logger.info(('Wrote ' + f))
Prepares the model to be Dockerised by generating a dockerimage
def build_prep(model_path='.', server_config=None, server_port=9090):
    
    model_path = osp.abspath(model_path)
    (model_tag, model_version) = get_model_tag_and_version(model_path)
    if (server_config is None):
        server_config = 'false'
    kwargs = {'catwalk_version': catwalk_version, 'model_tag': model_tag, 'model_version': model_version, 'server_config': server_config, 'server_port': server_port}
    files_to_create = ['Dockerfile', '.dockerignore']
    env = Environment(loader=PackageLoader('catwalk', 'templates'))
    for f in files_to_create:
        template_file = (f + '.j2')
        if (template_file[0] == '.'):
            template_file = template_file[1:]
        template = env.get_template(template_file)
        rendered = template.render(**kwargs)
        out_path = osp.join(model_path, f)
        with open(out_path, 'w') as fp:
            fp.write(rendered)
        logger.info(('Wrote ' + f))