Giter Club home page Giter Club logo

Comments (10)

ericgyounkin avatar ericgyounkin commented on July 17, 2024 1

@epifanio Oh, I see now. Get_client will automatically resolve that port for you, if it detects the local scheduler. But I can certainly add that option to the LocalCluster initialization for you, and expose it in the dialog. That should be a simple change. I can do a new pull request tonight for that change.

from kluster.

ericgyounkin avatar ericgyounkin commented on July 17, 2024 1

@epifanio ok cool, I'll be interested to hear how that goes. I've changed jobs recently, which is why you haven't seen much activity here lately. But I'm still invested, so keep in touch with the results!

from kluster.

ericgyounkin avatar ericgyounkin commented on July 17, 2024

Hi @epifanio,

Thanks for your interest and all the commits! I do this already in the dask client

image

which runs dask_find_or_start_client with the IP:PORT string.

The docs aren't clear (I should probably update), but you can pass anything that dask get_client accepts.

You can pass around a client in the API as follows:

from HSTB.kluster.dask_helpers import dask_find_or_start_client
from HSTB.kluster.fqpr_intelligence import intel_process

cl = dask_find_or_start_client(address='192.168.0.1:6454', number_of_workers=4)
intel_process(r'multibeam_file_path', outfold='destination_path')

I haven't used the client this way yet, so if you run into issues, let me know.

from kluster.

epifanio avatar epifanio commented on July 17, 2024

ok, didn't see that settings - this means I can expose a port on the docker file and then use that one in the UI - that should work, thanks!

from kluster.

epifanio avatar epifanio commented on July 17, 2024

@ericgyounkin those highlighted settings are made to attach the processing to an existing dusk cluster and not to spin a local one - is that correct?
I am trying to spin a new cluster on the container, but using a user-provided port instead of a random one - this way I can expose that port and have access to the dask cluster (which runs in docker) from the browser on the host machine.

like, having an entry: PORT: ____ in the Local Cluster settings

from kluster.

ericgyounkin avatar ericgyounkin commented on July 17, 2024

@epifanio

Highlighted settings are for a remote cluster, yes. You use the LocalCluster to setup a Dask distributed instance on your computer.

It needs to align with the get_client API, so I believe in that instance you would use something like '127.0.0.1:PORT' as the address. Basically, you need to provide some kind of address I believe for the port to be accessable.

from kluster.

epifanio avatar epifanio commented on July 17, 2024

@ericgyounkin , thanks for your reply

What I was looking for is a way to access the "local cluster" which starts on the containerized app - at the moment I can spin the local cluster and I can see in the kluster logs the following:

2022-09-09 12:05:48,245 - INFO - Starting local cluster client...
2022-09-09 12:05:49,726 - INFO - <Client: 'tcp://127.0.0.1:43579' processes=4 threads=8, memory=15.58 GiB>

which means the dask cluster is up and running, but is not accessible from outside the container because the PORT used is chosen randomnly - we need the PORT to be configurable also for the local cluster, so we can expose it in the docker configuration :)

I am looking on how to pass the PORT as argument to the dask api - when the cluster is initialized so that get_client() will return the localhost:$PORT

from kluster.

ericgyounkin avatar ericgyounkin commented on July 17, 2024

@epifanio Unfortunately there seems to be a bug in the version of Dask that we currently use in Kluster. If we set the scheduler port in LocalCluster

cl = LocalCluster(scheduler_port='53647')

We get an error based on how it parses the default address. I checked and the bug is resolved in the latest dask.distributed (committed June 2022)

https://github.com/dask/distributed/blob/main/distributed/comm/addressing.py#L201

But I don't think we'll be updating the library used in Kluster in the short term. So I'm not sure how to support this.

from kluster.

epifanio avatar epifanio commented on July 17, 2024

I see, that is unfortunate but I understand -
As a back-up solution, I may try to add an additional container in the docker-compose just for dask, spin it at runtime and then try to attach the GUI to it.

from kluster.

epifanio avatar epifanio commented on July 17, 2024

Hi, @ericgyounkin I am back on kluster :) I tested a docker-compose environment which seems to work as expected but I need t run some testing ' will try to post it here when ready.

from kluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.