findExperimentStatePath returns the first existing state.json path inside the experiment artifact directory. The file may be flattened to the run root or nested inside the artifact subdirectory.
(logsPath string)
| 49 | // artifact directory. The file may be flattened to the run root or nested inside the |
| 50 | // artifact subdirectory. |
| 51 | func findExperimentStatePath(logsPath string) string { |
| 52 | candidates := []string{ |
| 53 | filepath.Join(logsPath, "state.json"), |
| 54 | filepath.Join(logsPath, constants.ExperimentArtifactName, "state.json"), |
| 55 | } |
| 56 | for _, p := range candidates { |
| 57 | if _, err := os.Stat(p); err == nil { |
| 58 | return p |
| 59 | } |
| 60 | } |
| 61 | return "" |
| 62 | } |
| 63 | |
| 64 | // extractExperimentData reads state.json from the experiment artifact directory under |
| 65 | // logsPath and returns a populated ExperimentData or nil when no experiment artifact |
no outgoing calls