Skip to content

Commit 8f2694d

Browse files
committed
removed InternalClusterAuthentication
1 parent b68ee25 commit 8f2694d

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

packages/pytest-simcore/src/pytest_simcore/simcore_dask_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import distributed
1010
import pytest
1111
from distributed import Client
12-
from models_library.clusters import InternalClusterAuthentication, TLSAuthentication
12+
from models_library.clusters import ClusterAuthentication, TLSAuthentication
1313
from pydantic import AnyUrl
1414

1515
from .helpers.docker import get_service_published_port
@@ -72,7 +72,7 @@ def dask_backend_tls_certificates(
7272
@pytest.fixture
7373
def dask_scheduler_auth(
7474
dask_backend_tls_certificates: _TLSCertificates,
75-
) -> InternalClusterAuthentication:
75+
) -> ClusterAuthentication:
7676
return TLSAuthentication(
7777
tls_ca_file=dask_backend_tls_certificates.tls_ca_file,
7878
tls_client_cert=dask_backend_tls_certificates.tls_cert_file,

services/autoscaling/src/simcore_service_autoscaling/core/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
PortInt,
1212
VersionTag,
1313
)
14-
from models_library.clusters import InternalClusterAuthentication
14+
from models_library.clusters import ClusterAuthentication
1515
from models_library.docker import DockerLabelKey
1616
from pydantic import (
1717
AliasChoices,
@@ -193,9 +193,9 @@ class NodesMonitoringSettings(BaseCustomSettings):
193193

194194
class DaskMonitoringSettings(BaseCustomSettings):
195195
DASK_MONITORING_URL: AnyUrl = Field(
196-
..., description="the url to the osparc-dask-scheduler"
196+
..., description="the url to the dask-scheduler"
197197
)
198-
DASK_SCHEDULER_AUTH: InternalClusterAuthentication = Field(
198+
DASK_SCHEDULER_AUTH: ClusterAuthentication = Field(
199199
...,
200200
description="defines the authentication of the clusters created via clusters-keeper (can be None or TLS)",
201201
)

services/autoscaling/src/simcore_service_autoscaling/modules/auto_scaling_mode_computational.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from aws_library.ec2 import EC2InstanceData, EC2Tags, Resources
66
from fastapi import FastAPI
7-
from models_library.clusters import InternalClusterAuthentication
7+
from models_library.clusters import ClusterAuthentication
88
from models_library.docker import (
99
DOCKER_TASK_EC2_INSTANCE_TYPE_PLACEMENT_CONSTRAINT_KEY,
1010
DockerLabelKey,
@@ -37,7 +37,7 @@ def _scheduler_url(app: FastAPI) -> AnyUrl:
3737
return app_settings.AUTOSCALING_DASK.DASK_MONITORING_URL
3838

3939

40-
def _scheduler_auth(app: FastAPI) -> InternalClusterAuthentication:
40+
def _scheduler_auth(app: FastAPI) -> ClusterAuthentication:
4141
app_settings = get_application_settings(app)
4242
assert app_settings.AUTOSCALING_DASK # nosec
4343
return app_settings.AUTOSCALING_DASK.DASK_SCHEDULER_AUTH

services/autoscaling/src/simcore_service_autoscaling/modules/dask.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from aws_library.ec2 import EC2InstanceData, Resources
1313
from dask_task_models_library.resource_constraints import DaskTaskResources
1414
from distributed.core import Status
15-
from models_library.clusters import InternalClusterAuthentication, TLSAuthentication
15+
from models_library.clusters import ClusterAuthentication, TLSAuthentication
1616
from pydantic import AnyUrl, ByteSize, TypeAdapter
1717

1818
from ..core.errors import (
@@ -43,7 +43,7 @@ async def _wrap_client_async_routine(
4343

4444
@contextlib.asynccontextmanager
4545
async def _scheduler_client(
46-
url: AnyUrl, authentication: InternalClusterAuthentication
46+
url: AnyUrl, authentication: ClusterAuthentication
4747
) -> AsyncIterator[distributed.Client]:
4848
"""
4949
Raises:
@@ -116,7 +116,7 @@ def _find_by_worker_host(
116116

117117
async def is_worker_connected(
118118
scheduler_url: AnyUrl,
119-
authentication: InternalClusterAuthentication,
119+
authentication: ClusterAuthentication,
120120
worker_ec2_instance: EC2InstanceData,
121121
) -> bool:
122122
with contextlib.suppress(DaskNoWorkersError, DaskWorkerNotFoundError):
@@ -130,7 +130,7 @@ async def is_worker_connected(
130130

131131
async def is_worker_retired(
132132
scheduler_url: AnyUrl,
133-
authentication: InternalClusterAuthentication,
133+
authentication: ClusterAuthentication,
134134
worker_ec2_instance: EC2InstanceData,
135135
) -> bool:
136136
with contextlib.suppress(DaskNoWorkersError, DaskWorkerNotFoundError):
@@ -156,7 +156,7 @@ def _dask_key_to_dask_task_id(key: dask.typing.Key) -> DaskTaskId:
156156

157157
async def list_unrunnable_tasks(
158158
scheduler_url: AnyUrl,
159-
authentication: InternalClusterAuthentication,
159+
authentication: ClusterAuthentication,
160160
) -> list[DaskTask]:
161161
"""
162162
Raises:
@@ -188,7 +188,7 @@ def _list_tasks(
188188

189189
async def list_processing_tasks_per_worker(
190190
scheduler_url: AnyUrl,
191-
authentication: InternalClusterAuthentication,
191+
authentication: ClusterAuthentication,
192192
) -> dict[DaskWorkerUrl, list[DaskTask]]:
193193
"""
194194
Raises:
@@ -227,7 +227,7 @@ def _list_processing_tasks(
227227

228228
async def get_worker_still_has_results_in_memory(
229229
scheduler_url: AnyUrl,
230-
authentication: InternalClusterAuthentication,
230+
authentication: ClusterAuthentication,
231231
ec2_instance: EC2InstanceData,
232232
) -> int:
233233
"""
@@ -246,7 +246,7 @@ async def get_worker_still_has_results_in_memory(
246246

247247
async def get_worker_used_resources(
248248
scheduler_url: AnyUrl,
249-
authentication: InternalClusterAuthentication,
249+
authentication: ClusterAuthentication,
250250
ec2_instance: EC2InstanceData,
251251
) -> Resources:
252252
"""
@@ -299,7 +299,7 @@ def _list_processing_tasks_on_worker(
299299

300300
async def compute_cluster_total_resources(
301301
scheduler_url: AnyUrl,
302-
authentication: InternalClusterAuthentication,
302+
authentication: ClusterAuthentication,
303303
instances: list[AssociatedInstance],
304304
) -> Resources:
305305
if not instances:
@@ -320,7 +320,7 @@ async def compute_cluster_total_resources(
320320

321321

322322
async def try_retire_nodes(
323-
scheduler_url: AnyUrl, authentication: InternalClusterAuthentication
323+
scheduler_url: AnyUrl, authentication: ClusterAuthentication
324324
) -> None:
325325
async with _scheduler_client(scheduler_url, authentication) as client:
326326
await _wrap_client_async_routine(

services/autoscaling/tests/unit/test_modules_dask.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from aws_library.ec2 import Resources
1414
from faker import Faker
1515
from models_library.clusters import (
16-
InternalClusterAuthentication,
16+
ClusterAuthentication,
1717
NoAuthentication,
1818
TLSAuthentication,
1919
)
@@ -52,7 +52,7 @@
5252
"authentication", _authentication_types, ids=lambda p: f"authentication-{p.type}"
5353
)
5454
async def test__scheduler_client_with_wrong_url(
55-
faker: Faker, authentication: InternalClusterAuthentication
55+
faker: Faker, authentication: ClusterAuthentication
5656
):
5757
with pytest.raises(DaskSchedulerNotFoundError):
5858
async with _scheduler_client(
@@ -72,7 +72,7 @@ def scheduler_url(dask_spec_local_cluster: distributed.SpecCluster) -> AnyUrl:
7272

7373

7474
@pytest.fixture
75-
def scheduler_authentication() -> InternalClusterAuthentication:
75+
def scheduler_authentication() -> ClusterAuthentication:
7676
return NoAuthentication()
7777

7878

@@ -92,7 +92,7 @@ def dask_workers_config() -> dict[str, Any]:
9292

9393

9494
async def test__scheduler_client(
95-
scheduler_url: AnyUrl, scheduler_authentication: InternalClusterAuthentication
95+
scheduler_url: AnyUrl, scheduler_authentication: ClusterAuthentication
9696
):
9797
async with _scheduler_client(scheduler_url, scheduler_authentication):
9898
...
@@ -109,7 +109,7 @@ async def test_list_unrunnable_tasks_with_no_workers(
109109

110110
async def test_list_unrunnable_tasks(
111111
scheduler_url: AnyUrl,
112-
scheduler_authentication: InternalClusterAuthentication,
112+
scheduler_authentication: ClusterAuthentication,
113113
create_dask_task: Callable[[DaskTaskResources], distributed.Future],
114114
):
115115
# we have nothing running now
@@ -131,7 +131,7 @@ async def test_list_unrunnable_tasks(
131131

132132
async def test_list_processing_tasks(
133133
scheduler_url: AnyUrl,
134-
scheduler_authentication: InternalClusterAuthentication,
134+
scheduler_authentication: ClusterAuthentication,
135135
dask_spec_cluster_client: distributed.Client,
136136
):
137137
def _add_fct(x: int, y: int) -> int:
@@ -190,7 +190,7 @@ def fake_ec2_instance_data_with_invalid_ec2_name(
190190

191191
async def test_get_worker_still_has_results_in_memory_with_invalid_ec2_name_raises(
192192
scheduler_url: AnyUrl,
193-
scheduler_authentication: InternalClusterAuthentication,
193+
scheduler_authentication: ClusterAuthentication,
194194
fake_ec2_instance_data_with_invalid_ec2_name: EC2InstanceData,
195195
):
196196
with pytest.raises(Ec2InvalidDnsNameError):
@@ -216,7 +216,7 @@ async def test_get_worker_still_has_results_in_memory_with_no_workers_raises(
216216

217217
async def test_get_worker_still_has_results_in_memory_with_invalid_worker_host_raises(
218218
scheduler_url: AnyUrl,
219-
scheduler_authentication: InternalClusterAuthentication,
219+
scheduler_authentication: ClusterAuthentication,
220220
fake_ec2_instance_data: Callable[..., EC2InstanceData],
221221
):
222222
ec2_instance_data = fake_ec2_instance_data()
@@ -229,7 +229,7 @@ async def test_get_worker_still_has_results_in_memory_with_invalid_worker_host_r
229229
@pytest.mark.parametrize("fct_shall_err", [True, False], ids=str)
230230
async def test_get_worker_still_has_results_in_memory(
231231
scheduler_url: AnyUrl,
232-
scheduler_authentication: InternalClusterAuthentication,
232+
scheduler_authentication: ClusterAuthentication,
233233
dask_spec_cluster_client: distributed.Client,
234234
fake_localhost_ec2_instance_data: EC2InstanceData,
235235
fct_shall_err: bool,
@@ -291,7 +291,7 @@ def _add_fct(x: int, y: int) -> int:
291291

292292
async def test_worker_used_resources_with_invalid_ec2_name_raises(
293293
scheduler_url: AnyUrl,
294-
scheduler_authentication: InternalClusterAuthentication,
294+
scheduler_authentication: ClusterAuthentication,
295295
fake_ec2_instance_data_with_invalid_ec2_name: EC2InstanceData,
296296
):
297297
with pytest.raises(Ec2InvalidDnsNameError):
@@ -317,7 +317,7 @@ async def test_worker_used_resources_with_no_workers_raises(
317317

318318
async def test_worker_used_resources_with_invalid_worker_host_raises(
319319
scheduler_url: AnyUrl,
320-
scheduler_authentication: InternalClusterAuthentication,
320+
scheduler_authentication: ClusterAuthentication,
321321
fake_ec2_instance_data: Callable[..., EC2InstanceData],
322322
):
323323
ec2_instance_data = fake_ec2_instance_data()
@@ -329,7 +329,7 @@ async def test_worker_used_resources_with_invalid_worker_host_raises(
329329

330330
async def test_worker_used_resources(
331331
scheduler_url: AnyUrl,
332-
scheduler_authentication: InternalClusterAuthentication,
332+
scheduler_authentication: ClusterAuthentication,
333333
dask_spec_cluster_client: distributed.Client,
334334
fake_localhost_ec2_instance_data: EC2InstanceData,
335335
):

services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
assert_computation_task_out_obj,
3030
)
3131
from models_library.api_schemas_directorv2.comp_tasks import ComputationGet
32-
from models_library.clusters import DEFAULT_CLUSTER_ID, InternalClusterAuthentication
32+
from models_library.clusters import DEFAULT_CLUSTER_ID, ClusterAuthentication
3333
from models_library.projects import (
3434
Node,
3535
NodesDict,
@@ -360,7 +360,7 @@ def mock_env(
360360
network_name: str,
361361
dev_feature_r_clone_enabled: str,
362362
dask_scheduler_service: str,
363-
dask_scheduler_auth: InternalClusterAuthentication,
363+
dask_scheduler_auth: ClusterAuthentication,
364364
minimal_configuration: None,
365365
patch_storage_setup: None,
366366
) -> None:

0 commit comments

Comments
 (0)