Skip to content

Commit

Permalink
ensure extra_bootstrap works from cloudconfig (#341)
Browse files Browse the repository at this point in the history
* ensure extra_bootstrap works from cloudconfig

* Bump precommit hooks

Co-authored-by: Guillaume Collot <guillaume.collot@airbus.com>
Co-authored-by: Jacob Tomlinson <jtomlinson@nvidia.com>
  • Loading branch information
3 people committed Apr 14, 2022
1 parent 101b774 commit a6249fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
language_version: python3
exclude: versioneer.py
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.2
hooks:
- id: flake8
language_version: python3
2 changes: 1 addition & 1 deletion dask_cloudprovider/aws/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def aws_to_dict(aws_dict):
# https://aws.amazon.com/blogs/messaging-and-targeting/how-to-handle-a-throttling-maximum-sending-rate-exceeded-error/
def get_sleep_duration(current_try, min_sleep_millis=10, max_sleep_millis=5000):
current_try = max(1, current_try)
current_sleep_millis = min_sleep_millis * current_try ** 2
current_sleep_millis = min_sleep_millis * current_try**2
return min(current_sleep_millis, max_sleep_millis) / 1000 # return in seconds


Expand Down
3 changes: 3 additions & 0 deletions dask_cloudprovider/gcp/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ def __init__(
self.scheduler_options = {**self.options}
self.worker_options = {**self.options}

if "extra_bootstrap" not in kwargs:
kwargs["extra_bootstrap"] = self.config.get("extra_bootstrap")

super().__init__(debug=debug, **kwargs)


Expand Down

0 comments on commit a6249fc

Please sign in to comment.