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-1320] Upload benchmark + Documentation #1012

Merged
merged 8 commits into from
Nov 16, 2023

Conversation

BryanFauble
Copy link
Contributor

Problem:

  1. OTEL context propagation was broken due to the custom threading in the sync functions
  2. We did not have upload benchmarks documented
  3. Documentation in the README was lacking for programmatic access

Solution:

  1. Propagate the OTEL context into the syn.store function
  2. Create documentation in the benchmarking rst
  3. Add some examples to the README that talk over some common use-cases for file/folder/project creation

Testing:

  1. I ran and collected the benchmark information on EC2

@BryanFauble BryanFauble requested a review from a team as a code owner November 14, 2023 22:26
@pep8speaks
Copy link

pep8speaks commented Nov 14, 2023

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

Line 1252:89: E501 line too long (114 > 88 characters)
Line 1253:89: E501 line too long (110 > 88 characters)
Line 1314:89: E501 line too long (96 > 88 characters)
Line 1331:89: E501 line too long (96 > 88 characters)
Line 1368:89: E501 line too long (90 > 88 characters)
Line 1404:89: E501 line too long (95 > 88 characters)
Line 1438:89: E501 line too long (109 > 88 characters)
Line 1480:89: E501 line too long (110 > 88 characters)
Line 1481:89: E501 line too long (106 > 88 characters)
Line 1508:89: E501 line too long (89 > 88 characters)
Line 1512:89: E501 line too long (95 > 88 characters)

Comment last updated at 2023-11-16 17:56:42 UTC

newObj = self.restGET(obj.getByNameURI(obj.name))
newObj.update(obj)
obj = type(obj)(**newObj)
with tracer.start_as_current_span(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding this with is the only real change here - The sync functions multi-thread at this point and OTEL context was not propagating

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind adding the explanation of opentelemetry_context parameter in the function docstring?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
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.

🔥 Looks great to me! I'm going to pre-approve.

I do realize we've baked in otel contexts throughout the code which adds a layer of nesting sometimes which is ok. In the beginning, I was wondering if there was a way for that code to exist without the opentel packages installed (so we don't always require the dependency) but this is great.

@BryanFauble
Copy link
Contributor Author

I do realize we've baked in otel contexts throughout the code which adds a layer of nesting sometimes which is ok. In the beginning, I was wondering if there was a way for that code to exist without the opentel packages installed (so we don't always require the dependency) but this is great.

Yeah I agree with you here - Unfortunately the way we are doing manually instrumenting the client + the way multi-threading is set up leading to some less than savory code. Fortunately with all testing I've done with asyncio - This kind of context propagation is no longer required.

README.md Outdated
```

#### Sync a local directory to synapse
This is the recommended way of synchronizing more than one file or directory to a synapse project is through the use of `synapseutils`. Using this library let's us handle scheduling everything required to sync an entire directory tree. Read more about the manifest file format in [`synapseutils.syncToSynapse`](https://python-docs.synapse.org/build/html/articles/synapseutils.html#synapseutils.sync.syncToSynapse)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: could you rephrase this sentence? It has two verbs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified this slightly - Let me know if this new version sounds better:

This is the recommended way of synchronizing more than one file or directory to a synapse project through the use of synapseutils. Using this library allows us to handle scheduling everything required to sync an entire directory tree. Read more about the manifest file format in synapseutils.syncToSynapse

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks great!

@danlu1
Copy link
Contributor

danlu1 commented Nov 16, 2023

Thanks for working on this. I approved the PR.

@BryanFauble BryanFauble merged commit fc865fd into develop Nov 16, 2023
31 of 32 checks passed
@BryanFauble BryanFauble deleted the SYNPY-1320-benchmark-uploads branch May 8, 2024 18:55
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

4 participants