fetch capacity and simulate task fitting

This commit is contained in:
nhatle 2022-07-26 11:00:07 -07:00
parent 66bd6308ce
commit 2ca005eea8
6 changed files with 167 additions and 1 deletions

View file

@ -118,6 +118,26 @@ func UnmarshalJob(filename string) (Job, error) {
return job, nil
}
func UnmarshalTaskConfig(filename string) (*aurora.TaskConfig, error) {
if jobsFile, err := os.Open(filename); err != nil {
return nil, errors.Wrap(err, "unable to read the task config file")
} else {
job := Job{}
if err := yaml.NewDecoder(jobsFile).Decode(&job); err != nil {
return nil, errors.Wrap(err, "unable to parse task config file")
}
if auroraJob, err := job.ToRealis(); err != nil {
return nil, errors.Wrap(err, "unable to parse task config file")
} else {
return auroraJob.JobConfig().TaskConfig, nil
}
}
return nil, nil
}
func UnmarshalUpdate(filename string) (UpdateJob, error) {
updateJob := UpdateJob{}