Esempio n. 1
0
def shared_file(ctx, in_path, shared_path):
    """
    Uploads a shared file to Faasm
    """
    host, _ = get_upload_host_port(None, None)

    upload_shared_file(host, in_path, shared_path, quiet=True)
Esempio n. 2
0
def _do_file_upload(host, local_copy, file_path, file_name, dest_root):
    if local_copy:
        # Copy directly if local copy
        dest_file = join(dest_root, file_name)
        run("cp {} {}".format(file_path, dest_file), shell=True)
    else:
        # Upload if not local
        shared_path = "genomics/{}".format(file_name)
        upload_shared_file(host, file_path, shared_path)
Esempio n. 3
0
def upload(ctx, host=None, local_copy=False):
    """
    Upload Tensorflow lite demo data
    """
    host, port = get_upload_host_port(host, None)

    source_data = join(EXPERIMENTS_FUNC_DIR, "tf", "data")

    dest_root = join(FAASM_SHARED_STORAGE_ROOT, "tfdata")
    if local_copy:
        makedirs(dest_root, exist_ok=True)

    for root, dirs, files in walk(source_data):
        for filename in files:
            file_path = join(source_data, filename)

            if local_copy:
                dest_file = join(dest_root, filename)
                call("cp {} {}".format(file_path, dest_file), shell=True)
            else:
                shared_path = "tfdata/{}".format(filename)
                upload_shared_file(host, file_path, shared_path)