Supply-chain controlled distribution of the sonos/tract ONNX inference CLI for Autokada image search.
Autokada uses MobileNetV3 ONNX embeddings for image search. The tract binary runs inference server-side from PHP via proc_open — no Python, no container changes required. Rather than downloading directly from the upstream sonos/tract releases on every deploy (which would be vulnerable to upstream supply-chain compromise), this repo acts as a verified distribution point under Scandiweb's control.
Updating the binary requires a deliberate human action in this repo, not an automated pull from a third party.
tract is a self-contained, Rust-based ONNX/TensorFlow inference engine originally built by Sonos. It compiles to a fully static x86_64-linux-musl binary with no shared library dependencies. It has been production-tested at Sonos/Amazon scale.
readymage.yamlpost-deploy hook downloads the tarball from this repo's releases to/mnt/- A Magento CLI command (
autokada:tract:verify) checks the SHA256, makes it executable, and runs a smoke test Autokada\AIImageSearch\Service\MlCommonsImageIndexingServicecalls the binary via PHPproc_opento compute 576-dim MobileNetV3 embeddings for product images- Embeddings are stored in the OpenSearch
wk_aiimage_search_collectionk-NN index
| Version | Upstream tag | Binary SHA256 | Tarball SHA256 |
|---|---|---|---|
| v0.21.15 | 0.21.15 | 574bc46c9e58582635f5f70055ee09035bbf2af8ce25189e61523256204b37d2 |
96ca32f2b3f2cb266c6314c604053773adee6bace2f426644dd0565383d66969 |
- Download the new release tarball from
sonos/tractreleases. - Verify the tarball checksum against the upstream release notes.
- Extract and verify the binary checksum independently.
- Update the table above with the new checksums.
- Upload the new tarball as a release asset on this repo.
- Update the SHA256 constant in
Autokada\AIImageSearch\Service\TractVerifyService(or equivalent) in the Autokada codebase. - Open a PR — another engineer reviews and merges.
Never update the binary without a code review. Never automate this step.
After download, Magento runs:
sha256sum /mnt/tract-x86_64-unknown-linux-musl-0.21.15.tgz
and compares against the hardcoded constant in the Autokada codebase. If they do not match, the deploy command exits non-zero and the binary is not made executable.
x86_64-unknown-linux-musl — fully static, no glibc dependency. Runs on the ReadyMage PHP/SSH pod (x86_64 Linux) without any container modification.