Skip to content

Commit

Permalink
Resolve SYSINFRA-2039 "/run reflow without taskdb" (grailbio/grail!7409)
Browse files Browse the repository at this point in the history
Approved-by: Pedro Fialho <pfialho@grailbio.com>

GitLab URL: https://gitlab.com/grailbio/grail/-/merge_requests/7409

fbshipit-source-id: 625523f
  • Loading branch information
Yasmin Salmasi authored and fialhopm committed Dec 6, 2022
1 parent f5f28ec commit 04b01f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ func PredictorConfig(cfg infra.Config, validate bool) (*infra2.PredictorConfig,
sess *session.Session
tdb taskdb.TaskDB
)
// Predictor config is optional.
if err := cfg.Instance(&predConfig); err != nil {
return nil, nil
}
if err := cfg.Instance(&tdb); err != nil {
return nil, errors.E("predictor config: no taskdb", err)
}
if err := cfg.Instance(&predConfig); err != nil {
return nil, errors.E("predictor config: no predconfig", err)
}
if err := cfg.Instance(&sess); err != nil {
return nil, errors.E("predictor config: session", err)
}
Expand Down
4 changes: 4 additions & 0 deletions tool/pred.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Valid values for -name are "mem" and "duration".
if err != nil {
c.Fatal(err)
}
if cfg == nil {
c.Fatalf("missing predictor config")
}

var tdb taskdb.TaskDB
if err := c.Config.Instance(&tdb); err != nil {
c.Fatalf("pred needs taskdb: %v", err)
Expand Down

0 comments on commit 04b01f7

Please sign in to comment.