diff --git a/bin/mcc b/bin/mcc index 06bf332..026a714 100755 Binary files a/bin/mcc and b/bin/mcc differ diff --git a/conf/api.yaml b/conf/api.yaml index 28d27ab..952a2b2 100644 --- a/conf/api.yaml +++ b/conf/api.yaml @@ -31,47 +31,47 @@ services: type: bearer mc-observability: - version: 0.5.0 + version: 0.7.0 baseurl: http://mc-observability-manager:18080 auth: mc-application-manager: - version: 0.5.2 + version: 0.7.2 baseurl: http://mc-application-manager:18084 auth: mc-workflow-manager: - version: 0.5.1 + version: 0.7.2 baseurl: http://mc-workflow-manager:18083 auth: mc-cost-optimizer: - version: 0.5.2 + version: 0.7.0 baseurl: http://mc-cost-optimizer-be:9090 auth: mc-data-manager: - version: 0.5.3 + version: 0.7.3 baseurl: http://mc-data-manager:3300 auth: mc-cost-optimizer-fe: - version: 0.5.2 + version: 0.7.0 baseurl: http://mc-cost-optimizer-fe:7780 auth: mc-workflow-manager-fe: - version: 0.5.1 + version: 0.7.2 baseurl: http://mc-workflow-manager:18083 auth: mc-data-manager-fe: - version: 0.5.3 + version: 0.7.3 baseurl: http://mc-data-manager:3300 auth: mc-application-manager-fe: - version: 0.5.2 + version: 0.7.2 baseurl: http://mc-application-manager:18084 auth: diff --git a/conf/docker/api.yaml b/conf/docker/api.yaml index 28d27ab..952a2b2 100644 --- a/conf/docker/api.yaml +++ b/conf/docker/api.yaml @@ -31,47 +31,47 @@ services: type: bearer mc-observability: - version: 0.5.0 + version: 0.7.0 baseurl: http://mc-observability-manager:18080 auth: mc-application-manager: - version: 0.5.2 + version: 0.7.2 baseurl: http://mc-application-manager:18084 auth: mc-workflow-manager: - version: 0.5.1 + version: 0.7.2 baseurl: http://mc-workflow-manager:18083 auth: mc-cost-optimizer: - version: 0.5.2 + version: 0.7.0 baseurl: http://mc-cost-optimizer-be:9090 auth: mc-data-manager: - version: 0.5.3 + version: 0.7.3 baseurl: http://mc-data-manager:3300 auth: mc-cost-optimizer-fe: - version: 0.5.2 + version: 0.7.0 baseurl: http://mc-cost-optimizer-fe:7780 auth: mc-workflow-manager-fe: - version: 0.5.1 + version: 0.7.2 baseurl: http://mc-workflow-manager:18083 auth: mc-data-manager-fe: - version: 0.5.3 + version: 0.7.3 baseurl: http://mc-data-manager:3300 auth: mc-application-manager-fe: - version: 0.5.2 + version: 0.7.2 baseurl: http://mc-application-manager:18084 auth: diff --git a/conf/docker/conf/mc-web-console/api/conf/api.yaml b/conf/docker/conf/mc-web-console/api/conf/api.yaml index 8804cd8..d7eb2b9 100644 --- a/conf/docker/conf/mc-web-console/api/conf/api.yaml +++ b/conf/docker/conf/mc-web-console/api/conf/api.yaml @@ -31,52 +31,52 @@ services: type: bearer mc-observability: - version: 0.4.0 + version: 0.7.0 baseurl: http://mc-observability-manager:18080 auth: mc-application-manager: - version: 0.4.0 + version: 0.7.2 baseurl: http://mc-application-manager:18084 auth: mc-workflow-manager: - version: 0.4.0 + version: 0.7.2 baseurl: http://mc-workflow-manager:18083 auth: mc-cost-optimizer: - version: 0.4.0 + version: 0.7.0 baseurl: http://mc-cost-optimizer-be:9090 auth: mc-cost-optimizer-fe: - version: 0.4.0 + version: 0.7.0 baseurl: http://mc-cost-optimizer-fe:7780 auth: mc-data-manager: - version: 0.4.0 + version: 0.7.3 baseurl: http://mc-data-manager:3300 auth: mc-workflow-manager-fe: - version: v0.0.1 + version: 0.7.2 baseurl: http://mc-workflow-manager:18083 auth: mc-data-manager-fe: - version: v0.0.1 + version: 0.7.3 baseurl: http://mc-data-manager:3300 auth: mc-application-manager-fe: - version: v0.0.1 + version: 0.7.2 baseurl: http://mc-application-manager:18084 auth: mc-observability-fe: - version: v0.0.1 + version: 0.7.0 baseurl: http://mc-observability-front:18081 auth: diff --git a/conf/docker/tool/mcc b/conf/docker/tool/mcc index 8329f70..45f617c 100755 Binary files a/conf/docker/tool/mcc and b/conf/docker/tool/mcc differ diff --git a/docs/mc-admin-cli-infra.md b/docs/mc-admin-cli-infra.md index 1966053..500709f 100644 --- a/docs/mc-admin-cli-infra.md +++ b/docs/mc-admin-cli-infra.md @@ -104,6 +104,8 @@ go build -o ../bin/mcc main.go ../bin/mcc infra update -s "서브시스템명" ``` +update는 이미지를 받은 뒤 컨테이너를 detach 모드로 재기동하고 종료합니다. 서비스 상태는 `../bin/mcc infra info` 또는 `docker logs <컨테이너명>`으로 확인합니다. + ## M-CMP 중지 ```bash diff --git a/src/cmd/docker/update.go b/src/cmd/docker/update.go index 1ec54ff..2d50637 100644 --- a/src/cmd/docker/update.go +++ b/src/cmd/docker/update.go @@ -7,13 +7,20 @@ import ( "github.com/spf13/cobra" ) -// pullCmd represents the pull command +// updateCmd represents the update command var updateCmd = &cobra.Command{ Use: "update", Short: "Update the latest Docker images of the subsystems that make up the M-CMP System.", - Long: `Update the latest Docker images of the subsystems that make up the M-CMP System.`, - Run: func(cmd *cobra.Command, args []string) { + Long: `Update the latest Docker images of the subsystems that make up the M-CMP System. +The images are pulled and the containers are restarted in detached mode, so the command +returns when the update is done. Use './mcc infra info' or 'docker logs' to check the services.`, + SilenceUsage: true, + RunE: func(cmd *cobra.Command, args []string) error { fmt.Println("\n[Update the Docker images of the subsystems that make up the M-CMP System.]") + if DockerFilePath == "" { + return fmt.Errorf("--file (-f) argument is required but not provided") + } + //============================ // Pull //============================ @@ -21,8 +28,9 @@ var updateCmd = &cobra.Command{ fmt.Println() cmdStr := fmt.Sprintf("COMPOSE_PROJECT_NAME=%s docker compose -f %s pull %s", ComposeProjectName, DockerFilePath, ServiceName) - //fmt.Println(cmdStr) - common.SysCall(cmdStr) + if err := common.SysCallWithError(cmdStr); err != nil { + return fmt.Errorf("failed to pull the Docker images: %w", err) + } //============================ // RUN @@ -30,15 +38,13 @@ var updateCmd = &cobra.Command{ fmt.Println("\n\n[Restart based on the installed latest Docker images.]") fmt.Println() - detachModeOption := "" - if detachFlag { - detachModeOption = "-d" + // Always detached: update must return once the containers are restarted. + // An attached 'up' never exits, and stopping it with Ctrl+C stops the containers. + cmdStr = fmt.Sprintf("COMPOSE_PROJECT_NAME=%s docker compose -f %s up -d %s", ComposeProjectName, DockerFilePath, ServiceName) + if err := common.SysCallWithError(cmdStr); err != nil { + return fmt.Errorf("failed to restart the containers: %w", err) } - cmdStr = fmt.Sprintf("COMPOSE_PROJECT_NAME=%s docker compose -f %s up %s %s", ComposeProjectName, DockerFilePath, detachModeOption, ServiceName) - - //fmt.Println(cmdStr) - common.SysCall(cmdStr) - + return nil }, }