Skip to content

Commit

Permalink
Fix report push
Browse files Browse the repository at this point in the history
  • Loading branch information
satyaog committed May 27, 2024
1 parent 4ea7723 commit b6b9d51
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions milabench/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import git
from omegaconf import OmegaConf
from voir.instruments.gpu import deduce_backend, select_backend
import yaml
from milabench import ROOT_FOLDER

from milabench.alt_async import proceed
Expand Down Expand Up @@ -330,12 +329,23 @@ def _push_reports(reports_repo, runs):
}
import milabench.scripts.badges as badges

_repo = git.repo.base.Repo(ROOT_FOLDER)
try:
reports_repo = git.repo.base.Repo(str(reports_repo))
reports_repo = git.Repo(str(reports_repo))
except (git.exc.InvalidGitRepositoryError, git.exc.NoSuchPathError):
_repo = git.Repo(ROOT_FOLDER)
repo_url = next(iter(_r.url for _r in _repo.remotes if _r.name == "origin"), None)
reports_repo = git.repo.base.Repo.clone_from(repo_url, str(reports_repo), branch="reports")
reports_repo = git.Repo.clone_from(repo_url, str(reports_repo), branch="reports")
config_reader = _repo.config_reader()
config_writer = reports_repo.config_writer()
for section in config_reader.sections():
if not section.startswith("credential"):
continue
for option in config_reader.options(section):
if not option.strip("_") == option:
continue
for value in config_reader.get_values(section, option):
config_writer.add_value(section, option, value)
config_writer.write()

device_reports = {}
for run in runs:
Expand Down

0 comments on commit b6b9d51

Please sign in to comment.