Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag AGFI with sha of toplevel repo #1166

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

timsnyder-siv
Copy link
Collaborator

Similar to how we changed repo_state_summary.sh to create repo_state file from
the toplevel git superproject, generate the commit tag for the AGFI from the toplevel
repo.

Add firesim_origin and top_origin tags to contain URL for those repos.

Add ispushed tags to indicate whether the commit existed on respective origin at the
time the AGFI was created.

Related PRs / Issues

Rewrite of #936. h/t @filipstamenkovic-sifive for doing the rewrite!

UI / API Impact

Adds tags to AGFIs to aid in reproducing builds where Firesim is not the toplevel repo (Chipyard-as-top, etc).

Also adds tags to indicate whether the hash was pushed to a remote named origin or not at the time of build.

Adds util.git module to the firesim python for doing some of the tag introspection.

Verilog / AGFI Compatibility

Doesn't

Contributor Checklist

  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you add Scaladoc/docstring/doxygen to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous prints/debugging code?
  • Did you state the UI / API impact?
  • Did you specify the Verilog / AGFI compatibility impact?
  • If applicable, did you regenerate and publicly share default AGFIs?
  • If applicable, did you apply the ci:fpga-deploy label?
  • If applicable, did you apply the Please Backport label?

Reviewer Checklist (only modified by reviewer)

  • Is the title suitable for inclusion in the changelog and does the PR have a changelog:<topic> label?
  • Did you mark the proper release milestone?
  • Did you check whether all relevant Contributor checkboxes have been checked?

@timsnyder-siv
Copy link
Collaborator Author

@Mergifyio rebase

Similar to how we changed repo_state_summary.sh to create repo_state file from
the toplevel git superproject, generate the commit tag for the AGFI from the toplevel
repo.

Add firesim_origin and top_origin tags to contain URL for those repos.

Add ispushed tags to indicate whether the commit existed on respective origin at the
time the AGFI was created.
@mergify
Copy link
Contributor

mergify bot commented Aug 10, 2022

rebase

✅ Branch has been successfully rebased

@timsnyder-siv
Copy link
Collaborator Author

@filipstamenkovic-sifive , I figured out that the pytests are faling because they are being run in a clone of a local directory, not the clone of the github repo: https://github.com/firesim/firesim/runs/7870074673?check_suite_focus=true#step:4:18. This breaks assumptions I was making about testing in something that was cloned from github (or at least from a server).

I'll think some more about this.

git's behavior has become more complex and it doesn't always
have a ref/remotes/<name>/HEAD created for each remote

Instead of resolving the tracking ref using rev-parse, use ls-remote.
between 2.24.4 and 2.37.2 git stopped paying attention to uploadpack.allowReachableSH1InWant
for clones that have origin in the same local filesystem.  Remove the logic
that deals with setting uploadpack.allowReachableSHA1InWant in test_git_is_pushed
class TestGitAssumptions:
"""Test git features that we depend on"""

def test_git_fetch_pack_for_unadvertised_sha(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abejgonzalez can you help me understand why we need to create a second-level of clone in the CI scripts.? See:

# copy ci version of the repo into the new globally accessible location
run("git clone {} {}".format(ci_workdir, manager_fsim_dir))

This test is checking that the behavior of github (or whatever server the project is using to host the repo) but it assumes that we're in a clone that has origin set to the server we care about.

The test currently passes but it isn't testing anything because the clone it is running in was cloned from another directory on the CI host and not the actual github repository. It actually doesn't pass because of a race condition that I introduced by looking at the remote for the default branch instead of at the local repo.

I'm thinking that removal of the is_pushed part of this PR may be the best way forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants