@@ -58,8 +58,13 @@ pytask -n 2
5858pytask --parallel-backend loky
5959```
6060
61+ ``` {note}
62+ When you build a project using coiled, you will see a message after pytask's startup
63+ that coiled is creating the remote software environment which takes 1-2m.
64+ ```
65+
6166When you apply the {func}` @task <pytask.task> ` decorator to the task, make sure the
62- {func}` @coiled.function <coiled.function> ` decorator is applied first, or is closer to
67+ {func}` @coiled.function <coiled.function> ` decorator is applied first or is closer to
6368the function. Otherwise, it will be ignored. Add more arguments to the decorator to
6469configure the hardware and software environment.
6570
@@ -71,7 +76,7 @@ By default, {func}`@coiled.function <coiled.function>`
7176to the workload. It means that coiled infers from the number of submitted tasks and
7277previous runtimes, how many additional remote workers it should deploy to handle the
7378workload. It provides a convenient mechanism to scale without intervention. Also,
74- workers launched by {func}` @coiled.function <coiled.function> ` will shutdown quicker
79+ workers launched by {func}` @coiled.function <coiled.function> ` will shut down quicker
7580than a cluster.
7681
7782``` {seealso}
@@ -88,7 +93,8 @@ coiled. Usually, it is not necessary and you are better off using coiled's serve
8893functions.
8994
9095If you want to launch a cluster managed by coiled, register a function that builds an
91- executor using {class}` coiled.Cluster ` .
96+ executor using {class}` coiled.Cluster ` . Assign a name to the cluster to reuse it when
97+ you build your project again and the cluster has not been shut down.
9298
9399``` python
94100import coiled
@@ -98,7 +104,11 @@ from concurrent.futures import Executor
98104
99105
100106def _build_coiled_executor (n_workers : int ) -> Executor:
101- return coiled.Cluster(n_workers = n_workers).get_client().get_executor()
107+ return (
108+ coiled.Cluster(n_workers = n_workers, name = " coiled-project" )
109+ .get_client()
110+ .get_executor()
111+ )
102112
103113
104114registry.register_parallel_backend(ParallelBackend.CUSTOM , _build_coiled_executor)
@@ -109,3 +119,12 @@ Then, execute your workflow with
109119``` console
110120pytask --parallel-backend custom
111121```
122+
123+ ## Tips
124+
125+ When you are changing your project during executions and your cluster is still up and
126+ running, the local and the remote software environment can get out of sync. Then, you
127+ see errors in remote workers you have fixed locally.
128+
129+ A quick solution is to stop the cluster in the coiled dashboard and create a new one
130+ with the next ` pytask build ` .
0 commit comments