feat(001): implement deploy-time external providers L1#240
Draft
rhuss wants to merge 6 commits into
Draft
Conversation
Align spec files with llama-stack upstream refactoring: Naming changes: - run.yaml -> config.yaml (157 references) - --run-yaml -> --config CLI flags - image_name -> distro_name (deprecated field) Architecture simplification: - Remove extra-providers.yaml and merge step entirely - Use LlamaStack's native `module:` field in provider entries - Rename "merge init container" to "config generation init container" - Provider entries added directly to config.yaml providers section The new approach is simpler: 1. Init containers install packages from container images 2. Config generation adds provider entries with module: field 3. LlamaStack imports via importlib.import_module() No pip install from external indexes - fully self-contained. Assisted-By: 🤖 Claude Code Signed-off-by: Roland Huß <rhuss@redhat.com>
- Add Terminology section for Phase usage disambiguation - Add kubebuilder validation patterns for providerId and image fields - Add NFR-006 for configurable volume size limit (default 2Gi) - Add volumeSizeLimit field to ExternalProvidersSpec CRD - Clarify FR-020 timing (config generation init container) - Clarify SC-004 success criteria for provider functionality - Update lls-preflight-spec open questions to align with main spec Assisted-by: 🤖 Claude Code Signed-off-by: Roland Huß <rhuss@redhat.com>
Implements the core functionality for external provider injection at deployment time, enabling custom LlamaStack providers via container images. CRD Extensions: - ExternalProvidersSpec organized by API type (inference, safety, etc.) - ExternalProviderRef with providerID, image, imagePullPolicy, config - ExternalProviderStatus for phase-based tracking - ExternalProviderPhase enum (Pending, Installing, Ready, Failed) Provider Package (pkg/provider/): - ProviderMetadata struct matching lls-provider-spec.yaml schema - LoadProviderMetadata and ParseProviderMetadata functions - ValidateMetadata with comprehensive validation rules - API name normalization between CRD and config.yaml formats Deploy Package (pkg/deploy/): - GenerateInitContainers for provider installation - GenerateExtractConfigInitContainer for base config extraction - Volume helpers for shared emptyDir configuration - MountExternalProvidersVolume and UpdatePythonPath helpers - RunYamlConfig struct and MergeExternalProviders function - GenerateConfig orchestrating the full merge process Controller Integration: - configureExternalProviders in resource_helper.go - Status tracking functions in status.go - PYTHONPATH and config path updates for main container Binary (cmd/generate-config/): - CLI tool for config generation init container - Reads provider metadata and merges into base config.yaml Dockerfile: - Builds and includes generate-config binary Assisted-By: 🤖 Claude Code
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
This PR implements the core functionality for external provider injection at deployment time, enabling custom LlamaStack providers via container images.
Spec Reference:
specs/001-deploy-time-providers-l1/spec.mdCRD Extensions
ExternalProvidersSpecorganized by API type (inference, safety, agents, etc.)ExternalProviderRefwith providerId, image, imagePullPolicy, configExternalProviderStatusfor phase-based tracking (Pending, Installing, Ready, Failed)New Packages
Provider Package (
pkg/provider/)ProviderMetadatastruct matchinglls-provider-spec.yamlschemaLoadProviderMetadataandParseProviderMetadatafunctionsValidateMetadatawith comprehensive validation rulesDeploy Package Extensions (
pkg/deploy/)GenerateInitContainersfor provider installationGenerateExtractConfigInitContainerfor base config extractionRunYamlConfigstruct andMergeExternalProvidersfunctionGenerateConfigorchestrating the full merge processBinary (
cmd/generate-config/)Controller Integration
configureExternalProvidersin resource_helper.goDockerfile Updates
/generate-configExample Usage
Test plan
pkg/provider/packagepkg/deploy/package (initcontainer, runyaml)Assisted-By: 🤖 Claude Code