Skip to content

Manually set name of Worker [in dask-jobqueue] #7070

Answered by jmuchovej
jmuchovej asked this question in Q&A
Discussion options

You must be logged in to vote

NOTE: Following dask/dask-jobqueue#480, the following will work: #7070 (reply in thread).


To be clear, the solution I found was the following:

  • Create a custom class based on JobQueueCluster, like the following:
     class JobArrayCluster(JobQueueCluster):
        __doc__ = <Batch>Cluster.__doc__
        job_cls = <Batch>Cluster.job_cls
    
        def _new_worker_name(self, worker_number):
            """Overriding ``SpecCluster._new_worker_name`` to provide unique names across `n_jobs * len(jobArray)`."""
            return f"{self._name}-{worker_number}"
  • Pass a name into JobArrayCluster like the following: project-${JOB_ID} (the ${JOB_ID} is the important bit).
  • Modify your job_extra to include the syntax for s…

Replies: 3 comments 12 replies

Comment options

You must be logged in to vote
2 replies
@jmuchovej
Comment options

@jmuchovej
Comment options

Comment options

You must be logged in to vote
4 replies
@lesteve
Comment options

@jmuchovej
Comment options

@lesteve
Comment options

@lesteve
Comment options

Answer selected by jmuchovej
Comment options

You must be logged in to vote
6 replies
@lesteve
Comment options

@jmuchovej
Comment options

@lesteve
Comment options

@jmuchovej
Comment options

@lesteve
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants