Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYNPY-1356] Refactor sync to synapse #1083

Merged
merged 145 commits into from
May 14, 2024

Conversation

BryanFauble
Copy link
Contributor

@BryanFauble BryanFauble commented Apr 10, 2024

Problem:

  1. The syncToSynapse function provided in the utility package had it's own multi-threaded implementation to allow the upload of files in parallel. Using this it had a shared thread pool executor with the file part upload as well.

Solution:

  1. This PR contains the changes that were independently reviewed in these 2 PRs:
  2. [SYNPY-1356] Moving file semaphore under file store #1084
  3. [SYNPY-1356] Updating syncToSynapse file dependency saving logic #1089
  4. Conversion of the multi-threaded portion of the syncToSynapse code to instead rely on asyncIO tasks/futures - Meaning all of the code is going to be executed in a single thread and only down the line will parts of files be uploaded in parallel on different threads.

Testing:

  1. Planning to use the benchmark upload script in addition to integration testing around this logic.

@pep8speaks
Copy link

pep8speaks commented Apr 10, 2024

Hello @BryanFauble! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 149:89: E501 line too long (89 > 88 characters)

Line 710:89: E501 line too long (89 > 88 characters)
Line 1193:89: E501 line too long (91 > 88 characters)

Line 206:89: E501 line too long (117 > 88 characters)

Comment last updated at 2024-05-14 02:00:36 UTC

synapseutils/sync.py Outdated Show resolved Hide resolved
synapseutils/sync.py Outdated Show resolved Hide resolved
synapseutils/sync.py Outdated Show resolved Hide resolved
synapseutils/sync.py Outdated Show resolved Hide resolved
synapseutils/sync.py Outdated Show resolved Hide resolved
Base automatically changed from SYNPY-1456-flaky-integration-tests to develop April 10, 2024 23:21
synapseutils/sync.py Outdated Show resolved Hide resolved
@BryanFauble BryanFauble marked this pull request as ready for review May 13, 2024 17:27
@BryanFauble BryanFauble requested a review from a team as a code owner May 13, 2024 17:27
@BryanFauble BryanFauble changed the title DRAFT: [SYNPY-1356] Refactor sync to synapse [SYNPY-1356] Refactor sync to synapse May 13, 2024
@@ -814,6 +816,7 @@ async def change_metadata_async(
"""
if not self.id:
raise ValueError("The file must have an ID to change metadata.")
from synapseutils.copy_functions import changeFileMetaData
Copy link
Member

Choose a reason for hiding this comment

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

For future PR: Should these just be internal client functions instead of synapseutils?

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 Nice! The bulk of the reviews came through the other PRs.



@contextmanager
def shared_progress_bar(progress_bar):
Copy link
Member

Choose a reason for hiding this comment

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

Will this only be used in the multi part upload?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now - Yes. I may extract this with changing how downloads are working.

* Cleaning up code and provding benchmarking results
@BryanFauble BryanFauble merged commit be9f166 into develop May 14, 2024
1 of 3 checks passed
@BryanFauble BryanFauble deleted the SYNPY-1356-refactor-sync-to-synapse branch May 14, 2024 02:01
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.

None yet

5 participants