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

Update to enable disk type settings #1122

Merged
merged 4 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
707 changes: 308 additions & 399 deletions assets/cloudspec.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/runSpider.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

CONTAINER_NAME_READ="CB-Spider"
CONTAINER_VERSION="0.5.3"
CONTAINER_VERSION="0.5.6-p1"
CONTAINER_PORT="-p 1024:1024 -p 2048:2048"
CONTAINER_DATA_PATH="/root/go/src/github.com/cloud-barista/cb-spider/meta_db"

Expand Down
39 changes: 0 additions & 39 deletions src/api/grpc/request/mcirapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,45 +130,6 @@ type TbSpecInfoRequest struct {
Item core_mcir.TbSpecInfo `yaml:"spec" json:"spec"`
}

// TbSpecInfo
// type TbSpecInfo struct { // Tumblebug
// Namespace string `json:"namespace"` // required to save in RDB
// Id string `json:"id"`
// Name string `json:"name"`
// ConnectionName string `json:"connectionName"`
// CspSpecName string `json:"cspSpecName"`
// OsType string `json:"osType"`
// NumvCPU uint16 `json:"numvCPU"`
// NumCore uint16 `json:"numCore"`
// MemGiB uint16 `json:"memGiB"`
// StorageGiB uint32 `json:"storageGiB"`
// Description string `json:"description"`
// CostPerHour float32 `json:"costPerHour"`
// NumStorage uint8 `json:"numStorage"`
// MaxNumStorage uint8 `json:"maxNumStorage"`
// MaxTotalStorageTiB uint16 `json:"maxTotalStorageTiB"`
// NetBwGbps uint16 `json:"netBwGbps"`
// EbsBwMbps uint32 `json:"ebsBwMbps"`
// GpuModel string `json:"gpuModel"`
// NumGpu uint8 `json:"numGpu"`
// GpuMemGiB uint16 `json:"gpuMemGiB"`
// GpuP2p string `json:"gpuP2p"`
// OrderInFilteredResult uint16 `json:"orderInFilteredResult"`
// EvaluationStatus string `json:"evaluationStatus"`
// EvaluationScore01 float32 `json:"evaluationScore01"`
// EvaluationScore02 float32 `json:"evaluationScore02"`
// EvaluationScore03 float32 `json:"evaluationScore03"`
// EvaluationScore04 float32 `json:"evaluationScore04"`
// EvaluationScore05 float32 `json:"evaluationScore05"`
// EvaluationScore06 float32 `json:"evaluationScore06"`
// EvaluationScore07 float32 `json:"evaluationScore07"`
// EvaluationScore08 float32 `json:"evaluationScore08"`
// EvaluationScore09 float32 `json:"evaluationScore09"`
// EvaluationScore10 float32 `json:"evaluationScore10"`
// AssociatedObjectList []string `json:"associatedObjectList"`
// IsAutoGenerated bool `json:"isAutoGenerated"`
// }

// TbSshKeyCreateRequest is for Wrapper struct
type TbSshKeyCreateRequest struct {
NsId string `yaml:"nsId" json:"nsId"`
Expand Down
23 changes: 21 additions & 2 deletions src/core/mcir/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,23 @@ func LoadCommonResource() (common.IdList, error) {
// RandomSleep for safe parallel executions
common.RandomSleep(0, 20)
specReqTmp := TbSpecReq{}
// [0]connectionName, [1]cspSpecName, [2]CostPerHour, [3]evaluationScore01, ..., [12]evaluationScore10
// 0 providerName
// 1 regionName
// 2 connectionName
// 3 cspSpecName
// 4 CostPerHour
// 5 evaluationScore01
// 6 evaluationScore02
// 7 evaluationScore03
// 8 evaluationScore04
// 9 evaluationScore05
// 10 evaluationScore06
// 11 evaluationScore07
// 12 evaluationScore08
// 13 evaluationScore09
// 14 evaluationScore10
// 15 rootDiskType
// 16 rootDiskSize
specReqTmp.ConnectionName = row[2]
specReqTmp.CspSpecName = row[3]
// Give a name for spec object by combining ConnectionName and CspSpecName
Expand All @@ -1409,9 +1425,10 @@ func LoadCommonResource() (common.IdList, error) {

// Update registered Spec object with ProviderName
providerName := row[0]

// Update registered Spec object with RegionName
regionName := row[1]
rootDiskType := row[15]
rootDiskSize := row[16]

// Update registered Spec object with Cost info
costPerHour, err2 := strconv.ParseFloat(strings.ReplaceAll(row[4], " ", ""), 32)
Expand All @@ -1433,6 +1450,8 @@ func LoadCommonResource() (common.IdList, error) {
ProviderName: providerName,
RegionName: regionName,
CostPerHour: float32(costPerHour),
RootDiskType: rootDiskType,
RootDiskSize: rootDiskSize,
EvaluationScore01: float32(evaluationScore01),
}

Expand Down
2 changes: 2 additions & 0 deletions src/core/mcir/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ type TbSpecInfo struct { // Tumblebug
EvaluationScore08 float32 `json:"evaluationScore08"`
EvaluationScore09 float32 `json:"evaluationScore09"`
EvaluationScore10 float32 `json:"evaluationScore10"`
RootDiskType string `json:"rootDiskType"`
RootDiskSize string `json:"rootDiskSize"`
AssociatedObjectList []string `json:"associatedObjectList,omitempty"`
IsAutoGenerated bool `json:"isAutoGenerated,omitempty"`

Expand Down
21 changes: 0 additions & 21 deletions src/testclient/scripts/misc/gen-csv-image.sh

This file was deleted.

35 changes: 35 additions & 0 deletions src/testclient/scripts/misc/gen-csv-spec-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

echo "####################################################################"
echo "## Gen csv file from script config"
echo "####################################################################"

source ../init.sh

PRINT="ProviderName,connectionName,cspImageId,OsType"
echo "${PRINT}"
echo "${PRINT}" >./cloudimage.csv

INDEXX=${TotalNumCSP}
for ((cspi = 1; cspi <= INDEXX; cspi++)); do
INDEXY=${TotalNumRegion[$cspi]}
for ((cspj = 1; cspj <= INDEXY; cspj++)); do
PRINT="${ProviderName[$cspi]},${CONN_CONFIG[$cspi,$cspj]},${IMAGE_NAME[$cspi,$cspj]},${IMAGE_TYPE[$cspi,$cspj]}"
echo "$PRINT"
echo "$PRINT" >>./cloudimage.csv
done
done

PRINT="providerName,regionName,connectionName,cspSpecName,CostPerHour,evaluationScore01,evaluationScore02,evaluationScore03,evaluationScore04,evaluationScore05,evaluationScore06,evaluationScore07,evaluationScore08,evaluationScore09,evaluationScore10,rootDiskType,rootDiskSize"
echo "${PRINT}"
echo "${PRINT}" >./cloudspec.csv

INDEXX=${TotalNumCSP}
for ((cspi = 1; cspi <= INDEXX; cspi++)); do
INDEXY=${TotalNumRegion[$cspi]}
for ((cspj = 1; cspj <= INDEXY; cspj++)); do
PRINT="${ProviderName[$cspi]},${RegionName[$cspi,$cspj]},${CONN_CONFIG[$cspi,$cspj]},${SPEC_NAME[$cspi,$cspj]},,,,,,,,,,,${DISK_TYPE[$cspi,$cspj]},${DISK_SIZE[$cspi,$cspj]}"
echo "$PRINT"
echo "$PRINT" >>./cloudspec.csv
done
done