Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support credential selection for dynamic MCIS creation #1069

Merged
merged 5 commits into from
Apr 22, 2022

Conversation

seokho-son
Copy link
Member

@seokho-son seokho-son commented Apr 21, 2022

동적 MCIS 프로비저닝 관련 요청에 대응하기 위한 PR입니다.

Slack: https://cloud-barista.slack.com/archives/CJQ7575PU/p1649118103799689

질문있습니다.
동적 MCIS 프로비저닝 : mcisDynamic 에서
namespace는 path에 있고
parameter로 mcisName, spec, image, vmName을 넘기고
specName자체에 aws-ap-northeast-2-t2-small 로 provider, region, zone 은 있는데
동일한 zone의 connection이 2개 이상이면....
connection(credential)의 선택문제가 생기는데 이부분은 어떻게 되나요??
그리고 mcir은 내부적으로 생성한다고 되어있는데 connection이 없는 경우 credential을 이용해 connection도 생성하나요??

기존의 동적 MCIS 생성은
공통 Spec에 지정된 connctionConfig (region에 credential이 혼합된 Spider의 개념)를 활용하여, connectionName 지정 없이
자동으로 MCIS를 생성하였습니다.

그러나, 웹툴 등 다양한 활용 사례를 고려하는 입장에서는
MCIS 생성시 마다, Credential 을 달리하는 경우가 있을 수 있다는 사용자 의견에 동의하였습니다.

노영현 14 days ago
connection이 없더라도 spec선택 시 region을 알 수 있고
credential선택이 가능하다면
생성하는 화면을 popup등으로 띄워 처리 후 선택하게 하면 될 것 같습니다.
credential + region + driver를 알고 있기 때문에 connection Name 입력외에 추가로 필요한 것이 따로 없으나 connection 은 spider를 호출하는거라 관점이 다르겠네요
connection이 없으면 생성 후 사용!!

이 PR에서의 해결 방안은 다음과 같습니다.

  1. 동적 MCIS 생성 요청에 connectionName 를 지정할 수 있도록 처리하였으며, 만약 connectionName를 제시하지 않는 경우 기존 방식대로 spec에 지정된 값을 활용
  2. 동적 MCIS 요청 사항(spec)을 기준으로, 활용 가능한 connectionConfig를 검색할 수 있도록 정보 제공 API 제공
  • connectionConfigCandidates 항목에서 지정된 Spec을 활용할 수 있는 모든 connectionConfig 리스트를 제공

post /mcisDynamicCheckRequest

[입력 예시]

{
  "commonSpec": [
    "aws-ap-northeast-2-t2-small",
    "gcp-us-west1-g1-small",
    "azure-westus2-standard-a1"
  ]
}

[출력 예시] 참고: connectionConfigCandidates 를 통해 사용 가능 리스트 확보 가능 (Spec에 지정된 RegionName을 기준으로 목록 작성)

