From 1f03ae82127df5c65acf06481d651bd956fa5373 Mon Sep 17 00:00:00 2001 From: Cherie Meyer Date: Tue, 17 Oct 2017 12:39:02 -0700 Subject: [PATCH 1/6] Support skipUnreserveOnFailure option in workload profiler. --- api.go | 4 +++- runners/benchmark.go | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api.go b/api.go index eb60cf2..4302e0a 100644 --- a/api.go +++ b/api.go @@ -337,13 +337,15 @@ func (server *Server) runBenchmark(c *gin.Context) { }) return } + skipFlag := c.DefaultQuery("skipUnreserveOnFailure", "false") == "true" run, err := runners.NewSingleBenchmarkInfluxRun( applicationConfig, *benchmark, request.Intensity, request.ServiceName, - server.Config) + server.Config, + skipFlag) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{ diff --git a/runners/benchmark.go b/runners/benchmark.go index 421d4c1..f520f2e 100644 --- a/runners/benchmark.go +++ b/runners/benchmark.go @@ -61,7 +61,8 @@ func NewSingleBenchmarkInfluxRun( benchmark models.Benchmark, intensity int, serviceName string, - config *viper.Viper) (*SingleBenchmarkInfluxRun, error) { + config *viper.Viper, + skipFlag bool) (*SingleBenchmarkInfluxRun, error) { id, err := generateId("benchmarkinflux") if err != nil { return nil, errors.New("Unable to generate Id for single benchmark run: " + err.Error()) @@ -90,6 +91,7 @@ func NewSingleBenchmarkInfluxRun( ProfileLog: log, Created: time.Now(), DirectJob: false, + SkipUnreserveOnFailure: skipFlag, }, BenchmarkAgentClient: clients.NewBenchmarkAgentClient(), }, @@ -465,6 +467,6 @@ func (run *BenchmarkRun) Run(deploymentId string) error { run.ProfileLog.Logger.Infof("Store benchmark results: %s", string(b)) } } - + time.Sleep(100 * time.Minute) return nil } From 41de5b7dced63d64f72a055ab8a62b12df876840 Mon Sep 17 00:00:00 2001 From: Cherie Meyer Date: Mon, 23 Oct 2017 12:20:43 -0700 Subject: [PATCH 2/6] Changes to deploy configuration for gcp and local mongo/deployer --- documents/deployed.config | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/documents/deployed.config b/documents/deployed.config index 795b87d..205449a 100644 --- a/documents/deployed.config +++ b/documents/deployed.config @@ -1,13 +1,15 @@ { + "gcpServiceAccountJSONFile":"Users//gcpServiceAccount.json", + "gcpUserProfileBucketName":"hyperpilot-gcp-profile", "port": 7779, - "deployerUrl": "http://deployer:7777", + "deployerUrl": "http://localhost:7777", "analyzerUrl": "http://analyzer:5000", "writeResults": true, "filesPath": "/tmp/profiler", "userId": "hyperpilot", "workerCount": 5, "database": { - "url": "mongo-serve:27017", + "url": "localhost:27017", "user": "analyzer", "password": "hyperpilot", "configDatabase": "configdb", @@ -22,7 +24,7 @@ "allInstanceCollection": "allinstance" }, "store": { - "type": "simpledb", + "type": "file", "region": "us-east-1", "domainPostfix": "test" } From 9eef318371cd56873dee1bb21afccaf3c43efb08 Mon Sep 17 00:00:00 2001 From: Cherie Meyer Date: Tue, 24 Oct 2017 14:05:54 -0700 Subject: [PATCH 3/6] Accept non-200 response codes from deployer client. --- clients/deployer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/deployer.go b/clients/deployer.go index 2da79a9..9cdd585 100644 --- a/clients/deployer.go +++ b/clients/deployer.go @@ -269,7 +269,7 @@ func (client *DeployerClient) waitUntilDeploymentStateAvailable(deploymentId str } if response.StatusCode() != 200 { - return false, errors.New("Unexpected response code: " + strconv.Itoa(response.StatusCode())) + log.Infof("Unexpected response code: " + strconv.Itoa(response.StatusCode())) } if err := json.Unmarshal(response.Body(), &stateResponse); err != nil { From cb1b1bfa1b4c0563c0e0f728b35bb5067df7c13a Mon Sep 17 00:00:00 2001 From: Cherie Meyer Date: Tue, 24 Oct 2017 14:19:01 -0700 Subject: [PATCH 4/6] Accept non-200 responses from benchmark agent. --- clients/benchmark_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/benchmark_controller.go b/clients/benchmark_controller.go index de6d411..27ea6b7 100644 --- a/clients/benchmark_controller.go +++ b/clients/benchmark_controller.go @@ -196,7 +196,7 @@ func (client *BenchmarkControllerClient) RunBenchmark( } if response.StatusCode() != 200 { - return false, errors.New("Unexpected response code: " + strconv.Itoa(response.StatusCode())) + logger.Infof("Unexpected response code: " + strconv.Itoa(response.StatusCode())) } if err := json.Unmarshal(response.Body(), results); err != nil { From d605a20ac57743da43a01dd4f82e8bcb179aaded Mon Sep 17 00:00:00 2001 From: Cherie Meyer Date: Tue, 24 Oct 2017 16:00:16 -0700 Subject: [PATCH 5/6] Accept non-200 response from services. --- clients/deployer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/deployer.go b/clients/deployer.go index 9cdd585..ee86745 100644 --- a/clients/deployer.go +++ b/clients/deployer.go @@ -480,7 +480,7 @@ func (client *DeployerClient) waitUntilServiceUrlAvailable( } if response.StatusCode() != 200 { - return false, errors.New("Unexpected response code: " + strconv.Itoa(response.StatusCode())) + log.Infof("Unexpected response code: " + strconv.Itoa(response.StatusCode())) } log.Infof("%s url is now available", serviceName) From 33c2650707e7e767f1f0bd4ee42ed80a16e4e183 Mon Sep 17 00:00:00 2001 From: Cherie Meyer Date: Wed, 25 Oct 2017 12:38:34 -0700 Subject: [PATCH 6/6] Add jq to docker image. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cd9df83..3ac0698 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.4 RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 RUN apk --update upgrade && \ - apk add curl ca-certificates && \ + apk add curl ca-certificates jq && \ update-ca-certificates && \ rm -rf /var/cache/apk/* @@ -12,4 +12,4 @@ COPY workload-profiler /opt/workload-profiler/workload-profiler COPY ./documents/deployed.config /etc/workload-profiler/config.json COPY ./ui/ /opt/workload-profiler/src/github.com/hyperpilotio/workload-profiler/ui/ -CMD ["/opt/workload-profiler/workload-profiler", "-v", "1", "-logtostderr"] \ No newline at end of file +CMD ["/opt/workload-profiler/workload-profiler", "-v", "1", "-logtostderr"]