coiled 1.111.5.dev2__tar.gz → 1.111.5.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/PKG-INFO +1 -1
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/software_utils.py +14 -7
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/cluster.py +39 -35
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/core.py +18 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/.gitignore +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/LICENSE +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/README.md +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/__main__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/analytics.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/auth.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/batch.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/capture_environment.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/batch/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/batch/list.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/batch/logs.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/batch/run.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/batch/status.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/batch/wait.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/azure_logs.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/better_logs.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/crud.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/get_address.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/list.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/logs.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/metrics.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/ssh.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/cluster/utils.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/config.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/core.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/curl.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/diagnostics.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/env.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/examples/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/examples/exit.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/examples/hello_world.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/examples/nyc_parquet.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/examples/pytorch.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/examples/xarray_nwm.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/hello.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/scripts/fill_ipython.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/scripts/nyc_parquet.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/scripts/pytorch.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/scripts/xarray_nwm.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/hello/utils.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/login.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/notebook/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/notebook/notebook.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/package_sync.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/prefect.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/prefect_serve.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/run.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/amp.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/aws.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/azure.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/entry.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/gcp.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/prometheus.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/setup/util.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/sync.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cli/utils.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/cluster.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/coiled.yaml +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/compatibility.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/config.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/context.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/core.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/credentials/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/credentials/aws.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/credentials/google.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/errors.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/exceptions.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/extensions/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/extensions/prefect/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/extensions/prefect/runners.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/extensions/prefect/workers.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/function.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/plugins.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/prefect.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/pypi_conda_map.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/scan.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/software.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/spans.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/spark.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/types.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/utils.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/cwi_log_link.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/states.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/widgets/__init__.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/widgets/interface.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/widgets/rich.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/v2/widgets/util.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/coiled/websockets.py +0 -0
- {coiled-1.111.5.dev2 → coiled-1.111.5.dev4}/pyproject.toml +0 -0
|
@@ -739,18 +739,23 @@ def set_auth_for_url(url: Url | str) -> str:
|
|
|
739
739
|
netloc = parsed_url.netloc or ""
|
|
740
740
|
|
|
741
741
|
if not password:
|
|
742
|
+
use_netrc = dask.config.get("coiled.package_sync.conda.cred_sources.netrc", True)
|
|
743
|
+
use_keyring = dask.config.get("coiled.package_sync.conda.cred_sources.keyring", True)
|
|
744
|
+
use_conda_auth = dask.config.get("coiled.package_sync.conda.cred_sources.conda", True)
|
|
745
|
+
use_mamba_auth = dask.config.get("coiled.package_sync.conda.cred_sources.mamba", True)
|
|
746
|
+
|
|
742
747
|
no_auth_url = parsed_url._replace(auth=None).url
|
|
743
748
|
auth_parts = (
|
|
744
749
|
# get_netrc_auth takes a URL, but only uses the netloc part
|
|
745
|
-
get_netrc_auth(no_auth_url)
|
|
750
|
+
(get_netrc_auth(no_auth_url) if use_netrc else None)
|
|
746
751
|
# keyring could have URL stored by full URL or netloc
|
|
747
|
-
or
|
|
748
|
-
|
|
752
|
+
or (
|
|
753
|
+
(get_keyring_auth(no_auth_url, username) or get_keyring_auth(netloc, username)) if use_keyring else None
|
|
754
|
+
)
|
|
749
755
|
# conda-auth stores things in keyring in its own format
|
|
750
|
-
or get_conda_auth(no_auth_url)
|
|
756
|
+
or (get_conda_auth(no_auth_url) if use_conda_auth else None)
|
|
751
757
|
# mamba could have URL stored by netloc/path or netloc
|
|
752
|
-
or get_mamba_auth(f"{netloc}{path}")
|
|
753
|
-
or get_mamba_auth(netloc)
|
|
758
|
+
or ((get_mamba_auth(f"{netloc}{path}") or get_mamba_auth(netloc)) if use_mamba_auth else None)
|
|
754
759
|
)
|
|
755
760
|
if auth_parts is not None:
|
|
756
761
|
username, password = auth_parts
|
|
@@ -778,7 +783,9 @@ NETRC_FILES = (".netrc", "_netrc")
|
|
|
778
783
|
def get_netrc_auth(url: str, raise_errors=False) -> tuple[str | None, str | None] | None:
|
|
779
784
|
"""Returns the Requests tuple auth for a given url from netrc."""
|
|
780
785
|
|
|
781
|
-
|
|
786
|
+
# If dask config is set, then the default netrc locations won't be used at all, but env var
|
|
787
|
+
# takes precedence over dask config if both are set.
|
|
788
|
+
netrc_file = os.environ.get("NETRC") or dask.config.get("coiled.package_sync.conda.netrc_path", None)
|
|
782
789
|
if netrc_file is not None:
|
|
783
790
|
netrc_locations = (netrc_file,)
|
|
784
791
|
else:
|
|
@@ -537,6 +537,45 @@ class Cluster(DistributedCluster, Generic[IsAsynchronous]):
|
|
|
537
537
|
batch_job_container: str | None = None,
|
|
538
538
|
pause_on_exit: bool | None = None,
|
|
539
539
|
):
|
|
540
|
+
self.init_time = datetime.datetime.now(tz=datetime.timezone.utc)
|
|
541
|
+
type(self)._instances.add(self)
|
|
542
|
+
|
|
543
|
+
# Determine consistent sync/async
|
|
544
|
+
if cloud and asynchronous is not None and cloud.asynchronous != asynchronous:
|
|
545
|
+
warnings.warn(
|
|
546
|
+
f"Requested a Cluster with asynchronous={asynchronous}, but "
|
|
547
|
+
f"cloud.asynchronous={cloud.asynchronous}, so the cluster will be"
|
|
548
|
+
f"{cloud.asynchronous}",
|
|
549
|
+
stacklevel=2,
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
asynchronous = cloud.asynchronous
|
|
553
|
+
|
|
554
|
+
self.scheduler_comm: dask.distributed.rpc | None = None
|
|
555
|
+
|
|
556
|
+
# It's annoying that the user must pass in `asynchronous=True` to get an async Cluster object
|
|
557
|
+
# But I can't think of a good alternative right now.
|
|
558
|
+
self.cloud: CloudV2SyncAsync = cloud or CloudV2.current(asynchronous=asynchronous)
|
|
559
|
+
|
|
560
|
+
if configure_logging:
|
|
561
|
+
setup_logging()
|
|
562
|
+
|
|
563
|
+
if configure_logging is None:
|
|
564
|
+
# setup logging only if we're not using the widget
|
|
565
|
+
if not (custom_widget or use_rich_widget()):
|
|
566
|
+
setup_logging()
|
|
567
|
+
|
|
568
|
+
# we really need to call this first before any of the below code errors
|
|
569
|
+
# out; otherwise because of the fact that this object inherits from
|
|
570
|
+
# deploy.Cloud __del__ (and perhaps __repr__) will have AttributeErrors
|
|
571
|
+
# because the gc will run and attributes like `.status` and
|
|
572
|
+
# `.scheduler_comm` will not have been assigned to the object's instance
|
|
573
|
+
# yet
|
|
574
|
+
super().__init__(asynchronous=asynchronous, loop=self.cloud.loop)
|
|
575
|
+
|
|
576
|
+
# control-plane can override dask config settings per user/workspace/org
|
|
577
|
+
self.cloud.load_server_dask_config(workspace=account or workspace)
|
|
578
|
+
|
|
540
579
|
self._cluster_event_queue = []
|
|
541
580
|
|
|
542
581
|
# default range for adaptive (defining these here so pyright doesn't complain about ref before assignment)
|
|
@@ -593,8 +632,6 @@ class Cluster(DistributedCluster, Generic[IsAsynchronous]):
|
|
|
593
632
|
# NOTE:
|
|
594
633
|
# this attribute is only updated while we wait for cluster to come up
|
|
595
634
|
self.errored_worker_count: int = 0
|
|
596
|
-
self.init_time = datetime.datetime.now(tz=datetime.timezone.utc)
|
|
597
|
-
type(self)._instances.add(self)
|
|
598
635
|
|
|
599
636
|
senv_kwargs = {
|
|
600
637
|
"package_sync": package_sync,
|
|
@@ -683,39 +720,6 @@ class Cluster(DistributedCluster, Generic[IsAsynchronous]):
|
|
|
683
720
|
)
|
|
684
721
|
backend_options["region_name"] = region
|
|
685
722
|
|
|
686
|
-
if configure_logging:
|
|
687
|
-
setup_logging()
|
|
688
|
-
|
|
689
|
-
if configure_logging is None:
|
|
690
|
-
# setup logging only if we're not using the widget
|
|
691
|
-
if not (custom_widget or use_rich_widget()):
|
|
692
|
-
setup_logging()
|
|
693
|
-
|
|
694
|
-
# Determine consistent sync/async
|
|
695
|
-
if cloud and asynchronous is not None and cloud.asynchronous != asynchronous:
|
|
696
|
-
warnings.warn(
|
|
697
|
-
f"Requested a Cluster with asynchronous={asynchronous}, but "
|
|
698
|
-
f"cloud.asynchronous={cloud.asynchronous}, so the cluster will be"
|
|
699
|
-
f"{cloud.asynchronous}",
|
|
700
|
-
stacklevel=2,
|
|
701
|
-
)
|
|
702
|
-
|
|
703
|
-
asynchronous = cloud.asynchronous
|
|
704
|
-
|
|
705
|
-
self.scheduler_comm: dask.distributed.rpc | None = None
|
|
706
|
-
|
|
707
|
-
# It's annoying that the user must pass in `asynchronous=True` to get an async Cluster object
|
|
708
|
-
# But I can't think of a good alternative right now.
|
|
709
|
-
self.cloud: CloudV2SyncAsync = cloud or CloudV2.current(asynchronous=asynchronous)
|
|
710
|
-
|
|
711
|
-
# we really need to call this first before any of the below code errors
|
|
712
|
-
# out; otherwise because of the fact that this object inherits from
|
|
713
|
-
# deploy.Cloud __del__ (and perhaps __repr__) will have AttributeErrors
|
|
714
|
-
# because the gc will run and attributes like `.status` and
|
|
715
|
-
# `.scheduler_comm` will not have been assigned to the object's instance
|
|
716
|
-
# yet
|
|
717
|
-
super().__init__(asynchronous=asynchronous, loop=self.cloud.loop)
|
|
718
|
-
|
|
719
723
|
self.timeout = timeout if timeout is not None else self.cloud.default_cluster_timeout
|
|
720
724
|
|
|
721
725
|
# Set cluster attributes from kwargs (first choice) or dask config
|
|
@@ -584,6 +584,24 @@ class CloudV2(OldCloud, Generic[IsAsynchronous]):
|
|
|
584
584
|
cert_status = response_json.get("status")
|
|
585
585
|
return cert_status
|
|
586
586
|
|
|
587
|
+
async def _load_server_dask_config(self, workspace: str | None = None):
|
|
588
|
+
workspace = workspace or self.default_workspace
|
|
589
|
+
response = await self._do_request(
|
|
590
|
+
"GET",
|
|
591
|
+
self.server + f"/api/v2/user/workspace/{workspace}/dask-config-overrides",
|
|
592
|
+
)
|
|
593
|
+
new_settings = await response.json()
|
|
594
|
+
dask.config.set(new_settings)
|
|
595
|
+
|
|
596
|
+
@overload
|
|
597
|
+
def load_server_dask_config(self: Cloud[Async], workspace: str | None = None): ...
|
|
598
|
+
|
|
599
|
+
@overload
|
|
600
|
+
def load_server_dask_config(self: Cloud[Sync], workspace: str | None = None): ...
|
|
601
|
+
|
|
602
|
+
def load_server_dask_config(self, workspace: str | None = None):
|
|
603
|
+
return self._sync(self._load_server_dask_config, workspace=workspace)
|
|
604
|
+
|
|
587
605
|
@track_context
|
|
588
606
|
async def _create_cluster(
|
|
589
607
|
self,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|