Skip to content

Commit

Permalink
Metric collector must fail on error (kubeflow#405)
Browse files Browse the repository at this point in the history
* Fail when unable to collect logs

* Set backlimit to 0 for jobs
  • Loading branch information
johnugeorge authored and k8s-ci-robot committed Feb 26, 2019
1 parent 6b75138 commit 26da3ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/metricscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,15 @@ func main() {
}
mls, err := mc.CollectWorkerLog(*workerID, *workerKind, screp.StudyConfig.ObjectiveValueName, screp.StudyConfig.Metrics, *namespace)
if err != nil {
log.Printf("Failed to collect logs: %v", err)
return
log.Fatalf("Failed to collect logs: %v", err)
}
rmreq := &api.ReportMetricsLogsRequest{
StudyId: *studyID,
MetricsLogSets: []*api.MetricsLogSet{mls},
}
_, err = c.ReportMetricsLogs(ctx, rmreq)
if err != nil {
log.Printf("Failed to Report logs: %v", err)
return
log.Fatalf("Failed to Report logs: %v", err)
}
log.Printf("Metrics reported. :\n%v", mls)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ data:
failedJobsHistoryLimit: 1
jobTemplate:
spec:
backoffLimit: 0
template:
spec:
serviceAccountName: metrics-collector
Expand Down

0 comments on commit 26da3ea

Please sign in to comment.