From fb710452a3fc6b356dc746464e8343f9be70b52a Mon Sep 17 00:00:00 2001 From: vansangpfiev Date: Tue, 3 Dec 2024 15:02:22 +0700 Subject: [PATCH] fix: e2e docker --- docker/entrypoint.sh | 2 +- engine/cli/commands/server_start_cmd.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 6f0493ec2..99bdd0009 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -7,10 +7,10 @@ echo "enableCors: true" >> /root/.cortexrc # Install the engine cortex engines install llama-cpp -s /opt/cortex.llamacpp -cortex engines list # 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 & diff --git a/engine/cli/commands/server_start_cmd.cc b/engine/cli/commands/server_start_cmd.cc index 748a76052..ba4f7bd82 100644 --- a/engine/cli/commands/server_start_cmd.cc +++ b/engine/cli/commands/server_start_cmd.cc @@ -28,6 +28,10 @@ bool TryConnectToServer(const std::string& host, int port) { bool ServerStartCmd::Exec(const std::string& host, int port, const std::optional& log_level) { + if (IsServerAlive(host, port)) { + CLI_LOG("The server has already started"); + return true; + } std::string log_level_; if (!log_level.has_value()) { log_level_ = "INFO";