{
  "reqCheck": [
    {
      "connectionConfigCandidates": [
        "aws-ap-northeast-2",
        "candidate-connection-t01",
        "candidate-connection-t02",
        "candidate-connection-t03",
        "candidate-connection-t04"
      ],
      "vmSpec": {
        "namespace": "system-purpose-common-ns",
        "id": "aws-ap-northeast-2-t2-small",
        "name": "aws-ap-northeast-2-t2-small",
        "connectionName": "aws-ap-northeast-2",
        "providerName": "aws",
        "regionName": "aws-ap-northeast-2",
        "cspSpecName": "t2.small",
        "numvCPU": 1,
        "memGiB": 2,
        "costPerHour": 0.0288,
        "evaluationScore01": 59.57,
      },
      "region": {
        "RegionName": "aws-ap-northeast-2",
        "ProviderName": "AWS",
        "KeyValueInfoList": [
          {
            "Key": "Region",
            "Value": "ap-northeast-2"
          },
          {
            "Key": "Zone",
            "Value": "ap-northeast-2a"
          }
        ]
      },
      "systemMessage": ""
    },
    {
      "connectionConfigCandidates": [
        "gcp-us-west1"
      ],
      "vmSpec": {
        "namespace": "system-purpose-common-ns",
        "id": "gcp-us-west1-g1-small",
        "name": "gcp-us-west1-g1-small",
        "connectionName": "gcp-us-west1",
        "providerName": "gcp",
        "regionName": "gcp-us-west1",
        "cspSpecName": "g1-small",
        "numvCPU": 1,
        "memGiB": 1.6992188,
        "costPerHour": 0.0322,
        "evaluationScore01": 34.07
      },
      "region": {
        "RegionName": "gcp-us-west1",
        "ProviderName": "GCP",
        "KeyValueInfoList": [
          {
            "Key": "Region",
            "Value": "us-west1"
          },
          {
            "Key": "Zone",
            "Value": "us-west1-a"
          }
        ]
      },
      "systemMessage": ""
    },
    {
      "connectionConfigCandidates": [
        "azure-westus2"
      ],
      "vmSpec": {
        "namespace": "system-purpose-common-ns",
        "id": "azure-westus2-standard-a1",
        "name": "azure-westus2-standard-a1",
        "connectionName": "azure-westus2",
        "providerName": "azure",
        "regionName": "azure-westus2",
        "cspSpecName": "Standard_A1",
        "numvCPU": 1,
        "memGiB": 1.75,
        "costPerHour": 0.036,
        "evaluationScore01": 33.96
      },
      "region": {
        "RegionName": "azure-westus2",
        "ProviderName": "AZURE",
        "KeyValueInfoList": [
          {
            "Key": "ResourceGroup",
            "Value": "cb-tumblebug-azure-westus2-tb"
          },
          {
            "Key": "location",
            "Value": "westus2"
          }
        ]
      },
      "systemMessage": ""
    }
  ]
}

[입력 예시]

{
  "commonSpec": [
    "aws-ap-northl",
    "gcp-us-west1-g1-small"
  ]
}

[출력 예시] 참고: 지정한 spec 중 특정 Spec을 찾을 수 없거나 문제가 발생하면, error처리하지 않고 해당 항목에 systemMessage로 출력

{
  "reqCheck": [
    {
      "vmSpec": {
      },
      "region": {
      },
      "systemMessage": "//Failed to get the spec aws-ap-northl//Failed to get Region () for Spec (aws-ap-northl) is not found."
    },
    {
      "connectionConfigCandidates": [
        "gcp-us-west1"
      ],
      "vmSpec": {
        "namespace": "system-purpose-common-ns",
        "id": "gcp-us-west1-g1-small",
        "name": "gcp-us-west1-g1-small",
        "connectionName": "gcp-us-west1",
        "providerName": "gcp",
        "regionName": "gcp-us-west1",
        "cspSpecName": "g1-small",
        "numvCPU": 1,
        "memGiB": 1.6992188,
        "costPerHour": 0.0322,
        "evaluationScore01": 34.07,
      },
      "region": {
        "RegionName": "gcp-us-west1",
        "ProviderName": "GCP",
        "KeyValueInfoList": [
          {
            "Key": "Region",
            "Value": "us-west1"
          },
          {
            "Key": "Zone",
            "Value": "us-west1-a"
          }
        ]
      },
      "systemMessage": ""
    }
  ]
}

사소한 개선 사항

  1. spec struct에 region 등 클라우드 정보 추가
  2. SystemCommonNs string = "system-purpose-common-ns" (일반사용자가 활용하는 NS 명칭과 구분을 위해 복잡한 구성)
  3. API 경로 변경. NS가 필요 없는 API에서 NS 경로 삭제
  • POST [​/mcisDynamicCheckRequest]

  • POST [​/mcisRecommendVm]

@seokho-son
Copy link
Member Author

@jihoon-seo this PR is ready to be reviewed :)

Copy link
Member

@jihoon-seo jihoon-seo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 입니다. 😊

@jihoon-seo jihoon-seo merged commit fbf6d47 into cloud-barista:main Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants