Skip to content

Commit 78cdcaf

Browse files
committed
removed occurences of cluster_id
1 parent ffb1f74 commit 78cdcaf

File tree

7 files changed

+29
-28
lines changed

7 files changed

+29
-28
lines changed

services/api-server/openapi.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,7 +2598,7 @@
25982598
"solvers"
25992599
],
26002600
"summary": "Start Job",
2601-
"description": "Starts job job_id created with the solver solver_key:version\n\nAdded in *version 0.4.3*: query parameter `cluster_id`\nAdded in *version 0.6*: responds with a 202 when successfully starting a computation",
2601+
"description": "Starts job job_id created with the solver solver_key:version\n\nAdded in *version 0.4.3*: query parameter `cluster_id`\nAdded in *version 0.6*: responds with a 202 when successfully starting a computation\nChanged in *version 0.8*: query parameter `cluster_id` deprecated",
26022602
"operationId": "start_job",
26032603
"security": [
26042604
{
@@ -2651,7 +2651,8 @@
26512651
}
26522652
],
26532653
"title": "Cluster Id"
2654-
}
2654+
},
2655+
"deprecated": true
26552656
}
26562657
],
26572658
"responses": {
@@ -4585,7 +4586,7 @@
45854586
"studies"
45864587
],
45874588
"summary": "Start Study Job",
4588-
"description": "Changed in *version 0.6.0*: Now responds with a 202 when successfully starting a computation",
4589+
"description": "Changed in *version 0.6.0*: Now responds with a 202 when successfully starting a computation\nChanged in *version 0.8*: query parameter `cluster_id` deprecated",
45894590
"operationId": "start_study_job",
45904591
"security": [
45914592
{
@@ -4628,7 +4629,8 @@
46284629
}
46294630
],
46304631
"title": "Cluster Id"
4631-
}
4632+
},
4633+
"deprecated": true
46324634
}
46334635
],
46344636
"responses": {
@@ -6891,7 +6893,7 @@
68916893
"type": "integer",
68926894
"x_unit": "second"
68936895
},
6894-
"key": "input_2",
6896+
"key": "f763658f-a89a-4a90-ace4-c44631290f12",
68956897
"kind": "input"
68966898
}
68976899
},
@@ -7099,7 +7101,9 @@
70997101
"required": [
71007102
"walletId",
71017103
"name",
7104+
"description",
71027105
"owner",
7106+
"thumbnail",
71037107
"status",
71047108
"created",
71057109
"modified",

services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
from ..dependencies.authentication import get_current_user_id, get_product_name
4141
from ..dependencies.services import get_api_client
4242
from ..dependencies.webserver import AuthSession, get_webserver_session
43-
from ._constants import FMSG_CHANGELOG_ADDED_IN_VERSION, FMSG_CHANGELOG_NEW_IN_VERSION
43+
from ._constants import (
44+
FMSG_CHANGELOG_ADDED_IN_VERSION,
45+
FMSG_CHANGELOG_CHANGED_IN_VERSION,
46+
FMSG_CHANGELOG_NEW_IN_VERSION,
47+
)
4448

4549
_logger = logging.getLogger(__name__)
4650

@@ -182,6 +186,9 @@ async def delete_job(
182186
+ FMSG_CHANGELOG_ADDED_IN_VERSION.format("0.4.3", "query parameter `cluster_id`")
183187
+ FMSG_CHANGELOG_ADDED_IN_VERSION.format(
184188
"0.6", "responds with a 202 when successfully starting a computation"
189+
)
190+
+ FMSG_CHANGELOG_CHANGED_IN_VERSION.format(
191+
"0.8", "query parameter `cluster_id` deprecated"
185192
),
186193
)
187194
async def start_job(
@@ -192,7 +199,7 @@ async def start_job(
192199
user_id: Annotated[PositiveInt, Depends(get_current_user_id)],
193200
director2_api: Annotated[DirectorV2Api, Depends(get_api_client(DirectorV2Api))],
194201
webserver_api: Annotated[AuthSession, Depends(get_webserver_session)],
195-
cluster_id: ClusterID | None = None,
202+
cluster_id: Annotated[ClusterID | None, Query(deprecated=True)] = None,
196203
):
197204
job_name = _compose_job_resource_name(solver_key, version, job_id)
198205
_logger.debug("Start Job '%s'", job_name)
@@ -203,7 +210,6 @@ async def start_job(
203210
job_id=job_id,
204211
expected_job_name=job_name,
205212
webserver_api=webserver_api,
206-
cluster_id=cluster_id,
207213
)
208214
except ProjectAlreadyStartedError:
209215
job_status = await inspect_job(

services/api-server/src/simcore_service_api_server/api/routes/studies_jobs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ async def delete_study_job(
210210
},
211211
description=FMSG_CHANGELOG_CHANGED_IN_VERSION.format(
212212
"0.6.0", "Now responds with a 202 when successfully starting a computation"
213+
)
214+
+ FMSG_CHANGELOG_CHANGED_IN_VERSION.format(
215+
"0.8", "query parameter `cluster_id` deprecated"
213216
),
214217
)
215218
async def start_study_job(
@@ -219,7 +222,7 @@ async def start_study_job(
219222
user_id: Annotated[PositiveInt, Depends(get_current_user_id)],
220223
webserver_api: Annotated[AuthSession, Depends(get_webserver_session)],
221224
director2_api: Annotated[DirectorV2Api, Depends(get_api_client(DirectorV2Api))],
222-
cluster_id: ClusterID | None = None,
225+
cluster_id: Annotated[ClusterID | None, Query(deprecated=True)] = None,
223226
):
224227
job_name = _compose_job_resource_name(study_id, job_id)
225228
with log_context(_logger, logging.DEBUG, f"Starting Job '{job_name}'"):
@@ -229,7 +232,6 @@ async def start_study_job(
229232
job_id=job_id,
230233
expected_job_name=job_name,
231234
webserver_api=webserver_api,
232-
cluster_id=cluster_id,
233235
)
234236
except ProjectAlreadyStartedError:
235237
job_status: JobStatus = await inspect_study_job(

services/api-server/src/simcore_service_api_server/services/director_v2.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from uuid import UUID
44

55
from fastapi import FastAPI
6-
from models_library.clusters import ClusterID
76
from models_library.projects_nodes_io import NodeID
87
from models_library.projects_pipeline import ComputationTask
98
from models_library.projects_state import RunningState
@@ -102,19 +101,14 @@ async def start_computation(
102101
user_id: PositiveInt,
103102
product_name: str,
104103
groups_extra_properties_repository: GroupsExtraPropertiesRepository,
105-
cluster_id: ClusterID | None = None,
106104
) -> ComputationTaskGet:
107-
extras = {}
108105

109106
use_on_demand_clusters = (
110107
await groups_extra_properties_repository.use_on_demand_clusters(
111108
user_id, product_name
112109
)
113110
)
114111

115-
if cluster_id is not None and not use_on_demand_clusters:
116-
extras["cluster_id"] = cluster_id
117-
118112
response = await self.client.post(
119113
"/v2/computations",
120114
json={
@@ -123,7 +117,6 @@ async def start_computation(
123117
"start_pipeline": True,
124118
"product_name": product_name,
125119
"use_on_demand_clusters": use_on_demand_clusters,
126-
**extras,
127120
},
128121
)
129122
response.raise_for_status()

services/api-server/src/simcore_service_api_server/services/jobs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from fastapi import Depends, HTTPException, Request, status
66
from models_library.api_schemas_webserver.projects import ProjectGet
7-
from models_library.clusters import ClusterID
87
from pydantic import HttpUrl, PositiveInt
98
from servicelib.logging_utils import log_context
109

@@ -41,7 +40,6 @@ async def start_project(
4140
job_id: JobID,
4241
expected_job_name: str,
4342
webserver_api: Annotated[AuthSession, Depends(get_webserver_session)],
44-
cluster_id: ClusterID | None = None,
4543
) -> None:
4644
if pricing_spec := JobPricingSpecification.create_from_headers(request.headers):
4745
with log_context(_logger, logging.DEBUG, "Set pricing plan and unit"):
@@ -56,7 +54,7 @@ async def start_project(
5654
pricing_unit=pricing_spec.pricing_unit,
5755
)
5856
with log_context(_logger, logging.DEBUG, "Starting job"):
59-
await webserver_api.start_project(project_id=job_id, cluster_id=cluster_id)
57+
await webserver_api.start_project(project_id=job_id)
6058

6159

6260
async def stop_project(

services/api-server/src/simcore_service_api_server/services/webserver.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
import logging
44
import urllib.parse
5+
from collections.abc import Mapping
56
from dataclasses import dataclass
67
from functools import partial
7-
from typing import Any, Mapping
8+
from typing import Any
89
from uuid import UUID
910

1011
import httpx
@@ -36,7 +37,6 @@
3637
WalletGet,
3738
WalletGetWithAvailableCredits,
3839
)
39-
from models_library.clusters import ClusterID
4040
from models_library.generics import Envelope
4141
from models_library.projects import ProjectID
4242
from models_library.projects_nodes_io import NodeID
@@ -444,11 +444,12 @@ async def connect_pricing_unit_to_project_node(
444444
}
445445
)
446446
async def start_project(
447-
self, *, project_id: UUID, cluster_id: ClusterID | None = None
447+
self,
448+
*,
449+
project_id: UUID,
448450
) -> None:
449451
body_input: dict[str, Any] = {}
450-
if cluster_id:
451-
body_input["cluster_id"] = cluster_id
452+
452453
body: ComputationStart = ComputationStart(**body_input)
453454
response = await self.client.post(
454455
f"/computations/{project_id}:start",

services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ async def test_run_solver_job(
231231
"result",
232232
"pipeline_details",
233233
"iteration",
234-
"cluster_id",
235234
"url",
236235
"stop_url",
237236
"submitted",
@@ -269,7 +268,6 @@ async def test_run_solver_job(
269268
"progress": 0.0,
270269
},
271270
"iteration": 1,
272-
"cluster_id": 0,
273271
"url": "http://test.com",
274272
"stop_url": "http://test.com",
275273
"started": None,
@@ -365,7 +363,6 @@ async def test_run_solver_job(
365363
resp = await client.post(
366364
f"/{API_VTAG}/solvers/{solver_key}/releases/{solver_version}/jobs/{job.id}:start",
367365
auth=auth,
368-
params={"cluster_id": 1},
369366
)
370367
assert resp.status_code == status.HTTP_202_ACCEPTED
371368
assert mocked_directorv2_service_api["inspect_computation"].called

0 commit comments

Comments
 (0)