feat: decouple container SDK version from CLI version#2771
Merged
tempusfrangit merged 5 commits intomainfrom Feb 24, 2026
Merged
feat: decouple container SDK version from CLI version#2771tempusfrangit merged 5 commits intomainfrom
tempusfrangit merged 5 commits intomainfrom
Conversation
Member
Author
|
Based upon an internal conversation, I think the plan is to move to:
|
- Remove version-pinning from ResolveCogWheel/ResolveCogletWheel; both now default to latest PyPI (version pinning moves to build.sdk_version) - Add IsPreRelease(version) bool for PEP 440 and semver pre-release detection - Add MinimumSDKVersion constant (0.16.0) and ValidateSDKVersion helper - Add baseVersionRe to strip pre-release suffix before version comparison - Update doc comments and tests to reflect new unpinned defaults
Member
|
If these options are just for development, I wonder if it would be better as a hidden command-line option ( |
- Add SDKVersion field to Build struct in config.go and config_file.go - Add sdk_version to JSON schema (additionalProperties: false requires it) - Wire sdk_version into Dockerfile generator with correct precedence: COG_SDK_WHEEL env var > build.sdk_version > auto-detect/latest PyPI - Add --pre flag to cog and coglet pip installs when sdk_version is a pre-release (PEP 440 or semver); coglet also gets --pre since a pre- release sdk implies a matching pre-release coglet - Validate sdk_version >= 0.16.0 at Dockerfile generation time - Update existing TestCOGWheelEnvPyPIWithVersion to use a valid version - Add tests: TestInstallCogWithSDKVersion, TestInstallCogWithPreReleaseSDKVersion, TestInstallCogSDKVersionBelowMinimum, TestCOGSDKWheelEnvVarOverridesSDKVersion - Add config tests: TestSDKVersionConfig, TestSDKVersionConfigEmpty, TestSDKVersionConfigPreRelease, TestSDKVersionConfigBelowMinimumExplodesInGenerator - Document sdk_version in docs/yaml.md; regenerate docs/llms.txt
36907aa to
6959efc
Compare
Previously the warning was vague. Now it tells the user exactly what the build system is installing instead, and which mechanism to use to control the version (build.sdk_version / COG_SDK_WHEEL / COGLET_WHEEL). Also refactors wheel config resolution into resolveCogWheelConfigs() so the resolved configs are available to filterManagedPackages() when it emits warnings, and to installCog() for the actual install — resolved once, shared between both.
Member
Author
|
Ok PR updated from conversations, ready for review @bfirsh @michaeldwan @markphelps |
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
Previously, release builds of the CLI pinned
cog==<cli-version>andcoglet==<cli-version>in every generated Dockerfile, coupling the container SDK version to whatever CLI version the user happened to be running.This PR decouples them completely. The default is now always latest PyPI. Users can pin explicitly via
build.sdk_versionincog.yaml, or override via environment variable.Resolution order
For the cog SDK:
COG_SDK_WHEELenv var — explicit operator/CI overridebuild.sdk_versionincog.yaml— user-declared pindist/cog-*.whl— dev builds only (CLI version isdev)For coglet:
COGLET_WHEELenv var — explicit overridedist/coglet-*.whl— dev builds onlyrequirements.txt / python_packages
cogandcogletare always stripped from user requirements — they are managed exclusively by the build system. If found, you'll get a warning like:The warning fires even if the versions match —
requirements.txtis not the intended place to control cog/coglet versions.Changes
COG_WHEEL→COG_SDK_WHEELfor clarityContainsCoglet()escape hatch — replaced byfilterManagedPackages()which always stripscog/cogletfrom requirements with an actionable warningResolveCogWheelandResolveCogletWheelno longer pin to the CLI version for release buildsbuild.sdk_version— optional field incog.yamlto pin the cog SDK version"0.18.0"or"0.18.0a1")--preto bothcogandcogletpip installs0.16.0are rejected at Dockerfile generation time with a clear errorIsPreReleaseandValidateSDKVersionhelpers topkg/wheelsUsage