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

Create credentials upload plugins for GCP and AWS (#438) #439

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbalabka
Copy link
Contributor

@dbalabka dbalabka commented Oct 4, 2024

We recently started using Dask in GCP, and our in-house Kubernetes was deployed using Rancher. Using Dask locally is relatively straightforward, while deploying it remotely to the cloud or K8s has some difficulties.

I found out that sharing GCP and AWS credentials with remote workers is not easy, and there are a lot of questions about how to do it the right way. In #430 PR, I've improved the credentials workflow for GCP by allowing using Application Default Credentials (see ticket #429). The following PR is focused on enhancing the DX by providing plugins that automatically share keys with remote workers. It allows workers to read/write data from S3/GCS.

Todo

  • Add tests
  • Add documentation

Copy link
Contributor Author

@dbalabka dbalabka left a comment

Choose a reason for hiding this comment

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

I need to improve the code some. I will get back to it 😀


from distributed import WorkerPlugin

logger = logging.getLogger(__name__)
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 have to add some logging for the visibility of the fact that file has been uploaded

logger = logging.getLogger(__name__)

class UploadGCPKey(WorkerPlugin):
"""Automatically upload a GCP key to the worker."""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to add more context about why we need to upload the key from the laptop.

"""
Initialize the plugin by reading in the data from the given file.
"""
config_path = os.getenv("AWS_CONFIG_FILE", Path.home() / Path(".aws/config"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should why upload the complete config?

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

Overall this seems like a great addition. This definitely needs some testing and documentation (see the Azure spot termination plugin for an example of how we documented that).

I'm marking this as a draft as it looks like you still intend to do more work here. Give me a ping when this is ready for review.

@jacobtomlinson jacobtomlinson marked this pull request as draft March 3, 2025 09:52
@dbalabka
Copy link
Contributor Author

dbalabka commented Mar 3, 2025

@jacobtomlinson, thanks for a good reference code. I will let you know when it can be reviewed.

Linking the Azure plugging PR here: #251

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.

2 participants