Support Dask 2.0 (#4617)

This commit is contained in:
Philip Hyunsu Cho 2019-06-27 20:42:35 -07:00 committed by GitHub
parent 923e6c86ba
commit a30176907f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -91,7 +91,11 @@ def create_worker_dmatrix(*args, **kwargs):
def _run_with_rabit(rabit_args, func, *args):
os.environ["OMP_NUM_THREADS"] = str(distributed_get_worker().ncores)
worker = distributed_get_worker()
try:
os.environ["OMP_NUM_THREADS"] = str(worker.ncores)
except AttributeError:
os.environ["OMP_NUM_THREADS"] = str(worker.nthreads)
try:
rabit.init(rabit_args)
result = func(*args)

View File

@ -24,7 +24,7 @@ RUN \
pip install pyyaml cpplint pylint astroid sphinx numpy scipy pandas matplotlib sh recommonmark guzzle_sphinx_theme mock \
breathe matplotlib graphviz pytest scikit-learn wheel kubernetes urllib3 && \
pip install https://h2o-release.s3.amazonaws.com/datatable/stable/datatable-0.7.0/datatable-0.7.0-cp37-cp37m-linux_x86_64.whl && \
conda install dask
conda install dask=2.0.0
# Install lightweight sudo (not bound to TTY)
RUN set -ex; \

View File

@ -17,7 +17,7 @@ ENV PATH=/opt/python/bin:$PATH
# Install Python packages
RUN \
pip install numpy pytest scipy scikit-learn pandas matplotlib wheel kubernetes urllib3 graphviz && \
conda install dask
conda install dask=2.0.0
ENV GOSU_VERSION 1.10