Repository navigation
refactor(kubernetes): drop the typed clientset to shrink the binary by 26MB - #1686
Merged
Merged
Conversation
…y 26MB The teleport workspace imported k8s.io/client-go/kubernetes, whose scheme links all 56 k8s.io/api groups and 55 typed clients into the binary. The package only needs Secrets, one Deployment status field, the port-forward URL, the operator check and the server version. Secrets and the gateway Deployment now go through the dynamic client the package already uses, converted with the unstructured converter. The operator check lists Orchestrators with a limit of one, which a cluster without the CRD answers with not found just as discovery did. A scheme-free core/v1 REST client builds the port-forward URL and reads /version. Stripped darwin/arm64 drops from 105.2MB to 79.4MB and the linked k8s.io/api packages from 56 to core/v1 alone. Closes #1649
Contributor
|
🎉 This PR is included in version 0.241.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
edenreich
added a commit
that referenced
this pull request
Nov 3, 2026
## Summary GitHub serves release assets uncompressed, so every install moved the whole executable, about 105MB per platform (80MB after #1686). Each platform now ships as `infer-<os>-<arch>.tar.gz` holding one file, `infer` (`infer.exe` on Windows). `checksums.txt` and its Cosign bundle cover the archives. - `release.yml` archives the artifacts in the release job with GNU tar (`--transform` renames the entry, `--owner=0 --group=0`), checksums the archives and verifies the new asset list. - `release.config.mjs` uploads the archives. - `install.sh`, `install.ps1` and `npm/bin/install.js` download the archive and extract it with the system `tar`, which macOS, Linux and Windows 10+ ship. - `docs/installation.md` and `docs/binary-verification.md` describe the archives. - The container image builds from the workflow's raw artifacts via `--build-context binaries=dist/`, unchanged. The raw `infer-<os>-<arch>` release assets are gone. | | before | after | | --- | --- | --- | | darwin/arm64 asset | 79.4MB raw | 25.9MB `.tar.gz` | ## Affected repos Consumers of the raw asset names outside this repository, found with `gh search code` and a grep of shallow clones: - **inference-gateway/infer-action**: inference-gateway/infer-action#433 downloads the archive and falls back to the raw asset for pinned older versions. - **inference-gateway/desktop**: `backend/src/env.rs` maps the platform to the raw asset name and `backend/src/cli_install.rs` downloads it from `releases/latest/download`, verifies it against `checksums.txt` and renames it into place. inference-gateway/desktop#420 downloads the archive, verifies it and extracts it. Desktop builds already installed keep calling the raw URL, so that desktop release should go out before this merges. - **inference-gateway/opentask** pins the Nix flake and **inference-gateway/docs** only points at `install.sh`. Neither changes. ## Verification - `install.sh` and the npm postinstall run against a local server holding a `.tar.gz` built from this branch's binary and its `checksums.txt`: both install a working `infer`, and a tampered checksum fails the npm install. - The archive step ran under GNU tar 1.35 from nixpkgs: the Linux archive holds `infer`, the Windows one `infer.exe`, both owned by root. - `task precommit:run` passes. Closes #1687
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The teleport workspace imported
k8s.io/client-go/kubernetes, whose scheme links all 56k8s.io/apigroups and 55 typed clients into the binary. The package only needs Secrets, one Deployment status field, the port-forward URL, the operator check and the server version.DefaultUnstructuredConverterkeepingcorev1.Secretas the working type.Limit: 1. A cluster without the CRD answers not found, as discovery did./version.kubernetes/fake,discovery/fakeandk8s.io/api/apps/v1are gone.task buildk8s.io/api/packagescore/v1)Verification
go list -tags purego -deps ./cmd/inferlists nok8s.io/client-go/kubernetesordiscoverypackage and onlyk8s.io/api/core/v1.go test ./internal/agent/infrastructure/kubernetes/ ./cmd/daemon/...andtask precommit:runpass.build-clusterkubernetes workspace (k3s v1.37.1, operator installed):/workspacesprobe reportskubernetes=v1.37.1+k3s1andorchestrators=1<name>-tlsSecret holds the six keys and its single owner reference is the session's Orchestrator, UID matchingCloses #1649