Skip to content

Commit

Permalink
Merge pull request #937 from firesim/prep-for-main
Browse files Browse the repository at this point in the history
Update for `main` as `dev` branch
  • Loading branch information
abejgonzalez committed Feb 16, 2022
2 parents eab25ae + 7efdc00 commit a1e59d0
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/CI_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ FireSim Continuous Integration

Helpful Links:
* Workflow GUI - https://github.com/firesim/firesim/actions
* Chipyard Explanation of Github Actions (GH-A) - https://github.com/ucb-bar/chipyard/blob/dev/.github/CI_README.md
* Chipyard Explanation of Github Actions (GH-A) - https://github.com/ucb-bar/chipyard/blob/main/.github/CI_README.md

Github Actions (GH-A) Description
---------------------------------

Much of the following CI infrastructure is based on the Chipyard CI.
For a basic explanation of how the GH-A CI works, see https://github.com/ucb-bar/chipyard/blob/dev/.github/CI_README.md.
For a basic explanation of how the GH-A CI works, see https://github.com/ucb-bar/chipyard/blob/main/.github/CI_README.md.
However, there are a couple of notable differences/comments as follows:

* In order to provide a fresh environment to test changes, the CI dynamically spawns a AWS instance and sets up GH-A
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/push-scaladoc-to-ghpages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
make -C sim TARGET_PROJECT=midasexamples sbt SBT_COMMAND='set apiDirectory := \"${{ github.ref_type }}\"; ghpagesPushSite'
else
source env.sh
export SBT_GHPAGES_COMMIT_MESSAGE="[ci skip] Update scaladoc for dev:${{ github.sha }}"
export SBT_GHPAGES_COMMIT_MESSAGE="[ci skip] Update scaladoc for main:${{ github.sha }}"
make -C sim TARGET_PROJECT=midasexamples sbt SBT_COMMAND="ghpagesPushSite"
fi
shell: bash
2 changes: 0 additions & 2 deletions .github/workflows/firesim-cull-instances.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ jobs:
TERM: xterm-256-color
steps:
- uses: actions/checkout@v2
with:
ref: dev
- uses: ./.github/actions/repo-setup-aws
- run: .github/scripts/cull-old-ci-instances.py
2 changes: 1 addition & 1 deletion .github/workflows/firesim-publish-scala-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: firesim-publish-scala-doc
on:
push:
branches:
- dev
- main
tags:
- '[0-9]*.[0-9]*.[0-9]*'

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/firesim-run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: firesim-ci-process

on:
# run ci when pring to dev/master/main (note: ci runs on the merge commit of the pr!)
# run ci when pring to main (note: ci runs on the merge commit of the pr!)
pull_request:
branches:
- dev
- master
- main

env:
Expand Down
5 changes: 3 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ pull_request_rules:
- name: backport to master
conditions:
- merged
- base=dev
- base=main
- milestone=1.13.x
- label="Please Backport"
actions:
backport:
branches:
- master
- 1.13.x
ignore_conflicts: True
label_conflicts: "bp-conflict"
label:
Expand Down
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ formats: all

sphinx:
configuration: docs/conf.py
fail_on_warning: true

submodules:
exclude: all
Expand Down
46 changes: 24 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
Contributing to FireSim
=============================


### Branch management:

#### Write-Protected Branches (Require PR approval)
1) master = stable release. Documentation updates and release-exposed bug fixes can be opened against this branch.
2) dev = development branch. Substantial code changes and feature additions must be based against this branch.
1) tagged branches = stable releases. Documentation updates and release-exposed bug fixes can be opened against these branches.
2) main = development branch. Substantial code changes and feature additions must be based against this branch.

#### External Dependencies:
1) Other repos in FireSim github org: master should be the version submoduled in firesim/firesim master. Likewise, firesim/firesim dev should point at dev branches in submodules.
2) Forks in FireSim github org: master reflects newest upstream that we’ve bumped to, firesim branch that reflects what’s submoduled in firesim/firesim, firesim is the default branch of the fork
3) ucb-bar hosted dependencies (e.g. midas): firesim branch that reflects what’s submoduled in firesim, should follow the same PR discipline as merging into firesim/firesim master
1) Other repos in FireSim github org: must be pointing to tagged version in firesim/firesim tagged branch. Likewise, firesim/firesim main should point at dev/main/master branches in submodules (depending on the name of their equivalent "main" branch).
2) Forks in FireSim github org: master/main reflects newest upstream that we’ve bumped to, firesim branch that reflects what’s submoduled in firesim/firesim, firesim is the default branch of the fork
3) ucb-bar hosted dependencies: firesim branch that reflects what’s submoduled in firesim, should follow the same PR discipline as merging into firesim/firesim tagged release branch

PRs to write protected branches (master/dev) that bump submodule pointers must open PRs to the matching branch in the submodule's repository.
PRs to write protected branches (i.e main) that bump submodule pointers must open PRs to the matching branch in the submodule's repository.

#### Chipyard <-> FireSim Submodule Dependency

