Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 committed Dec 19, 2024
1 parent a14388f commit c7e1f63
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions warehouse/metrics_tools/compute/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ async def start_duckdb_cluster_async(
a thread. The "async" version of dask's KubeCluster doesn't work as
expected. So for now we do this."""

options: t.Dict[str, t.Any] = {
"namespace": namespace,
}
options.update(kwargs)
if cluster_spec:
options["custom_cluster_spec"] = cluster_spec
worker_command = ["dask", "worker"]
resources_to_join = []

Expand All @@ -71,6 +65,14 @@ async def start_duckdb_cluster_async(
resources_str = f'{",".join(resources_to_join)}'
worker_command.extend(["--resources", resources_str])

options: t.Dict[str, t.Any] = {
"namespace": namespace,
"worker_command": worker_command,
}
options.update(kwargs)
if cluster_spec:
options["custom_cluster_spec"] = cluster_spec

# loop = asyncio.get_running_loop()
cluster = await KubeCluster(asynchronous=True, **options)
adapt_response = cluster.adapt(minimum=min_size, maximum=max_size)
Expand Down

0 comments on commit c7e1f63

Please sign in to comment.