Skip to content

Commit 0a8f7cf

Browse files
author
Zou Nengren
authored
Reformatting (#1125)
1 parent 756358c commit 0a8f7cf

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

cli/cmd/cluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ func printInfoPricing(infoResponse *schema.InfoResponse, clusterConfig clusterco
533533
{Title: "cost per hour"},
534534
}
535535

536-
rows := [][]interface{}{}
536+
var rows [][]interface{}
537537
rows = append(rows, []interface{}{"1 eks cluster", s.DollarsMaxPrecision(eksPrice)})
538538
rows = append(rows, []interface{}{fmt.Sprintf("%d %s for your apis", numAPIInstances, s.PluralS("instance", numAPIInstances)), s.DollarsAndTenthsOfCents(totalAPIInstancePrice) + " total"})
539539
rows = append(rows, []interface{}{fmt.Sprintf("%d %dgb ebs %s for your apis", numAPIInstances, clusterConfig.InstanceVolumeSize, s.PluralS("volume", numAPIInstances)), s.DollarsAndTenthsOfCents(apiEBSPrice*float64(numAPIInstances)) + " total"})
@@ -587,7 +587,7 @@ func printInfoNodes(infoResponse *schema.InfoResponse) {
587587
{Title: "GPU (free / total)", Hidden: !doesClusterHaveGPUs},
588588
}
589589

590-
rows := [][]interface{}{}
590+
var rows [][]interface{}
591591
for _, nodeInfo := range infoResponse.NodeInfos {
592592
lifecycle := "on-demand"
593593
if nodeInfo.IsSpot {
@@ -675,7 +675,7 @@ func refreshCachedClusterConfig(awsCreds AWSCredentials, accessConfig *clusterco
675675

676676
mountedConfigPath := mountedClusterConfigPath(*accessConfig.ClusterName, *accessConfig.Region)
677677

678-
fmt.Println("syncing cluster configuration ..." + "\n")
678+
fmt.Print("syncing cluster configuration ...\n\n")
679679
out, exitCode, err := runManagerAccessCommand("/root/refresh.sh "+mountedConfigPath, *accessConfig, awsCreds, _flagClusterEnv)
680680
if err != nil {
681681
exit.Error(err)

cli/cmd/root.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ import (
3030
"github.com/spf13/cobra"
3131
)
3232

33-
var _cmdStr string
33+
var (
34+
_cmdStr string
3435

35-
var _configFileExts = []string{"yaml", "yml"}
36+
_configFileExts = []string{"yaml", "yml"}
3637

37-
var _localDir string
38-
var _cliConfigPath string
39-
var _clientIDPath string
40-
var _emailPath string
41-
var _debugPath string
42-
var _cwd string
38+
_localDir string
39+
_cliConfigPath string
40+
_clientIDPath string
41+
_emailPath string
42+
_debugPath string
43+
_cwd string
44+
)
4345

4446
type commandType int
4547

cli/local/docker_spec.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func deployPythonContainer(api *spec.API, awsClient *aws.Client) error {
144144
{
145145
Type: mount.TypeBind,
146146
Source: filepath.Join(_localWorkspaceDir, filepath.Dir(api.Key)),
147-
Target: "/mnt/workspace",
147+
Target: _workspaceDir,
148148
},
149149
},
150150
}
@@ -207,7 +207,7 @@ func deployONNXContainer(api *spec.API, awsClient *aws.Client) error {
207207
{
208208
Type: mount.TypeBind,
209209
Source: filepath.Join(_localWorkspaceDir, filepath.Dir(api.Key)),
210-
Target: "/mnt/workspace",
210+
Target: _workspaceDir,
211211
},
212212
}
213213
for _, modelCache := range api.LocalModelCaches {
@@ -347,7 +347,7 @@ func deployTensorFlowContainers(api *spec.API, awsClient *aws.Client) error {
347347
{
348348
Type: mount.TypeBind,
349349
Source: filepath.Join(_localWorkspaceDir, filepath.Dir(api.Key)),
350-
Target: "/mnt/workspace",
350+
Target: _workspaceDir,
351351
},
352352
}, mounts...),
353353
}

cli/local/get.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func GetAPIs() (schema.GetAPIsResponse, error) {
4343
return schema.GetAPIsResponse{}, err
4444
}
4545

46-
statusList := []status.Status{}
47-
metricsList := []metrics.Metrics{}
46+
var statusList []status.Status
47+
var metricsList []metrics.Metrics
4848
for _, apiSpec := range apiSpecList {
4949
apiStatus, err := GetAPIStatus(&apiSpec)
5050
if err != nil {

cli/local/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func StreamLogs(apiName string) error {
4040
return ErrorAPIContainersNotFound(apiName)
4141
}
4242

43-
containerIDs := []string{}
43+
var containerIDs []string
4444
for _, container := range containers {
4545
containerIDs = append(containerIDs, container.ID)
4646
}

cli/local/model_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func CacheModel(modelPath string, awsClient *aws.Client) (*spec.LocalModelCache,
136136
}
137137

138138
func DeleteCachedModels(apiName string, modelsToDelete []string) error {
139-
errList := []error{}
139+
var errList []error
140140
modelsInUse := strset.New()
141141
apiSpecList, err := ListAPISpecs()
142142
errList = append(errList, err)

0 commit comments

Comments
 (0)