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

Enhance capability of mcis recommendation #833

Merged
merged 7 commits into from
Oct 10, 2021

Conversation

seokho-son
Copy link
Member

@seokho-son seokho-son commented Oct 8, 2021

Key improvements,

  • Revive benchmark agent (fix error, deployment test, refine source code)

  • Add common spec register feature (load common specs from assets/cloudspec.csv file)

    GET ​/loadCommonResource (Load Common Resources from internal asset files) in [Admin] Cloud environment management
    Generate TB Spec objects from the items in assets/cloudspec.csv (it is temporal list of specs)
    image

  • Add cost-based recommend feature (enhance API)

    POST ​/ns​/{nsId}​/testRecommendVm Recommend MCIS plan (filter and priority)

    {
      "filter": {
        "policy": [
          {
            "condition": [
              {
                "operand": "0.5",
                "operator": "<="
              }
            ],
            "metric": "cost"
          }
        ]
      },
      "limit": "500",
      "priority": {
        "policy": [
          {
            "metric": "cost",
            "weight": "0.3"
          }
        ]
      }
    }
    

    Output

    [
      {
        "namespace": "common",
        "id": "aws-ap-ne-1-t2-micro",
        "name": "aws-ap-ne-1-t2-micro",
        "connectionName": "aws-ap-ne-1",
        "cspSpecName": "t2.micro",
        "numvCPU": 1,
        "memGiB": 1,
        "costPerHour": 0.41,
        "orderInFilteredResult": 1,
        "evaluationScore01": 0.9804762
      },
      {
        "namespace": "common",
        "id": "aws-ap-ne-1-m1-small",
        "name": "aws-ap-ne-1-m1-small",
        "connectionName": "aws-ap-ne-1",
        "cspSpecName": "m1.small",
        "numvCPU": 1,
        "memGiB": 1,
        "costPerHour": 0.42,
        "orderInFilteredResult": 2,
        "evaluationScore01": 0.98
      },
      {
        "namespace": "common",
        "id": "gcp-as-ne3-g1-small",
        "name": "gcp-as-ne3-g1-small",
        "connectionName": "gcp-as-ne3",
        "cspSpecName": "g1-small",
        "numvCPU": 1,
        "memGiB": 1,
        "costPerHour": 0.42,
        "orderInFilteredResult": 3,
        "evaluationScore01": 0.98
      },
    ...
    

@seokho-son seokho-son requested a review from jihoon-seo as a code owner October 8, 2021 22:05
@seokho-son
Copy link
Member Author

@jihoon-seo 핫... 엄청 일찍 일어나셨군요

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.

@seokho-son 지금 시간까지 작업을 하셨군요.. 😮
완전 자세하게 보지는 못했지만..
LGTM 입니다~~

@@ -174,9 +177,9 @@ func ApiServer(port string) {

g.POST("/:nsId/cmd/mcis/:mcisId", rest_mcis.RestPostCmdMcis)
g.POST("/:nsId/cmd/mcis/:mcisId/vm/:vmId", rest_mcis.RestPostCmdMcisVm)
g.POST("/:nsId/install/mcis/:mcisId", rest_mcis.RestPostInstallAgentToMcis)
g.POST("/:nsId/installBenchmarkAgent/mcis/:mcisId", rest_mcis.RestPostInstallBenchmarkAgentToMcis)
Copy link
Member

Choose a reason for hiding this comment

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

testclient/scripts/9.monitoring/install-agent.sh 를 보니

CB-Dragonfly 모니터링 에이전트를 설치하는 CB-TB REST API는
POST http://$TumblebugServer/tumblebug/ns/$NSID/monitoring/install/mcis/$MCISID 이고

이 PR에서 다루는 Milkyway 벤치마크 에이전트를 설치하는 CB-TB REST API는
POST("/:nsId/installBenchmarkAgent/mcis/:mcisId" 로 변경되어서

좀 더 명확하게 구분이 되겠네요 😊

content := AgentInstallContentWrapper{}

//install script
// SSH command to install benchmarking agent
cmd := "wget https://github.com/cloud-barista/cb-milkyway/raw/master/src/milkyway -O ~/milkyway; chmod +x ~/milkyway; ~/milkyway > /dev/null 2>&1 & netstat -tulpn | grep milkyway"
Copy link
Member

Choose a reason for hiding this comment

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

현재 이렇게 되어 있으면
메인테이너가 milkyway 바이너리 파일을 git tree 에 올려놓고 업데이트해야 하는데,
이렇게 하는 것 보다는

적당한 시점마다 release를 찍고
각 release article에 milkyway 바이너리 파일을 올리고
그 링크 주소를 따서 이용하는 것은 어떨까요? 😊

Copy link
Member Author

Choose a reason for hiding this comment

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

네^^ 바이너리를 저렇게 쓰는 건 바람직 하지 않네요. 향후에 개선해보면 좋을 것 같습니다!
일단 ~ 밀키웨이 관련해서는 코드가 임시 상태라고 보시면;; 되겠습니다. 테스트 용도로 활용을 좀 하려고요 ㅎㅎ

@seokho-son
Copy link
Member Author

관련된 추가 기능 개발을 위해서~~ 우선 승인하고자 합니다..^^
(다른 커밋들과 합쳐서 정상 동작 여부 확인을 해봐야 할 것 같아요)
추가 리뷰 의견을 주시면 차후에 반영하는 PR을 올리도록 하겠습니다!

@seokho-son
Copy link
Member Author

/approve

@seokho-son seokho-son merged commit 1518830 into cloud-barista:main Oct 10, 2021
@jihoon-seo jihoon-seo added the hacktoberfest-accepted hacktoberfest-accepted label Oct 14, 2021
@jihoon-seo jihoon-seo mentioned this pull request Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants