Closed hayesgb closed 2 years ago
Oh wow. Prefect 2.0 has some pretty big changes.
And yeah, even their docs only show installation via some form a pip (conda is mentioned, but not demonstrated).
Trying to upgrade my own conda env, I get:
Encountered problems while solving:
- nothing provides asgi-lifespan >=1.0 needed by prefect-2.0.1-pyhd8ed1ab_1
I think there is a problem with the prefect 2.0 conda package itself already
conda create -n prefect2.0 prefect=2.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError:
Note that strict channel priority may have removed packages required for satisfiability.
If we try a solve with, e.g. dask
conda create -n prefect2.0 prefect=2.0 dask
prefect=2.0 -> aiofiles[version='>=0.7.0'] -> python[version='>=2.6|>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.6|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.8,<3.9.0a0|>=3.6.1|>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*|>=3|>=3.6.2|>=2.7',build=*_cpython]
prefect=2.0 -> python[version='>=3.7']
It appears that prefect already has an internal conflict with aiofiles
. Not sure if some of this pinning spaghetti is the cause or the build=*_cpython
flag. Not familiar with conda sufficiently to tell.
With fully pip'd environment I reproduce the error with:
if __name__ == "__main__"
The example runs correctly if you use a distributed.LocalCluster
instead of a coiled cluster.
n.b. user has temporary workaround:
import asyncio
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
client = Client(coiled.Cluster(name=some_cluster_name))
Root cause is probably similar to https://github.com/coiled/feedback/issues/173.
Yeah cause of this seems to be a weird situation where starting the cloud
object does not end up creating an event loop attached to the current thread. @graingert 's MR I think should handle it adequately
@FabioRosado @graingert this is resolved now, right?
Yes this is resolved and released on the latest Coiled version.
Anyone using an older version might still see this issue but I think we can close it for now?
Describe the bug A user reported:
@task def test_cluster(): cluster = coiled.Cluster(n_workers=2,...) cluster.close()
@flow def t_c(): test_cluster()
t_c()
File "/tmp/ipykernel_25136/1775350701.py", line 8, in test_cluster cluster = coiled.Cluster(n_workers=2,software="fugue-env") File "/usr/local/lib/python3.8/site-packages/coiled/_beta/cluster.py", line 228, in init self._requested_or_fetched_cluster = asyncio.Event() File "/usr/local/lib/python3.8/asyncio/locks.py", line 260, in init self._loop = events.get_event_loop() File "/usr/local/lib/python3.8/asyncio/events.py", line 639, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.'