mirror of
https://github.com/clearml/clearml-server
synced 2025-03-10 06:01:33 +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
|
||||
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
|
||||
|
||||
for mode, field in cls.mode_to_fields.items():
|
||||
@ -168,7 +168,7 @@ class ModelsBackwardsCompatibility:
|
||||
def unprepare_from_saved(
|
||||
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
|
||||
|
||||
if isinstance(tasks_data, dict):
|
||||
@ -191,7 +191,7 @@ class DockerCmdBackwardsCompatibility:
|
||||
|
||||
@classmethod
|
||||
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
|
||||
|
||||
docker_cmd = nested_get(fields, cls.field)
|
||||
@ -206,7 +206,7 @@ class DockerCmdBackwardsCompatibility:
|
||||
def unprepare_from_saved(
|
||||
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
|
||||
|
||||
if isinstance(tasks_data, dict):
|
||||
|
@ -5,6 +5,8 @@ from functools import partial
|
||||
from typing import Iterable
|
||||
from unittest import TestCase
|
||||
|
||||
from packaging.version import parse
|
||||
|
||||
from apiserver.tests.api_client import APIClient
|
||||
from apiserver.config_repo import config
|
||||
|
||||
@ -72,6 +74,7 @@ class TestService(TestCase, TestServiceInterface):
|
||||
def setUp(self, version="1.7"):
|
||||
self._api = APIClient(base_url=f"http://localhost:8008/v{version}")
|
||||
self._deferred = []
|
||||
self._version = parse(version)
|
||||
header(self.id())
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -1,6 +1,8 @@
|
||||
from copy import deepcopy
|
||||
from typing import Sequence, Optional
|
||||
|
||||
from packaging.version import parse
|
||||
|
||||
from apiserver.tests.automated import TestService
|
||||
|
||||
|
||||
@ -90,6 +92,7 @@ class TestTaskModels(TestService):
|
||||
):
|
||||
compare_models(task.models.input, input_models)
|
||||
compare_models(task.models.output, output_models)
|
||||
if self._version < parse("2.13"):
|
||||
self.assertEqual(
|
||||
get_model_id(task.execution),
|
||||
input_models[0]["model"] if input_models else None,
|
||||
|
Loading…
Reference in New Issue
Block a user