Skip to content

Optimization and fix of file execution - parallel execution#1326

Merged
chandrasekharan-zipstack merged 14 commits into
mainfrom
fix/duplicate-file-hash-for-api-deployement
May 27, 2025
Merged

Optimization and fix of file execution - parallel execution#1326
chandrasekharan-zipstack merged 14 commits into
mainfrom
fix/duplicate-file-hash-for-api-deployement

Conversation

@muhammad-ali-e

@muhammad-ali-e muhammad-ali-e commented May 21, 2025

Copy link
Copy Markdown
Contributor

What

  • UN-2410
  • Skips processing of duplicate input files based on file hash , even if the file names differ.
  • Catches and handles unknown exceptions during file processing initialization ( this is a safety net for scenarios that shouldn't normally occur.).
  • Uses file hashes from fsspec metadata (instead of computing content hashes) for source connectors during file listing (ETL/TASK).
  • Optimizes file listing by reducing multiple fsspec API calls—now uses a single listdir call to retrieve metadata more efficiently.
  • Updates the Google Drive connector to use fsspec metadata for file hashes (the checksum field).

Why

  • Prevents reprocessing the same file content uploaded under different names, avoiding redundant or unnecessary file execution.
  • Improves performance and reliability of file listing, especially for cloud-based sources.

How

  • Deduplication logic is based on file hash obtained from metadata or content hash

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No

Database Migrations

Env Config

Relevant Docs

Related Issues or PRs

Dependencies Versions

Notes on Testing

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

Comment thread backend/workflow_manager/endpoint_v2/source.py Outdated
Comment thread backend/workflow_manager/endpoint_v2/source.py Outdated
Comment thread backend/workflow_manager/workflow_v2/file_execution_tasks.py Outdated
@muhammad-ali-e muhammad-ali-e changed the title skip the duplicates when list files by hash Optimizationand fix of file execution - parallel execution May 22, 2025
@muhammad-ali-e muhammad-ali-e changed the title Optimizationand fix of file execution - parallel execution Optimization and fix of file execution - parallel execution May 22, 2025
Comment thread backend/workflow_manager/endpoint_v2/source.py
Comment thread backend/workflow_manager/utils/workflow_log.py

@gaya3-vijayakumar gaya3-vijayakumar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Quick glance.

@github-actions

Copy link
Copy Markdown
Contributor
filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_for\_sidecar}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_sidecar\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{11}}$$ $$\textcolor{#23d18b}{\tt{11}}$$

@sonarqubecloud

Copy link
Copy Markdown

@chandrasekharan-zipstack chandrasekharan-zipstack merged commit 472e725 into main May 27, 2025
5 checks passed
@chandrasekharan-zipstack chandrasekharan-zipstack deleted the fix/duplicate-file-hash-for-api-deployement branch May 27, 2025 08:42
pk-zipstack pushed a commit that referenced this pull request Aug 20, 2025
* skip the duplicates when list files by hash

* refactored _get_matched_files method to reduce complexity

* remove making of content filehash from the source list files

* reduce complexity of get_matched_files methode

* added file limit log to viisbility for debugging

* added one more logs while starting file process

* added logs, removed unrequired pass, updated filehistory condition

---------

Co-authored-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants