def METHOD_NAME(blobs: str, tree: str):
    compression = "gzip"
    layer_file = os.path.join(blobs, "layer.tar")
    command = [
        "tar",
        "--no-selinux",
        "--acls",
        "--xattrs",
        "-cf", layer_file,
        "-C", tree,
    ] + os.listdir(tree)
    print("creating layer")
    subprocess.run(command,
                   stdout=subprocess.DEVNULL,
                   check=True)
    digest = "sha256:" + sha256sum(layer_file)
    print("compressing layer")
    suffix = ".compressed"
    subprocess.run([compression,
                    "-S", suffix,
                    layer_file],
                   stdout=subprocess.DEVNULL,
                   check=True)
    layer_file += suffix
    info = blobs_add_file(blobs, layer_file, "layer")
    info["mediaType"] += "+" + compression
    return digest, info