mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Disable backwards compatibility for 2.13 clients
This commit is contained in:
parent
66cc49313b
commit
f1a258208e
@ -144,7 +144,7 @@ class ModelsBackwardsCompatibility:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def prepare_for_save(cls, call: APICall, fields: dict):
|
def prepare_for_save(cls, call: APICall, fields: dict):
|
||||||
if call.requested_endpoint_version > cls.max_version:
|
if call.requested_endpoint_version >= cls.max_version:
|
||||||
return
|
return
|
||||||
|
|
||||||
for mode, field in cls.mode_to_fields.items():
|
for mode, field in cls.mode_to_fields.items():
|
||||||
@ -168,7 +168,7 @@ class ModelsBackwardsCompatibility:
|
|||||||
def unprepare_from_saved(
|
def unprepare_from_saved(
|
||||||
cls, call: APICall, tasks_data: Union[Sequence[dict], dict]
|
cls, call: APICall, tasks_data: Union[Sequence[dict], dict]
|
||||||
):
|
):
|
||||||
if call.requested_endpoint_version > cls.max_version:
|
if call.requested_endpoint_version >= cls.max_version:
|
||||||
return
|
return
|
||||||
|
|
||||||
if isinstance(tasks_data, dict):
|
if isinstance(tasks_data, dict):
|
||||||
@ -191,7 +191,7 @@ class DockerCmdBackwardsCompatibility:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def prepare_for_save(cls, call: APICall, fields: dict):
|
def prepare_for_save(cls, call: APICall, fields: dict):
|
||||||
if call.requested_endpoint_version > cls.max_version:
|
if call.requested_endpoint_version >= cls.max_version:
|
||||||
return
|
return
|
||||||
|
|
||||||
docker_cmd = nested_get(fields, cls.field)
|
docker_cmd = nested_get(fields, cls.field)
|
||||||
@ -206,7 +206,7 @@ class DockerCmdBackwardsCompatibility:
|
|||||||
def unprepare_from_saved(
|
def unprepare_from_saved(
|
||||||
cls, call: APICall, tasks_data: Union[Sequence[dict], dict]
|
cls, call: APICall, tasks_data: Union[Sequence[dict], dict]
|
||||||
):
|
):
|
||||||
if call.requested_endpoint_version > cls.max_version:
|
if call.requested_endpoint_version >= cls.max_version:
|
||||||
return
|
return
|
||||||
|
|
||||||
if isinstance(tasks_data, dict):
|
if isinstance(tasks_data, dict):
|
||||||
|
@ -5,6 +5,8 @@ from functools import partial
|
|||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from packaging.version import parse
|
||||||
|
|
||||||
from apiserver.tests.api_client import APIClient
|
from apiserver.tests.api_client import APIClient
|
||||||
from apiserver.config_repo import config
|
from apiserver.config_repo import config
|
||||||
|
|
||||||
@ -72,6 +74,7 @@ class TestService(TestCase, TestServiceInterface):
|
|||||||
def setUp(self, version="1.7"):
|
def setUp(self, version="1.7"):
|
||||||
self._api = APIClient(base_url=f"http://localhost:8008/v{version}")
|
self._api = APIClient(base_url=f"http://localhost:8008/v{version}")
|
||||||
self._deferred = []
|
self._deferred = []
|
||||||
|
self._version = parse(version)
|
||||||
header(self.id())
|
header(self.id())
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from typing import Sequence, Optional
|
from typing import Sequence, Optional
|
||||||
|
|
||||||
|
from packaging.version import parse
|
||||||
|
|
||||||
from apiserver.tests.automated import TestService
|
from apiserver.tests.automated import TestService
|
||||||
|
|
||||||
|
|
||||||
@ -90,6 +92,7 @@ class TestTaskModels(TestService):
|
|||||||
):
|
):
|
||||||
compare_models(task.models.input, input_models)
|
compare_models(task.models.input, input_models)
|
||||||
compare_models(task.models.output, output_models)
|
compare_models(task.models.output, output_models)
|
||||||
|
if self._version < parse("2.13"):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
get_model_id(task.execution),
|
get_model_id(task.execution),
|
||||||
input_models[0]["model"] if input_models else None,
|
input_models[0]["model"] if input_models else None,
|
||||||
|
Loading…
Reference in New Issue
Block a user