From bc3744a1cd080d6ec5dba0e433110c6159c8e681 Mon Sep 17 00:00:00 2001 From: sangjanai Date: Tue, 18 Feb 2025 11:17:14 +0700 Subject: [PATCH 1/2] fix: remove all yml files when delete model --- engine/services/model_service.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/services/model_service.cc b/engine/services/model_service.cc index 6dc1642fb..94ca4f4cc 100644 --- a/engine/services/model_service.cc +++ b/engine/services/model_service.cc @@ -736,8 +736,15 @@ cpp::result ModelService::DeleteModel( fs::path(model_entry.value().path_to_model_yaml)); yaml_handler.ModelConfigFromFile(yaml_fp.string()); auto mc = yaml_handler.GetModelConfig(); - // Remove yaml file - std::filesystem::remove(yaml_fp); + // Remove yaml files + for (const auto& entry : + std::filesystem::directory_iterator(yaml_fp.parent_path())) { + if (entry.is_regular_file() && (entry.path().extension() == ".yml")) { + std::filesystem::remove(entry); + CTL_INF("Removed: " << entry.path().string()); + } + } + // Remove model files if they are not imported locally if (model_entry.value().branch_name != "imported" && !engine_svc_->IsRemoteEngine(mc.engine)) { From ade2f5d5fc385ec8900c751b67aa1ece2d755a9c Mon Sep 17 00:00:00 2001 From: sangjanai Date: Tue, 18 Feb 2025 14:27:19 +0700 Subject: [PATCH 2/2] chore: add debug --- docker/entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 99bdd0009..761c5bc19 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -5,13 +5,15 @@ echo "apiServerHost: 0.0.0.0" > /root/.cortexrc echo "enableCors: true" >> /root/.cortexrc +# Start the cortex server +cortex start + # Install the engine cortex engines install llama-cpp -s /opt/cortex.llamacpp -# Start the cortex server -cortex start cortex engines list + # Keep the container running by tailing the log files tail -f /root/cortexcpp/logs/cortex.log & tail -f /root/cortexcpp/logs/cortex-cli.log &