mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Expose go version server and admin server port out of docker in CI (#13572)
### What problem does this PR solve? - Print Go version log when start server - Expose the server port in CI docker container ### Type of change - [x] Other (please describe): For CI Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@@ -185,6 +185,8 @@ jobs:
|
|||||||
SVR_HTTP_PORT=$((9380 + RUNNER_NUM * 10))
|
SVR_HTTP_PORT=$((9380 + RUNNER_NUM * 10))
|
||||||
ADMIN_SVR_HTTP_PORT=$((9381 + RUNNER_NUM * 10))
|
ADMIN_SVR_HTTP_PORT=$((9381 + RUNNER_NUM * 10))
|
||||||
SVR_MCP_PORT=$((9382 + RUNNER_NUM * 10))
|
SVR_MCP_PORT=$((9382 + RUNNER_NUM * 10))
|
||||||
|
GO_HTTP_PORT=$((9384 + RUNNER_NUM * 10))
|
||||||
|
GO_ADMIN_PORT=$((9385 + RUNNER_NUM * 10))
|
||||||
SANDBOX_EXECUTOR_MANAGER_PORT=$((9385 + RUNNER_NUM * 10))
|
SANDBOX_EXECUTOR_MANAGER_PORT=$((9385 + RUNNER_NUM * 10))
|
||||||
SVR_WEB_HTTP_PORT=$((80 + RUNNER_NUM * 10))
|
SVR_WEB_HTTP_PORT=$((80 + RUNNER_NUM * 10))
|
||||||
SVR_WEB_HTTPS_PORT=$((443 + RUNNER_NUM * 10))
|
SVR_WEB_HTTPS_PORT=$((443 + RUNNER_NUM * 10))
|
||||||
@@ -205,6 +207,8 @@ jobs:
|
|||||||
echo -e "SVR_HTTP_PORT=${SVR_HTTP_PORT}" >> docker/.env
|
echo -e "SVR_HTTP_PORT=${SVR_HTTP_PORT}" >> docker/.env
|
||||||
echo -e "ADMIN_SVR_HTTP_PORT=${ADMIN_SVR_HTTP_PORT}" >> docker/.env
|
echo -e "ADMIN_SVR_HTTP_PORT=${ADMIN_SVR_HTTP_PORT}" >> docker/.env
|
||||||
echo -e "SVR_MCP_PORT=${SVR_MCP_PORT}" >> docker/.env
|
echo -e "SVR_MCP_PORT=${SVR_MCP_PORT}" >> docker/.env
|
||||||
|
echo -e "GO_HTTP_PORT=${GO_HTTP_PORT}" >> docker/.env
|
||||||
|
echo -e "GO_ADMIN_PORT=${GO_ADMIN_PORT}" >> docker/.env
|
||||||
echo -e "SANDBOX_EXECUTOR_MANAGER_PORT=${SANDBOX_EXECUTOR_MANAGER_PORT}" >> docker/.env
|
echo -e "SANDBOX_EXECUTOR_MANAGER_PORT=${SANDBOX_EXECUTOR_MANAGER_PORT}" >> docker/.env
|
||||||
echo -e "SVR_WEB_HTTP_PORT=${SVR_WEB_HTTP_PORT}" >> docker/.env
|
echo -e "SVR_WEB_HTTP_PORT=${SVR_WEB_HTTP_PORT}" >> docker/.env
|
||||||
echo -e "SVR_WEB_HTTPS_PORT=${SVR_WEB_HTTPS_PORT}" >> docker/.env
|
echo -e "SVR_WEB_HTTPS_PORT=${SVR_WEB_HTTPS_PORT}" >> docker/.env
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ func main() {
|
|||||||
|
|
||||||
// Start server in a goroutine
|
// Start server in a goroutine
|
||||||
go func() {
|
go func() {
|
||||||
logger.Info(fmt.Sprintf("Version: %s", utility.GetRAGFlowVersion()))
|
logger.Info(fmt.Sprintf("Admin Go Version: %s", utility.GetRAGFlowVersion()))
|
||||||
logger.Info(fmt.Sprintf("Starting RAGFlow admin server on port: %d", cfg.Admin.Port))
|
logger.Info(fmt.Sprintf("Starting RAGFlow admin server on port: %d", cfg.Admin.Port))
|
||||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
logger.Fatal("Failed to start server", zap.Error(err))
|
logger.Fatal("Failed to start server", zap.Error(err))
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ func startServer(config *server.Config) {
|
|||||||
" / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /\n" +
|
" / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /\n" +
|
||||||
" /_/ |_|/_/ |_|\\____//_/ /_/ \\____/ |__/|__/\n",
|
" /_/ |_|/_/ |_|\\____//_/ /_/ \\____/ |__/|__/\n",
|
||||||
)
|
)
|
||||||
logger.Info(fmt.Sprintf("Version: %s", utility.GetRAGFlowVersion()))
|
logger.Info(fmt.Sprintf("RAGFlow Go Version: %s", utility.GetRAGFlowVersion()))
|
||||||
logger.Info(fmt.Sprintf("Server starting on port: %d", config.Server.Port))
|
logger.Info(fmt.Sprintf("Server starting on port: %d", config.Server.Port))
|
||||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
logger.Fatal("Failed to start server", zap.Error(err))
|
logger.Fatal("Failed to start server", zap.Error(err))
|
||||||
|
|||||||
@@ -152,6 +152,8 @@ SVR_WEB_HTTPS_PORT=443
|
|||||||
SVR_HTTP_PORT=9380
|
SVR_HTTP_PORT=9380
|
||||||
ADMIN_SVR_HTTP_PORT=9381
|
ADMIN_SVR_HTTP_PORT=9381
|
||||||
SVR_MCP_PORT=9382
|
SVR_MCP_PORT=9382
|
||||||
|
GO_HTTP_PORT=9384
|
||||||
|
GO_ADMIN_PORT=9385
|
||||||
|
|
||||||
# The RAGFlow Docker image to download. v0.22+ doesn't include embedding models.
|
# The RAGFlow Docker image to download. v0.22+ doesn't include embedding models.
|
||||||
RAGFLOW_IMAGE=infiniflow/ragflow:v0.24.0
|
RAGFLOW_IMAGE=infiniflow/ragflow:v0.24.0
|
||||||
|
|||||||
@@ -337,9 +337,9 @@ func Init(configPath string) error {
|
|||||||
globalConfig.Admin.Host = "127.0.0.1"
|
globalConfig.Admin.Host = "127.0.0.1"
|
||||||
}
|
}
|
||||||
if globalConfig.Admin.Port == 0 {
|
if globalConfig.Admin.Port == 0 {
|
||||||
globalConfig.Admin.Port = 9383
|
globalConfig.Admin.Port = 9385
|
||||||
} else {
|
} else {
|
||||||
globalConfig.Admin.Port += 2
|
globalConfig.Admin.Port += 4
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load REGISTER_ENABLED from environment variable (default: 1)
|
// Load REGISTER_ENABLED from environment variable (default: 1)
|
||||||
@@ -374,7 +374,7 @@ func Init(configPath string) error {
|
|||||||
if v.IsSet("ragflow") {
|
if v.IsSet("ragflow") {
|
||||||
ragflowConfig := v.Sub("ragflow")
|
ragflowConfig := v.Sub("ragflow")
|
||||||
if ragflowConfig != nil {
|
if ragflowConfig != nil {
|
||||||
globalConfig.Server.Port = ragflowConfig.GetInt("http_port") + 2 // 9382, by default
|
globalConfig.Server.Port = ragflowConfig.GetInt("http_port") + 4 // 9384, by default
|
||||||
//globalConfig.Server.Port = ragflowConfig.GetInt("http_port") // Correct
|
//globalConfig.Server.Port = ragflowConfig.GetInt("http_port") // Correct
|
||||||
// If mode is not set, default to debug
|
// If mode is not set, default to debug
|
||||||
if globalConfig.Server.Mode == "" {
|
if globalConfig.Server.Mode == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user