Comments (2)
Thanks for the info Jim, those sound like excellent suggestion.
We're making heavy use of PySpark at the moment so I managed to solve my problem by switching to a pandas_udf. They're simple but fairly restrictive. We may look at Dask again if pandas_udfs don't give us enough flexibility.
from dask-yarn.
Apologies for the slow response here. The issue is that scale
is a non-blocking operation. It schedules two new workers to be added to the cluster, but doesn't wait for them to be up. If you add:
Client.wait_for_workers(2)
before calling upload_file
, that would work. The downside with this approach is that it the files won't be added to workers that are added later (e.g. if you scale up your cluster later).
A more complicated, but also more robust approach would be to use a worker plugin (http://distributed.dask.org/en/latest/api.html#distributed.Client.register_worker_callbacks) to download code on worker startup. These are run for all existing and future workers, but would require you to write a function like:
def download_code_and_add_to_python_path():
...
client.register_worker_callbacks(setup=download_code_and_add_to_python_path)
Note that both of these features are only on the master branch of distributed, and haven't been released yet. If you want to try them out, you can install like:
pip install git+https://github.com/dask/distributed.git
Alternatively, you could do a less efficient but still sufficient wait using the current release:
def wait_for_workers(client, n):
while not client.scheduler_info()['workers'] >= n:
time.sleep(0.25)
from dask-yarn.
Related Issues (20)
- AWS EMR bootstrap script fails HOT 5
- Conda environment does not activate HOT 1
- Dask Scheduler host/port Not Written to Skein Key-Value Storage When YARN Application Restarts HOT 5
- Move default branch from "master" -> "main" HOT 1
- YarnCluster.shutdown() Won't Work on EMR, results in `concurrent.futures._base.CancelledError` HOT 1
- Verify that Read the Docs is building after master -> main HOT 7
- YarnCluster hangs HOT 11
- wait_for_workers got stuck when to create cluster but application failed on yarn HOT 3
- dask-yarn job fails with dumps_msgpack ImportError HOT 3
- register workers of scheduler are less than workers in dashborad HOT 1
- can't upload files HOT 2
- EMR 6.3.0 Bootstrap Action BOOTSTRAP_FAILURE : Python 3.9 support? HOT 3
- Application Failure When Submitting Dask-Yarn Model Inferencing Job Remotely
- FileNotFoundError: [Errno 2] No such file or directory: 'yarn' HOT 3
- Jupyter Notebook Cell Hangs after submitting job to remote EMR cluster
- distributed 2022.3.0 no more compatible with dask-yarn because of missing "status" attribute in YarnCluster HOT 7
- YarnCluster() does not initialize but runs indefinetly HOT 3
- AttributeError while running dask on amazon EMR. HOT 3
- .skein.sh: line 2: environment/bin/python: No such file or directory HOT 4
- Bootstrapping for 40min, when use the script. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dask-yarn.