omni/hack/zstd-dict
Utku Ozdemir 0e76483bab
Some checks failed
default / default (push) Has been cancelled
default / e2e-backups (push) Has been cancelled
default / e2e-forced-removal (push) Has been cancelled
default / e2e-omni-upgrade (push) Has been cancelled
default / e2e-scaling (push) Has been cancelled
default / e2e-short (push) Has been cancelled
default / e2e-short-secureboot (push) Has been cancelled
default / e2e-templates (push) Has been cancelled
default / e2e-upgrades (push) Has been cancelled
default / e2e-workload-proxy (push) Has been cancelled
chore: rekres, bump deps, Go, Talos and k8s versions, satisfy linters
- Bump some deps, namely cosi-runtime and Talos machinery.
- Update `auditState` to implement the new methods in COSI's `state.State`.
- Bump default Talos and Kubernetes versions to their latest.
- Rekres, which brings Go 1.24.5. Also update it in go.mod files.
- Fix linter errors coming from new linters.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2025-07-11 18:23:48 +02:00
..
data chore: fix capitalization of wireguard 2024-09-24 10:00:07 +02:00
.gitignore feat: implement compression of config fields on resources 2024-09-11 14:48:57 +02:00
.golangci.yml feat: implement compression of config fields on resources 2024-09-11 14:48:57 +02:00
.kresignore feat: implement compression of config fields on resources 2024-09-11 14:48:57 +02:00
go.mod chore: rekres, bump deps, Go, Talos and k8s versions, satisfy linters 2025-07-11 18:23:48 +02:00
go.sum chore: update zstd module go.mod deps 2025-07-09 17:25:14 +03:00
main.go feat: display OMNI_ENDPOINT in the service account creation UI 2025-01-29 15:27:36 +03:00
README.md feat: implement compression of config fields on resources 2024-09-11 14:48:57 +02:00

zstd-dict

zstd-dict is a tool for generating a zstd dictionary used to compress resources containing partial or full Talos machine configurations, such as ClusterMachineConfig and ConfigPatch.

The dictionary is generated using a training set consisting of:

  • Randomly generated Talos machine configuration YAMLs
  • ArgoCD application manifests generated via the helm template command

Kubernetes manifests are included because they are commonly used in the inlineManifests section of Talos machine configurations.

This tool updates the client/pkg/compression/data/config.zdict dictionary file under the Omni project root. It also writes the input files used for training into the inputs/ directory.

The inputs/ directory can then be used as input to generate a dictionary using the zstd command-line tool.

To generate a dictionary via command line:

  1. Install zstd
  2. In the directory of this tool, run the following command:
export DICT_ID=1
zstd --train -r inputs -o ../../client/pkg/compression/data/config.$DICT_ID.zdict --dictID $DICT_ID --maxdict=64KB

Note: The dictionary trained via command line might produce different, potentially better results than the one generated by this tool. Compare the results of both dictionaries before deciding which one to use.

Note: When updating the dictionary, follow these steps to maintain backward compatibility:

  1. Increment the dictionary ID in this tool.
  2. Update the shell command above with the new dictionary ID.
  3. In the client/pkg/compression/data/ package, add the new dictionary file without removing the old ones.
  4. Update the code in the compression package to handle multiple dictionary versions, ensuring that the decoder can still access and use the old dictionaries when needed.

These steps are crucial to maintain compatibility with data compressed using previous dictionary versions.