Chipyard subsumes FireChip as a more complete SoC development environment. In order to support a use case where either Chipyard or FireSim is clone as the top-level repository, we've introduced a circular submodule depedency between the two repositories.
Chipyard subsumes FireChip as a more complete SoC development environment.
In order to support a use case where either Chipyard or FireSim is clone as the top-level repository, we've introduced a circular submodule depedency between the two repositories.

- Firesim submodules Chipyard at `target-design/chipyard`
- Chipyard submodules Firesim at `sims/firesim`

*This only applies to circumstances in which you are making changes to both Chipyard and Firesim.*
Joint modifications to Chipyard and FireSim sources will require additional commit in at least one of the two repositories. Our recommend procedure is as follows. Commits are labeled <COMMIT_NAME>(<SUBMODULE_COMMIT_NAME>).
Joint modifications to Chipyard and FireSim sources will require additional commit in at least one of the two repositories.
Our recommend procedure is as follows.
Commits are labeled <COMMIT_NAME>(<SUBMODULE_COMMIT_NAME>).

```
Firesim:dev -> A(I) -> ... -> ?(?) E(L) Fast-forward (5)
\ \ /
Firesim:main -> A(I) -> ... -> ?(?) E(L) Fast-forward (5)
\ \ /
Firesim:feature B(J) -> ... -> C(K~1) -> D(?) -> E(L)
(1) (2) (4)
Chipyard:dev -> I(A) -> ... -> ?(?) L(D) Fast-forward (5)
\ \ /
Chipyard:feature J(A) -> ... -> K(C) -> L(D)
(1) (3)
Chipyard:main -> I(A) -> ... -> ?(?) L(D) Fast-forward (5)
\ \ /
Chipyard:feature J(A) -> ... -> K(C) -> L(D)
(1) (3)
(1) Create a feature branch and develop it. CI must pass in Chipyard.
(2) Merge firesim:dev into firesim:feature. At this point the CY submodule pointer cannot be resolved.
(3) Merge chipyard:dev into chipyard:feature. Point the firesim submodule pointer at D
(1) Create a feature branch and develop it. CI must pass in Chipyard.
(2) Merge firesim:main into firesim:feature. At this point the CY submodule pointer cannot be resolved.
(3) Merge chipyard:main into chipyard:feature. Point the firesim submodule pointer at D
(4) Bump chipyard in firesim:feature to point at E.
(5) Merge (fast-forward) feature branches into dev branches
(5) Merge (fast-forward) feature branches into main branches
```

Now, checking out commit E when using FireSim as your top-level repository, or checking out commit L if using Chipyard as your top-level repository should provide a source-identical user experience, with submodules pointing at commits on dev.
Now, checking out commit E when using FireSim as your top-level repository, or checking out commit L if using Chipyard as your top-level repository should provide a source-identical user experience, with submodules pointing at commits on main.

### AGFI Generation:

The head of dev and master branches must always have pre-generated AGFIs derived from the same sources provided by FireSim and Chipyard. Any commit that could change that would produce different RTL than was used to generate the AGFI, should rebuild, and publish freshly generated AGFIs. We do this to make it possible to bisect on commits that regenerated the AGFIs to find the source of a simulation bug, without needing to regenerate AGFIs as we bisect.
The head of main and tagged branches must always have pre-generated AGFIs derived from the same sources provided by FireSim and Chipyard. Any commit that could change that would produce different RTL than was used to generate the AGFI, should rebuild, and publish freshly generated AGFIs. We do this to make it possible to bisect on commits that regenerated the AGFIs to find the source of a simulation bug, without needing to regenerate AGFIs as we bisect.

External contributors: if you do not have the resources to regenerate all pre-built AGFIs, feel free to reach out to firesim developers.

6 changes: 3 additions & 3 deletions deploy/regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ echo "Diffing config_hwdb.ini against sample_config_hwdb.ini:"
diff config_hwdb.ini sample-backup-configs/sample_config_hwdb.ini
local_diff_rc=$?

echo "Diffing sample_config_hwdb.ini against origin/dev:"
git diff --exit-code origin/dev -- sample-backup-configs/sample_config_hwdb.ini
echo "Diffing sample_config_hwdb.ini against origin/main:"
git diff --exit-code origin/main -- sample-backup-configs/sample_config_hwdb.ini
remote_diff_rc=$?

if [[ $local_diff_rc = 0 && $remote_diff_rc = 0 ]]; then
echo "Local HWDB does not differ from origin/dev."
echo "Local HWDB does not differ from origin/main."
echo "Did you update config_hwdb.ini with new AGFIs?"
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion sim/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ lazy val firesim = (project in file("."))
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(targetutils, midas, firesimLib),
ScalaUnidoc / siteSubdirName := apiDirectory.value + "/api",
// Only delete the files in the docs branch that are in the directory were
// trying to publish to. This prevents dev-versions from blowing away
// trying to publish to. This prevents main-versions from blowing away
// tagged versions and vice versa
ghpagesCleanSite / includeFilter := new sbt.io.PrefixFilter(apiDirectory.value),
ghpagesCleanSite / excludeFilter := NothingFilter,
Expand Down

0 comments on commit a1e59d0

Please sign in to comment.