Fix PR issues [ci skip]

This commit is contained in:
abejgonzalez 2023-05-12 00:19:25 -07:00
parent 21928f7e8d
commit a336720520
2 changed files with 15 additions and 8 deletions

View File

@ -12,6 +12,9 @@ from ci_variables import ci_env
def run_agfi_buildbitstream(): def run_agfi_buildbitstream():
""" Runs AGFI buildbitstream""" """ Runs AGFI buildbitstream"""
relative_hwdb_path = f"deploy/sample-backup-configs/sample_config_hwdb.yaml"
relative_build_path = f"deploy/sample-backup-configs/sample_config_build.yaml"
with prefix(f'cd {manager_fsim_dir} && source sourceme-f1-manager.sh'): with prefix(f'cd {manager_fsim_dir} && source sourceme-f1-manager.sh'):
rc = 0 rc = 0
@ -27,11 +30,14 @@ def run_agfi_buildbitstream():
sys.exit(rc) sys.exit(rc)
else: else:
# parse the output yamls, replace the sample hwdb's agfi line only # parse the output yamls, replace the sample hwdb's agfi line only
sample_hwdb_filename = f"{manager_fsim_dir}/deploy/sample-backup-configs/sample_config_hwdb.yaml" sample_hwdb_filename = f"{manager_fsim_dir}/{relative_hwdb_path}"
hwdb_entry_dir = f"{manager_fsim_dir}/deploy/built-hwdb-entries" hwdb_entry_dir = f"{manager_fsim_dir}/deploy/built-hwdb-entries"
built_hwdb_entries = [x for x in os.listdir(hwdb_entry_dir) if os.path.isfile(os.path.join(hwdb_entry_dir, x))] built_hwdb_entries = [x for x in os.listdir(hwdb_entry_dir) if os.path.isfile(os.path.join(hwdb_entry_dir, x))]
for hwdb in built_hwdb_entries: for hwdb in built_hwdb_entries:
print(f"Printing {hwdb}")
run(f"cat {hwdb}")
sample_hwdb_lines = open(sample_hwdb_filename).read().split('\n') sample_hwdb_lines = open(sample_hwdb_filename).read().split('\n')
with open(sample_hwdb_filename, "w") as sample_hwdb_file: with open(sample_hwdb_filename, "w") as sample_hwdb_file:
@ -61,7 +67,7 @@ def run_agfi_buildbitstream():
run(f"cat {sample_hwdb_filename}") run(f"cat {sample_hwdb_filename}")
# share agfis # share agfis
sample_build_filename = f"{manager_fsim_dir}/deploy/sample-backup-configs/sample_config_build.yaml" sample_build_filename = f"{manager_fsim_dir}/{relative_build_path}"
sample_build_lines = open(sample_build_filename).read().split('\n') sample_build_lines = open(sample_build_filename).read().split('\n')
with open(sample_build_filename, "w") as sample_build_file: with open(sample_build_filename, "w") as sample_build_file:
for line in sample_build_lines: for line in sample_build_lines:
@ -78,6 +84,9 @@ def run_agfi_buildbitstream():
run(f"firesim shareagfi -a {sample_hwdb_filename} -b {sample_build_filename}") run(f"firesim shareagfi -a {sample_hwdb_filename} -b {sample_build_filename}")
# copy back to workspace area so you can PR it
run(f"cp -f {sample_hwdb_filename} {ci_env['GITHUB_WORKSPACE']}/{relative_hwdb_path}")
if __name__ == "__main__": if __name__ == "__main__":
set_fabric_firesim_pem() set_fabric_firesim_pem()
execute(run_agfi_buildbitstream, hosts=["localhost"]) execute(run_agfi_buildbitstream, hosts=["localhost"])

View File

@ -392,15 +392,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Run buildbitstream command and update sample AGFIs - name: Run buildbitstream command and update sample AGFIs
run: .github/scripts/run-agfi-buildbitstream.py run: .github/scripts/run-agfi-buildbitstream.py
- uses: peter-evans/create-pull-request@v4 - uses: peter-evans/create-pull-request@v5
with: with:
# must align with `manager_fsim_dir/MANAGER_FIRESIM_LOCATION`
cwd: '/home/centos/firesim'
add-paths: | add-paths: |
'deploy/sample-backup-configs/sample_config_hwdb.yaml' 'deploy/sample-backup-configs/sample_config_hwdb.yaml'
commit-message: "Update AGFI(s)" commit-message: "Update AGFI(s)"
branch-suffix: short-commit-hash branch-suffix: short-commit-hash
title: "Update AGFI(s) for ${{ env.GITHUB_REF_NAME }}" title: "Update AGFI(s) for ${{ github.ref_name }}"
# TODO: Re-enable and just post bitstreams into a GH repo # TODO: Re-enable and just post bitstreams into a GH repo
#run-xclbin-buildbitstream: #run-xclbin-buildbitstream:
@ -420,13 +418,13 @@ jobs:
# - uses: ./.github/actions/repo-setup-aws # - uses: ./.github/actions/repo-setup-aws
# - name: Run buildbitstream command and update sample xclbins # - name: Run buildbitstream command and update sample xclbins
# run: .github/scripts/run-xclbin-buildbitstream.py # run: .github/scripts/run-xclbin-buildbitstream.py
# - uses: peter-evans/create-pull-request@v4 # - uses: peter-evans/create-pull-request@v5
# with: # with:
# add-paths: | # add-paths: |
# 'deploy/sample-backup-configs/sample_config_hwdb.yaml' # 'deploy/sample-backup-configs/sample_config_hwdb.yaml'
# commit-message: "Update xclbin(s)" # commit-message: "Update xclbin(s)"
# branch-suffix: short-commit-hash # branch-suffix: short-commit-hash
# title: "Update xclbin(s) for ${{ env.GITHUB_REF_NAME }}" # title: "Update xclbin(s) for ${{ github.ref_name }}"
run-vitis-check-docs-generated-components: run-vitis-check-docs-generated-components:
name: run-vitis-check-docs-generated-components name: run-vitis-check-docs-generated-components