--- /dev/null
+# ==================================================================================
+#
+# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==================================================================================
+
+from trainingmgr.db.featuregroup_db import get_feature_group_by_name_db
+from trainingmgr.common.exceptions_utls import TMException, DBException
+from trainingmgr.common.trainingmgr_config import TrainingMgrConfig
+
+LOGGER = TrainingMgrConfig().logger
+
+def get_featuregroup_by_name(featuregroup_name:str):
+ LOGGER.debug(f'service for get featuregroup by name')
+ try:
+ featuregroup = get_feature_group_by_name_db(featuregroup_name)
+ return featuregroup
+ except DBException as err:
+ raise TMException(f"get featuregroup by name service failed with exception : {str(err)}")
\ No newline at end of file
# limitations under the License.
#
# ==================================================================================
-from trainingmgr.db.trainingjob_db import delete_trainingjob_by_id, create_trainingjob, get_trainingjob, get_trainingjob_by_modelId_db
+from trainingmgr.db.trainingjob_db import delete_trainingjob_by_id, create_trainingjob, get_trainingjob, get_trainingjob_by_modelId_db, \
+change_steps_state
from trainingmgr.common.exceptions_utls import DBException, TMException
from trainingmgr.schemas import TrainingJobSchema
except Exception as err:
raise DBException(f"get failed to get the status with exception : {str(err)}")
+def change_status_tj(trainingjob, step:str, state:str):
+ try:
+ change_steps_state(trainingjob, step, state)
+ except DBException as err:
+ raise TMException(f"change status of tj failed with exception : {str(err)}")
\ No newline at end of file