Skip to content
Open
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand All @@ -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"]
CMD ["/opt/workload-profiler/workload-profiler", "-v", "1", "-logtostderr"]
4 changes: 3 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion clients/benchmark_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions clients/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right, waiting for deployment ready we are expecting the status code to be 200 from the deployer

}

if err := json.Unmarshal(response.Body(), &stateResponse); err != nil {
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions documents/deployed.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"gcpServiceAccountJSONFile":"Users/<user>/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",
Expand All @@ -22,7 +24,7 @@
"allInstanceCollection": "allinstance"
},
"store": {
"type": "simpledb",
"type": "file",
"region": "us-east-1",
"domainPostfix": "test"
}
Expand Down
6 changes: 4 additions & 2 deletions runners/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -90,6 +91,7 @@ func NewSingleBenchmarkInfluxRun(
ProfileLog: log,
Created: time.Now(),
DirectJob: false,
SkipUnreserveOnFailure: skipFlag,
},
BenchmarkAgentClient: clients.NewBenchmarkAgentClient(),
},
Expand Down Expand Up @@ -464,6 +466,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
}