diff --git a/.github/workflows/cloud-ci.yml b/.github/workflows/cloud-ci.yml index c19954c71..b1c6e7fc6 100644 --- a/.github/workflows/cloud-ci.yml +++ b/.github/workflows/cloud-ci.yml @@ -1,4 +1,4 @@ -name: tests +name: cloud-tests on: # Runs for pull requests @@ -8,6 +8,7 @@ on: permissions: id-token: write + contents: write jobs: cloud-tests: @@ -38,7 +39,6 @@ jobs: MILABENCH_SYSTEM: "config/cloud-system.yaml" MILABENCH_BASE: "output" MILABENCH_ARGS: "" - MILABENCH_GPU_ARCH: "${{ matrix.arch }}" MILABENCH_DASH: "no" ARM_TENANT_ID: "${{ secrets.ARM_TENANT_ID }}" ARM_SUBSCRIPTION_ID: "${{ secrets.ARM_SUBSCRIPTION_ID }}" @@ -84,30 +84,17 @@ jobs: echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >>~/.aws/credentials chmod -R a-rwx,u+rwX ~/.aws ~/.ssh + - name: start covalent server + run: | + poetry run -- python3 -m milabench.scripts.covalent serve start --develop + - name: setup cloud run: | - _system=$( poetry run milabench cloud \ --setup \ - --run-on ${{ matrix.run_on }} - ) - { read _hash ; }< <( - echo -n "$_system" | while read l - do - if [[ "$l" == "# hash::>"* ]] - then - echo -n "${l#*::>}" - fi - done - echo - ) - if [[ -z "${_hash}" ]] - then - >&2 echo "Failed to fetch system config hash" - exit 1 - fi - echo -n "$_system" >$MILABENCH_SYSTEM.$_hash - echo "MILABENCH_SYSTEM=$MILABENCH_SYSTEM.$_hash" >>$GITHUB_ENV + --run-on ${{ matrix.run_on }} \ + --system "$MILABENCH_SYSTEM" >$MILABENCH_SYSTEM.${{ matrix.run_on }} + echo "MILABENCH_SYSTEM=$MILABENCH_SYSTEM.${{ matrix.run_on }}" >>$GITHUB_ENV - name: install benchmarks run: | @@ -123,10 +110,13 @@ jobs: - name: Summary run: | - # git remote set-url origin "https://${{ vars.REPORTS_USERNAME }}:${{ secrets.REPORTS_PAT }}@$(git remote get-url origin | cut -d'/' -f3-)" - git config --global user.email "github-ci@example.com" + git config credential.${{ github.server_url }}.username ${{ github.actor }} + git config credential.helper '!f() { test "$1" = get && echo "password=$GITHUB_TOKEN"; }; f' + git config --global user.email "github@ci.com" git config --global user.name "GitHub CI" poetry run milabench report --push + env: + GITHUB_TOKEN: ${{ github.token }} - name: teardown cloud if: always() @@ -139,3 +129,8 @@ jobs: --teardown \ --run-on ${{ matrix.run_on }} \ --all + + - name: debug logs + if: always() + run: | + cat ~/.cache/covalent/covalent_ui.log diff --git a/milabench/common.py b/milabench/common.py index f3bd698dc..03bc08028 100644 --- a/milabench/common.py +++ b/milabench/common.py @@ -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 @@ -337,20 +336,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_url = ([ - url for _r in _repo.remotes for url in _r.urls if "mila-iqia" in url - ] or [ - url for _r in _repo.remotes for url in _r.urls if _r.name == "origin" - ])[0] - reports_url = XPath("github.com".join(reports_url.split("github.com")[1:])[1:]) - reports_url = XPath("https://github.com") / f"{reports_url.with_suffix('')}/tree/{reports_repo.active_branch.name}" + 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: @@ -410,7 +412,6 @@ def _push_reports(reports_repo, runs): "--left-text", device, "--right-text", text, "--right-color", _SVG_COLORS[text], - "--whole-link", str(reports_url / build / device) ], capture_output=True, check=True