Skip to content

m-cmp/mc-web-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

989 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M-CMP WEB Console

This repository provides a Multi-Cloud WEB Console.

A sub-system of M-CMP platform to deploy and manage Multi-Cloud Infrastructures.

Overview

The MC-WEB-CONSOLE multi-cloud management portal and open interfaces include several features. Firstly, the multi-cloud management platform provides open APIs, facilitating integration with various cloud services. Secondly, a user portal for the multi-cloud management platform is provided, allowing general users to efficiently manage their cloud resources. Lastly, an administrator portal for the multi-cloud management platform enables administrators to monitor and control the entire cloud environment. These portals and interfaces are designed to maximize management efficiency in a multi-cloud environment and enhance convenience for both users and administrators.

  • 멀티 클라우드 관리 포털 및 개방형 인터페이스
    • 멀티 클라우드 관리 플랫폼 일반 사용자 포털
    • 멀티 클라우드 관리 플랫폼 관리자 포털

Quick Start with docker

Use this guide to start MC-WEB-CONOLE using the docker. This guide explains on the premise that all prerequisites have been met.

Prequisites

  • Ubuntu (22.04 is tested) with external access (https-443, http-80, ssh-ANY)
  • pre-installed MC-INFRA-MANAGER and MC-IAM-MANAGER
    • Both should be completed setting (users, pre-Runscript, credential ….)
  • Stop or Disable Services using 3001 port for web interface

Step one : Clone this repo

git clone <https://github.com/m-cmp/mc-web-console> <YourFolderName>

Step two : Configuration

  • Modifying an Environment variable in docker-compose file
  • Those marked with OPTIONAL do not have to be changed. Those marked with REQUIRED are fixed values that must be changed or used after setting.
    • port
    • GO_ENV
    • MCINFRAMANAGER
    • MCIAMMANAGER
    • API_USERNAME
    • API_PASSWORD
    • DEV_DATABASE_URL
    • POSTGRES_DB
    • POSTGRES_USER
    • POSTGRES_PASSWORD
cd <YourFolderName>/scripts
vi dockerfile
version: '3.8'

services:
  mcwebconsole:
    build: ../
    container_name: mcwebconsole
    depends_on:
      - postgresdb
    ports:
      - "3000:3000"
      - "3001:3001"
    environment:
      GO_ENV: development # production | development # Please CHANGE ME (OPTIONAL)
      GODEBUG: netdns=go
      MCIAMMANAGER: <https://sample.mc-iam-manager.com:5000> # Please CHANGE ME (REQUIRE)
      MCINFRAMANAGER: <http://sample.m-cmp.com:1323/tumblebug> # Please CHANGE ME (REQUIRE)
      API_USERNAME: API_USERNAME # Please CHANGE ME (REQUIRE)
      API_PASSWORD: API_PASSWORD # Please CHANGE ME (REQUIRE)
      DEV_DATABASE_URL: postgres://mcwebadmin:mcwebadminpassword@mcwebconsole-postgresdb:5432/mcwebconsoledbdev # Please CHANGE ME (OPTIONAL)
      PROD_DATABASE_URL: postgres://mcwebadmin:mcwebadminpassword@mcwebconsole-postgresdb:5432/mcwebconsoledbprod # Please CHANGE ME (OPTIONAL)
    restart: always
    networks:
      - mcwebconsole

  mcwebconsole-postgresdb:
    image: postgres:14-alpine
    container_name: mcwebconsole-postgresdb
    volumes:
      - ~/.m-cmp/mc-web-console/postgresql/data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: mcwebconsoledbdev # [mcwebconsoledbdev / mcwebconsoledbprod] # Please CHANGE ME (OPTIONAL)
      POSTGRES_USER: mcwebadmin # Please CHANGE ME (OPTIONAL)
      POSTGRES_PASSWORD: mcwebadminpassword # Please CHANGE ME (OPTIONAL)
    networks:
      - mcwebconsole

networks:
  mcwebconsole:

Step three: Excute docker-compose

docker-compose up --build -d

If you check the log as below, it seems that you have successfully built and deployed the mc-web-console without any problems.

$ docker-compose up --build -d
## This warning sign is a natural occurrence when running an existing MCIAMMANAGER with docker components.
WARNING: Found orphan containers (mciammanager, mciammanager-keycloak, mciammanager-nginx, mciammanager-certbot) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Building mcwebconsole
Step 1/32 : FROM golang:1.25-alpine AS builder
 ---> 0594d7786b7c
Step 2/32 : RUN apk add --no-cache gcc libc-dev musl-dev curl npm wget
 ---> Using cache
 ---> ed49efe7089b
Step 3/32 : RUN npm install --global yarn
.....
Creating mcwebconsole-postgresdb ... done
Creating mcwebconsole            ... done

Step four: Ready Check

  1. Verify Framework and Service Status

    • Confirm that the services required by MC-WEB-CONSOLE, such as MC-INFRA-MANAGER and MC-IAM-MANAGER, are running.

    • Ensure the database connection is established without issues.

  2. Check Status in Browser

    • Open a web browser and navigate to the following URL to verify the service response:

    http://<YOUR_ADDRESS>:3001/readyz

WELCOME: Visit Web pages

http://<YOUR_ADDRESS>:3001/auth/login

MC-WEB-CONSOLE has been successfully deployed if the login screen is displayed when accessing the endpoint above. Login users can log in as users created by MC-IAM-MANAGER.


[설치 환경]

mc-web-console은 1.25 이상의 Go 버전이 설치된 다양한 환경에서 실행 가능하지만 최종 동작을 검증한 OS는 Ubuntu 22.0.4입니다.

[의존성]

mc-web-console은 내부적으로 mc-iam-manager & mc-infra-manager의 개방형 API를 이용하기 때문에 각 서버의 연동이 필요합니다.(필수)


[소스 설치]

  • Git 설치

    • $ sudo apt update
    • $ sudo apt install git
  • Go 1.25 이상의 버전 설치 ( 공식 문서 참고 )

  • mc-web-console 설치

    $ git clone <https://github.com/m-cmp/mc-web-console.git>
    $ git clone <https://github.com/m-cmp/mc-web-console.git>
    • api

      $ cd mc-web-console/api
      $ go build ./...
    • front

      $ cd mc-web-console/front
      $ npm install
      $ npm run build
      $ go build ./cmd/app

[환경 설정]

  • /conf/.env.sample 파일을 .env로 변경합니다.

  • .env 파일에서 이용하고자 하는 개방형 API 서버의 실제 URL 정보로 수정합니다.

    [주의사항]

    mc-web-console을 비롯하여 연동되는 모든 서버가 자신의 로컬 환경에서 개발되는 경우를 제외하고는 클라이언트의 웹브라우저에서 접근하기 때문에 localhost나 127.0.0.1 주소가 아닌 실제 IP 주소를 사용해야 합니다.


[mc-web-console 실행]

  • 코드기반 실행

    $ cd <YourFolderName>/api
    $ source ../conf/.env
    $ go run ./cmd
    $ cd <YourFolderName>/front
    $ source ../conf/.env
    $ go run ./cmd/app