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

[WIP] Download preload urls in the Preload constructor #5194

Merged
merged 4 commits into from
Aug 10, 2021

Conversation

marcosmoyano
Copy link
Contributor

  • Closes #xxxx
  • Tests added / passed
  • Passes black distributed / flake8 distributed / isort distributed

Follow up from: #5185

Go back to processes and waiting a bit until the process and the webserver are up.

I'll leave #5185 open for a bit and try to figure out what's the difference between the environments.

@marcosmoyano
Copy link
Contributor Author

/cc @mrocklin finally some progress. It only failed in macos-latest, 3.7 which makes me think that the tests are good and there's something flaky with that particular env. Thoughts?

@mrocklin
Copy link
Member

Let's try adding a longer timeout?

@mrocklin
Copy link
Member

Nope. Still a problem.

@marcosmoyano
Copy link
Contributor Author

hhhmmm 😞 that's the only env where these tests are failing. Unfortunately I don't have much macos experience to know what's going on here. I'll keep looking later today.

@mrocklin
Copy link
Member

mrocklin commented Aug 10, 2021 via email

@marcosmoyano
Copy link
Contributor Author

That seemed to have done it. The failing tests don't look related to my changes.

@mrocklin mrocklin merged commit ac55f25 into dask:main Aug 10, 2021
@@ -119,13 +119,14 @@ def _import_module(name, file_dir=None) -> ModuleType:
return module


async def _download_module(url: str) -> ModuleType:
def _download_module(url: str) -> ModuleType:
Copy link
Member

Choose a reason for hiding this comment

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

Apologies for being late to the party. Could you elaborate a bit more on why this change was needed? My guess is there was a use case where we wanted the preload to be downloaded before starting up a worker or nanny. But I personally would find a little more explanation for this change useful

Copy link
Member

Choose a reason for hiding this comment

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

Preloads have actions that happen on ...

  1. Import
  2. Setup
  3. Teardown

Except if the preload is a web preload, in which case the import happens at start. It's an odd exception that this PR removes.

For the practical use case this has to do with workers asking another service what the scheduler address is when they start up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Matt for the quick reply. I definitely need to do a better job adding context to my PRs ☹️. I apologize @jrbourbeau that's my fault.

Copy link
Member

Choose a reason for hiding this comment

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

No worries @marcosmoyano! Thanks for the additional details @mrocklin

@jrbourbeau
Copy link
Member

jrbourbeau commented Aug 10, 2021

This PR implicitly adds urllib3 as a dependency to distributed. @marcosmoyano is that necessary, or just for convenience? I'm wondering if there's something in standard library, or one of our existing dependencies, we can use instead.

xref this CI build over in dask/dask where this came up

@marcosmoyano
Copy link
Contributor Author

is that necessary, or just for convenience? I'm wondering if there's something in standard library, or one of our existing dependencies, we can use instead.

it was just for convenience. I'm sorry I thought urllib3 was already a dependency. I'll create a quick PR using urllib instead

@jrbourbeau
Copy link
Member

That would be great, thank you @marcosmoyano!

mrocklin pushed a commit that referenced this pull request Aug 11, 2021
We accidentally introduced urllib3 as a dependency in #5194. This PR fixes that mistake.
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

3 participants