feat: add artifacts-based configuration for selective destination syncing#126
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a SyncToDestination configuration across the DocumentProcessor, ChunksGenerator, and VectorEmbeddingsGenerator components, allowing for granular control over which processed files are synchronized to the final destination. The controllers have been updated to conditionally trigger reconciliation and synchronization based on these flags and the presence of unprocessed files. Additionally, the Snowflake destination logic was refactored to handle multiple file types and prevent redundant uploads by comparing metadata. Review feedback suggests improving the robustness of JSON parsing for raw file paths by using minimal anonymous structs and refactoring the metadata comparison logic to reduce code duplication using generics.
ab1e868 to
973922f
Compare
973922f to
3d60885
Compare
3d60885 to
847640c
Compare
847640c to
e1b8e69
Compare
e1b8e69 to
ea88c03
Compare
ea88c03 to
b1341f3
Compare
84d60e0 to
32d667c
Compare
32d667c to
365fd2a
Compare
365fd2a to
af29a89
Compare
af29a89 to
b7c3a73
Compare
b7c3a73 to
5b1745a
Compare
5b1745a to
139536c
Compare
139536c to
5355fe1
Compare
|
|
||
| func buildDestinationPath(ctx context.Context, unstructuredDataProductCR operatorv1alpha1.UnstructuredDataPipeline, filePaths []string) []unstructured.ArtifactFiles { | ||
| logger := log.FromContext(ctx) | ||
| var artifactFileGroups []unstructured.ArtifactFiles |
There was a problem hiding this comment.
what is artifactFileGroup? is it not containing list of files ?
There was a problem hiding this comment.
Here ArtifactFileGroup is one configured artifact i.e.
- Files - list of file paths in filestore
- Path - destination path
Shall I rename it to something like ArtifactSyncGroup
|
|
||
| // list all files in the filestore for the data product | ||
| // list files to check if processing is needed | ||
| filePaths, err := r.fileStore.ListFilesInPath(ctx, dataProductName) |
| } | ||
|
|
||
| artifactPath := artifact.Path | ||
| if artifactPath == "" { |
There was a problem hiding this comment.
why can we check suffix and path together in single loop ?
5355fe1 to
0878653
Compare
…cing
Enables selective syncing of file types with custom artifact paths under
a stages directory structure
Users can configure which file types (converted/chunks/embeddings) to sync
and customize their destination paths
Example usage in UnstructuredDataProduct spec:
destinationConfig:
artifacts:
- type: stage
name: documentProcessorConfig
path: processed-documents
- type: stage
name: chunksGeneratorConfig
path: chunks
- type: stage
name: vectorEmbeddingsGeneratorConfig
path: vector-embeddings
Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
0878653 to
aa1e161
Compare
Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
| var extractedPrefix string | ||
| if idx := strings.LastIndex(filePathInFilestore, "/"); idx != -1 { | ||
| extractedPrefix = filePathInFilestore[:idx] | ||
| } | ||
|
|
There was a problem hiding this comment.
here we are extracting out the prefix using last '/'index , what if there is '/' in the file name ??????
can't we take dp name and prefix from CR and create the complete prefix???
Enables selective syncing of file types with custom artifact paths under
a stages directory structure
Users can configure which file types (converted/chunks/embeddings) to sync
and customize their destination paths
Example usage in UnstructuredDataProduct