diff --git a/api/v1alpha1/chunksgenerator_types.go b/api/v1alpha1/chunksgenerator_types.go index 90fc66c5..3ab20bcb 100644 --- a/api/v1alpha1/chunksgenerator_types.go +++ b/api/v1alpha1/chunksgenerator_types.go @@ -56,9 +56,10 @@ type ChunksGeneratorSpec struct { // ChunksGeneratorStatus defines the observed state of ChunksGenerator type ChunksGeneratorStatus struct { - LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"` - Conditions []metav1.Condition `json:"conditions,omitempty"` - FilesProcessed int64 `json:"filesProcessed,omitempty"` + LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` + FilesProcessed int64 `json:"filesProcessed,omitempty"` + AppliedConfig *ChunksGeneratorConfig `json:"appliedConfig,omitempty"` } // +kubebuilder:object:root=true diff --git a/api/v1alpha1/documentprocessor_types.go b/api/v1alpha1/documentprocessor_types.go index 6e249774..268176ca 100644 --- a/api/v1alpha1/documentprocessor_types.go +++ b/api/v1alpha1/documentprocessor_types.go @@ -75,11 +75,12 @@ type DocumentProcessorSpec struct { // DocumentProcessorStatus defines the observed state of DocumentProcessor type DocumentProcessorStatus struct { - LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"` - Conditions []metav1.Condition `json:"conditions,omitempty"` - Jobs []Job `json:"jobs,omitempty"` - PermanentlyFailingFiles []string `json:"permanentlyFailingFiles,omitempty"` - FilesProcessed int64 `json:"filesProcessed,omitempty"` + LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` + Jobs []Job `json:"jobs,omitempty"` + PermanentlyFailingFiles []string `json:"permanentlyFailingFiles,omitempty"` + FilesProcessed int64 `json:"filesProcessed,omitempty"` + AppliedConfig *DocumentProcessorConfig `json:"appliedConfig,omitempty"` } type Job struct { diff --git a/api/v1alpha1/vectorembeddingsgenerator_types.go b/api/v1alpha1/vectorembeddingsgenerator_types.go index 4cfd5ea9..b7422265 100644 --- a/api/v1alpha1/vectorembeddingsgenerator_types.go +++ b/api/v1alpha1/vectorembeddingsgenerator_types.go @@ -54,9 +54,10 @@ type VectorEmbeddingsGeneratorSpec struct { // VectorEmbeddingsGeneratorStatus defines the observed state of VectorEmbeddingsGenerator. type VectorEmbeddingsGeneratorStatus struct { - LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"` - Conditions []metav1.Condition `json:"conditions,omitempty"` - FilesProcessed int64 `json:"filesProcessed,omitempty"` + LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` + FilesProcessed int64 `json:"filesProcessed,omitempty"` + AppliedConfig *VectorEmbeddingsGeneratorConfig `json:"appliedConfig,omitempty"` } // +kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index c28e29d3..1da1320f 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -133,6 +133,11 @@ func (in *ChunksGeneratorStatus) DeepCopyInto(out *ChunksGeneratorStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.AppliedConfig != nil { + in, out := &in.AppliedConfig, &out.AppliedConfig + *out = new(ChunksGeneratorConfig) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChunksGeneratorStatus. @@ -552,6 +557,11 @@ func (in *DocumentProcessorStatus) DeepCopyInto(out *DocumentProcessorStatus) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.AppliedConfig != nil { + in, out := &in.AppliedConfig, &out.AppliedConfig + *out = new(DocumentProcessorConfig) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DocumentProcessorStatus. @@ -1242,6 +1252,11 @@ func (in *VectorEmbeddingsGeneratorStatus) DeepCopyInto(out *VectorEmbeddingsGen (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.AppliedConfig != nil { + in, out := &in.AppliedConfig, &out.AppliedConfig + *out = new(VectorEmbeddingsGeneratorConfig) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VectorEmbeddingsGeneratorStatus. diff --git a/config/crd/bases/operator.dataverse.redhat.com_chunksgenerators.yaml b/config/crd/bases/operator.dataverse.redhat.com_chunksgenerators.yaml index f8969ab6..c9ec31be 100644 --- a/config/crd/bases/operator.dataverse.redhat.com_chunksgenerators.yaml +++ b/config/crd/bases/operator.dataverse.redhat.com_chunksgenerators.yaml @@ -122,6 +122,60 @@ spec: status: description: ChunksGeneratorStatus defines the observed state of ChunksGenerator properties: + appliedConfig: + properties: + markdownSplitterConfig: + properties: + chunkOverlap: + type: integer + chunkSize: + type: integer + codeBlocks: + type: boolean + headingHierarchy: + type: boolean + joinTableRows: + type: boolean + referenceLinks: + type: boolean + type: object + recursiveCharacterSplitterConfig: + properties: + chunkOverlap: + type: integer + chunkSize: + type: integer + keepSeparator: + type: boolean + separators: + items: + type: string + type: array + type: object + strategy: + type: string + tokenSplitterConfig: + properties: + allowedSpecial: + items: + type: string + type: array + chunkOverlap: + type: integer + chunkSize: + type: integer + disallowedSpecial: + items: + type: string + type: array + encodingName: + type: string + modelName: + type: string + type: object + required: + - strategy + type: object conditions: items: description: Condition contains details for one aspect of the current diff --git a/config/crd/bases/operator.dataverse.redhat.com_documentprocessors.yaml b/config/crd/bases/operator.dataverse.redhat.com_documentprocessors.yaml index 09cc4394..ef6190d7 100644 --- a/config/crd/bases/operator.dataverse.redhat.com_documentprocessors.yaml +++ b/config/crd/bases/operator.dataverse.redhat.com_documentprocessors.yaml @@ -137,6 +137,75 @@ spec: status: description: DocumentProcessorStatus defines the observed state of DocumentProcessor properties: + appliedConfig: + properties: + doclingConfig: + properties: + abort_on_error: + description: 'Deprecated: this field is ignored; abort_on_error + is always false.' + type: boolean + do_chart_extraction: + type: boolean + do_code_enrichment: + type: boolean + do_formula_enrichment: + type: boolean + do_ocr: + type: boolean + do_picture_classification: + type: boolean + do_picture_description: + type: boolean + do_table_structure: + type: boolean + document_timeout: + type: string + force_ocr: + type: boolean + from_formats: + items: + type: string + type: array + image_export_mode: + type: string + images_scale: + type: string + include_images: + type: boolean + md_page_break_placeholder: + type: string + ocr_engine: + description: 'Deprecated: use OCRPreset instead.' + type: string + ocr_lang: + items: + type: string + type: array + ocr_preset: + type: string + page_range: + items: + type: integer + type: array + pdf_backend: + type: string + picture_description_area_threshold: + type: string + pipeline: + type: string + table_cell_matching: + type: boolean + table_mode: + type: string + to_formats: + items: + type: string + type: array + type: object + type: + type: string + type: object conditions: items: description: Condition contains details for one aspect of the current diff --git a/config/crd/bases/operator.dataverse.redhat.com_vectorembeddingsgenerators.yaml b/config/crd/bases/operator.dataverse.redhat.com_vectorembeddingsgenerators.yaml index fcfdb46e..d05ff66c 100644 --- a/config/crd/bases/operator.dataverse.redhat.com_vectorembeddingsgenerators.yaml +++ b/config/crd/bases/operator.dataverse.redhat.com_vectorembeddingsgenerators.yaml @@ -84,6 +84,19 @@ spec: description: VectorEmbeddingsGeneratorStatus defines the observed state of VectorEmbeddingsGenerator. properties: + appliedConfig: + properties: + batchSize: + minimum: 1 + type: integer + modelName: + type: string + nomicEmbedTextV15Config: + properties: + encodingformat: + type: string + type: object + type: object conditions: items: description: Condition contains details for one aspect of the current diff --git a/internal/controller/chunksgenerator_controller.go b/internal/controller/chunksgenerator_controller.go index 5a20bb30..10dcc51f 100644 --- a/internal/controller/chunksgenerator_controller.go +++ b/internal/controller/chunksgenerator_controller.go @@ -164,6 +164,7 @@ func (r *ChunksGeneratorReconciler) Reconcile(ctx context.Context, req ctrl.Requ successMessage := fmt.Sprintf("successfully reconciled chunks generator: %s", chunksGeneratorCR.Name) if err := controllerutils.StatusPatch(ctx, r.Client, chunksGeneratorCR, func() { chunksGeneratorCR.Status.FilesProcessed += filesProcessed + chunksGeneratorCR.Status.AppliedConfig = chunksGeneratorCR.Spec.ChunksGeneratorConfig.DeepCopy() chunksGeneratorCR.UpdateStatus(successMessage, nil) }); err != nil { logger.Error(err, "failed to update ChunksGenerator CR status", "namespace", chunksGeneratorCR.Namespace, "name", chunksGeneratorCR.Name) diff --git a/internal/controller/documentprocessor_controller.go b/internal/controller/documentprocessor_controller.go index 1439a7d7..cec85acb 100644 --- a/internal/controller/documentprocessor_controller.go +++ b/internal/controller/documentprocessor_controller.go @@ -185,6 +185,7 @@ func (r *DocumentProcessorReconciler) Reconcile(ctx context.Context, req ctrl.Re successMessage := fmt.Sprintf("successfully reconciled document processor: %s", documentProcessorCR.Name) if err := controllerutils.StatusPatch(ctx, r.Client, documentProcessorCR, func() { + documentProcessorCR.Status.AppliedConfig = documentProcessorCR.Spec.DocumentProcessorConfig.DeepCopy() documentProcessorCR.UpdateStatus(successMessage, nil) }); err != nil { logger.Error(err, "failed to update DocumentProcessor CR status", "namespace", documentProcessorCR.Namespace, "name", documentProcessorCR.Name) diff --git a/internal/controller/vectorembeddingsgenerator_controller.go b/internal/controller/vectorembeddingsgenerator_controller.go index 15529259..6e652501 100644 --- a/internal/controller/vectorembeddingsgenerator_controller.go +++ b/internal/controller/vectorembeddingsgenerator_controller.go @@ -141,6 +141,7 @@ func (r *VectorEmbeddingsGeneratorReconciler) Reconcile(ctx context.Context, req successMessage := fmt.Sprintf("successfully reconciled vector embeddings generator: %s", vectorEmbeddingsGeneratorCR.Name) if err := controllerutils.StatusPatch(ctx, r.Client, vectorEmbeddingsGeneratorCR, func() { vectorEmbeddingsGeneratorCR.Status.FilesProcessed += filesProcessed + vectorEmbeddingsGeneratorCR.Status.AppliedConfig = vectorEmbeddingsGeneratorCR.Spec.VectorEmbeddingsGeneratorConfig.DeepCopy() vectorEmbeddingsGeneratorCR.UpdateStatus(successMessage, nil) }); err != nil { logger.Error(err, "failed to update VectorEmbeddingsGenerator CR status", "namespace", vectorEmbeddingsGeneratorCR.Namespace, "name", vectorEmbeddingsGeneratorCR.Name)