From a5a90f49113fba27cf53066a22d486ce901660c4 Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Sat, 13 Mar 2021 15:35:18 -0700 Subject: [PATCH 01/11] [CI/CD] Docker login bugfixing --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 586a22730..9b81db480 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,7 +181,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to GitHub Container Registry - if: ${{ github.ref == 'refs/heads/master' || needs.change_detect.outputs.force_upload }} + if: ${{ (github.ref == 'refs/heads/master') || (needs.change_detect.outputs.force_upload == true) }} uses: docker/login-action@v1 with: registry: ghcr.io From 1017a6a619961f753a1ead77929a1929d9202945 Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Mon, 11 Oct 2021 13:52:31 +0000 Subject: [PATCH 02/11] Fixing small typo in openfpga.sh --- openfpga.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfpga.sh b/openfpga.sh index f0ab701ee..a00b8adbd 100755 --- a/openfpga.sh +++ b/openfpga.sh @@ -21,7 +21,7 @@ if [ -z $PYTHON_EXEC ]; then export PYTHON_EXEC="python3"; fi # inside current OpendFPGA folder check_execution_path (){ if [[ $1 != *"${OPENFPGA_PATH}"* ]]; then - echo -e "\e[33mCommand is not executed from configured OPNEFPGA directory\e[0m" + echo -e "\e[33mCommand is not executed from configured OPENFPGA directory\e[0m" fi } From d411967159f96034940e0b2ebebbfcbd11caf097 Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Fri, 15 Oct 2021 10:01:12 +0000 Subject: [PATCH 03/11] Fixing small typo in run_fpga_flow.py --- openfpga_flow/scripts/run_fpga_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfpga_flow/scripts/run_fpga_flow.py b/openfpga_flow/scripts/run_fpga_flow.py index a333ebb8f..7bacbb181 100644 --- a/openfpga_flow/scripts/run_fpga_flow.py +++ b/openfpga_flow/scripts/run_fpga_flow.py @@ -271,7 +271,7 @@ def main(): if (args.fpga_flow == "vpr_blif"): collect_files_for_vpr() - logger.info("Runing OpenFPGA Shell Engine ") + logger.info("Running OpenFPGA Shell Engine ") run_openfpga_shell() if args.end_flow_with_test: run_netlists_verification() From c3dd704bf349a0746dfa36baebf48ae79cbd9282 Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Mon, 18 Oct 2021 09:13:42 +0000 Subject: [PATCH 04/11] Fixing typo in run_fpga_flow.py --- openfpga_flow/scripts/run_fpga_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfpga_flow/scripts/run_fpga_flow.py b/openfpga_flow/scripts/run_fpga_flow.py index 7bacbb181..ff62a5522 100644 --- a/openfpga_flow/scripts/run_fpga_flow.py +++ b/openfpga_flow/scripts/run_fpga_flow.py @@ -347,7 +347,7 @@ def validate_command_line_arguments(): - Activity file - Base verilog file ''' - logger.info("Validating commnad line arguments") + logger.info("Validating command line arguments") if args.debug: logger.info("Setting loggger in debug mode") From c42acec81e87f8fc348f9f3fea7478da3bb795fc Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Mon, 18 Oct 2021 10:45:35 +0000 Subject: [PATCH 05/11] Fixing python string formatting: clean_up_and_exit calls in run_fpga_flow.py --- openfpga_flow/scripts/run_fpga_flow.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/openfpga_flow/scripts/run_fpga_flow.py b/openfpga_flow/scripts/run_fpga_flow.py index ff62a5522..93883d330 100644 --- a/openfpga_flow/scripts/run_fpga_flow.py +++ b/openfpga_flow/scripts/run_fpga_flow.py @@ -304,7 +304,7 @@ def check_required_file(): } for filename, filepath in files_dict.items(): if not os.path.isfile(filepath): - clean_up_and_exit("Not able to locate deafult file " + filename) + clean_up_and_exit("Not able to locate default file " + filename) def read_script_config(): @@ -363,19 +363,19 @@ def validate_command_line_arguments(): dependent = dependent.split(",") for eachdep in dependent: if not any([getattr(args, i, 0) for i in eachdep.split("|")]): - clean_up_and_exit("'%s' argument depends on (%s) argumets" % + clean_up_and_exit("'%s' argument depends on (%s) arguments" % (eacharg, ", ".join(dependent).replace("|", " or "))) # Check if architecrue files exists args.arch_file = os.path.abspath(args.arch_file) if not os.path.isfile(args.arch_file): clean_up_and_exit( - "VPR architecture file not found. -%s", + "VPR architecture file not found. -%s"% args.arch_file) args.openfpga_arch_file = os.path.abspath(args.openfpga_arch_file) if not os.path.isfile(args.openfpga_arch_file): clean_up_and_exit( - "OpenFPGA architecture file not found. -%s", + "OpenFPGA architecture file not found. -%s"% args.openfpga_arch_file) # Filter provided benchmark files @@ -389,14 +389,14 @@ def validate_command_line_arguments(): for everyfile in glob.glob(args.benchmark_files[index]): if not os.path.isfile(everyfile): clean_up_and_exit( - "Failed to copy benchmark file-%s", args.arch_file) + "Failed to copy benchmark file -%s" % args.arch_file) # Filter provided powertech files if args.power_tech: args.power_tech = os.path.abspath(args.power_tech) if not os.path.isfile(args.power_tech): clean_up_and_exit( - "Power Tech file not found. -%s", args.power_tech) + "Power Tech file not found. -%s" % args.power_tech) # Expand run directory to absolute path args.run_dir = os.path.abspath(args.run_dir) @@ -805,7 +805,8 @@ def filter_openfpga_output(vpr_output): def filter_failed_process_output(vpr_output): for line in vpr_output.split("\n"): - if "error" in line.lower(): + elements_to_log = ["error", "what()"] + if any(match in line.lower() for match in elements_to_log): logger.error("-->>" + line) From d37ae8a8c5d77bdf41f07cb4663e63d1dccfaf20 Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Mon, 18 Oct 2021 11:20:14 -0600 Subject: [PATCH 06/11] Changed docker repo to github repository --- .github/workflows/build.yml | 10 +++++----- .github/workflows/docker.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77ccb1527..d99b23355 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: if: ${{ fromJSON(needs.change_detect.outputs.source_modified) }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} + container: ghcr.io/${{ github.repository_owner }}/openfpga-build-${{ matrix.config.cc}} # Branch on different OS and settings strategy: fail-fast: false @@ -194,12 +194,12 @@ jobs: file: ./docker/Dockerfile.master push: ${{ github.ref == 'refs/heads/master' || needs.change_detect.outputs.force_upload }} tags: | - ghcr.io/lnis-uofu/openfpga-master:latest - ghcr.io/lnis-uofu/openfpga-master:${{ needs.change_detect.outputs.sha_short }} + ghcr.io/${{github.repository_owner}}/openfpga-master:latest + ghcr.io/${{github.repository_owner}}/openfpga-master:${{ needs.change_detect.outputs.sha_short }} linux_regression_tests: name: linux_regression_tests runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-env + container: ghcr.io/${{github.repository_owner}}/openfpga-env needs: linux_build strategy: fail-fast: false @@ -248,7 +248,7 @@ jobs: if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: docker_regression_tests runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-master:latest + container: ghcr.io/${{github.repository_owner}}/openfpga-master:latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bfce9fc79..d51cf1120 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -24,14 +24,14 @@ jobs: context: . file: ./docker/Dockerfile.base push: true - tags: ghcr.io/lnis-uofu/openfpga-build-base:latest + tags: ghcr.io/${{ github.repository_owner }}/openfpga-build-base:latest - name: Build environment image uses: docker/build-push-action@v2 with: context: . file: ./docker/Dockerfile.env push: true - tags: ghcr.io/lnis-uofu/openfpga-env:latest + tags: ghcr.io/${{ github.repository_owner }}/openfpga-env:latest compiler_images: name: Build ${{ matrix.compiler }} compiler image needs: base_images @@ -65,4 +65,4 @@ jobs: context: . file: ./docker/Dockerfile.${{ matrix.compiler }} push: true - tags: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.compiler }}:latest + tags: ghcr.io/${{ github.repository_owner }}/openfpga-build-${{ matrix.compiler }}:latest From fdc9e318fdc30c972e6c3e42c20dd8a5efff9ef8 Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Mon, 18 Oct 2021 11:55:43 -0600 Subject: [PATCH 07/11] [CI] Addding conditional docker push --- .github/workflows/build.yml | 21 ++++++++++++++++----- .github/workflows/docker.yml | 26 +++++++++++++++++++++----- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d99b23355..69d9f8fae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,8 @@ env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release MAKEFLAGS: "-j8" + DOCKER_REPO: ${{ secrets.DOCKER_REPO }} + REPO_OWNER: ${{ github.repository_owner }} # Multiple job to tests jobs: @@ -24,6 +26,7 @@ jobs: source_modified: ${{ steps.changes.outputs.status_code == '1' }} force_upload: false sha_short: ${{ steps.changes.outputs.sha_short }} + docker_repo: ${{ steps.changes.outputs.docker_repo }} steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 @@ -43,14 +46,22 @@ jobs: echo "Current brnach is master forcing source_modified" echo "::set-output name=status_code::1" fi + if [[ -n "${DOCKER_REPO}" ]]; then + echo "name=docker_repo::$DOCKER_REPO" + echo "::set-output name=docker_repo::$DOCKER_REPO" + else + echo "name=docker_repo::$REPO_OWNER" + echo "::set-output name=docker_repo::$REPO_OWNER" + fi echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + # Test the compilation compatibility linux_build: needs: change_detect if: ${{ fromJSON(needs.change_detect.outputs.source_modified) }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 - container: ghcr.io/${{ github.repository_owner }}/openfpga-build-${{ matrix.config.cc}} + container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-${{ matrix.config.cc}} # Branch on different OS and settings strategy: fail-fast: false @@ -194,12 +205,12 @@ jobs: file: ./docker/Dockerfile.master push: ${{ github.ref == 'refs/heads/master' || needs.change_detect.outputs.force_upload }} tags: | - ghcr.io/${{github.repository_owner}}/openfpga-master:latest - ghcr.io/${{github.repository_owner}}/openfpga-master:${{ needs.change_detect.outputs.sha_short }} + ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:latest + ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:${{ needs.change_detect.outputs.sha_short }} linux_regression_tests: name: linux_regression_tests runs-on: ubuntu-18.04 - container: ghcr.io/${{github.repository_owner}}/openfpga-env + container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env needs: linux_build strategy: fail-fast: false @@ -248,7 +259,7 @@ jobs: if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: docker_regression_tests runs-on: ubuntu-18.04 - container: ghcr.io/${{github.repository_owner}}/openfpga-master:latest + container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d51cf1120..27bbf3d42 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,6 +1,12 @@ name: Build docker CI images on: - workflow_dispatch + +# Environment variables +env: + DOCKER_REPO: ${{ secrets.DOCKER_REPO }} + REPO_OWNER: ${{ github.repository_owner }} + jobs: base_images: name: Push Docker images @@ -8,6 +14,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Check for source code changes + id: changes + run: | + if [[ -n "${DOCKER_REPO}" ]]; then + echo "name=docker_repo::$DOCKER_REPO" + echo "::set-output name=docker_repo::$DOCKER_REPO" + else + echo "name=docker_repo::$REPO_OWNER" + echo "::set-output name=docker_repo::$REPO_OWNER" + fi - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -16,7 +32,7 @@ jobs: uses: docker/login-action@v1 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ needs.change_detect.outputs.docker_repo }} password: ${{ secrets.CR_PAT }} - name: Build base uses: docker/build-push-action@v2 @@ -24,14 +40,14 @@ jobs: context: . file: ./docker/Dockerfile.base push: true - tags: ghcr.io/${{ github.repository_owner }}/openfpga-build-base:latest + tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-base:latest - name: Build environment image uses: docker/build-push-action@v2 with: context: . file: ./docker/Dockerfile.env push: true - tags: ghcr.io/${{ github.repository_owner }}/openfpga-env:latest + tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env:latest compiler_images: name: Build ${{ matrix.compiler }} compiler image needs: base_images @@ -57,7 +73,7 @@ jobs: uses: docker/login-action@v1 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ needs.change_detect.outputs.docker_repo }} password: ${{ secrets.CR_PAT }} - name: Build ${{ matrix.compiler }} image uses: docker/build-push-action@v2 @@ -65,4 +81,4 @@ jobs: context: . file: ./docker/Dockerfile.${{ matrix.compiler }} push: true - tags: ghcr.io/${{ github.repository_owner }}/openfpga-build-${{ matrix.compiler }}:latest + tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-${{ matrix.compiler }}:latest From 32f234f4fc012eddcfa1ff1c90b1f88f9d79ec9e Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Mon, 18 Oct 2021 12:31:08 -0600 Subject: [PATCH 08/11] Made LNIS Repo as default --- .github/workflows/build.yml | 11 ++++++----- .github/workflows/docker.yml | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69d9f8fae..3734ab726 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,8 +50,8 @@ jobs: echo "name=docker_repo::$DOCKER_REPO" echo "::set-output name=docker_repo::$DOCKER_REPO" else - echo "name=docker_repo::$REPO_OWNER" - echo "::set-output name=docker_repo::$REPO_OWNER" + echo "name=docker_repo::lnis-uofu" + echo "::set-output name=docker_repo::lnis-uofu" fi echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" @@ -190,9 +190,10 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx + if: ${{ env.DOCKER_REPO }} uses: docker/setup-buildx-action@v1 - name: Login to GitHub Container Registry - if: ${{ (github.ref == 'refs/heads/master') || (needs.change_detect.outputs.force_upload == true) }} + if: ${{ (github.ref == 'refs/heads/master' && (env.DOCKER_REPO)) || (needs.change_detect.outputs.force_upload == true) }} uses: docker/login-action@v1 with: registry: ghcr.io @@ -203,15 +204,15 @@ jobs: with: context: . file: ./docker/Dockerfile.master - push: ${{ github.ref == 'refs/heads/master' || needs.change_detect.outputs.force_upload }} + push: ${{ (github.ref == 'refs/heads/master' && (env.DOCKER_REPO)) || needs.change_detect.outputs.force_upload }} tags: | ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:latest ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:${{ needs.change_detect.outputs.sha_short }} linux_regression_tests: name: linux_regression_tests runs-on: ubuntu-18.04 + needs: [linux_build, change_detect] container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env - needs: linux_build strategy: fail-fast: false matrix: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 27bbf3d42..daa82ba45 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,8 +21,8 @@ jobs: echo "name=docker_repo::$DOCKER_REPO" echo "::set-output name=docker_repo::$DOCKER_REPO" else - echo "name=docker_repo::$REPO_OWNER" - echo "::set-output name=docker_repo::$REPO_OWNER" + echo "name=docker_repo::lnis-uofu" + echo "::set-output name=docker_repo::lnis-uofu" fi - name: Set up QEMU uses: docker/setup-qemu-action@v1 From ed5942ce56abc10c89e319ec03e0e5652e55aa44 Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Mon, 18 Oct 2021 14:17:30 -0600 Subject: [PATCH 09/11] Added DOCKER_REPO variable --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3734ab726..d68d2ebb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,8 +47,8 @@ jobs: echo "::set-output name=status_code::1" fi if [[ -n "${DOCKER_REPO}" ]]; then - echo "name=docker_repo::$DOCKER_REPO" - echo "::set-output name=docker_repo::$DOCKER_REPO" + echo "name=docker_repo::$REPO_OWNER" + echo "::set-output name=docker_repo::$REPO_OWNER" else echo "name=docker_repo::lnis-uofu" echo "::set-output name=docker_repo::lnis-uofu" @@ -190,6 +190,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx + # Temp change remove this if: ${{ env.DOCKER_REPO }} uses: docker/setup-buildx-action@v1 - name: Login to GitHub Container Registry From ba7a6764290b1607fc0d0c9688842b20f1cdb86f Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Mon, 18 Oct 2021 21:42:39 -0600 Subject: [PATCH 10/11] Updated docker yml --- .github/workflows/docker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index daa82ba45..d1cf27e40 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,6 +11,7 @@ jobs: base_images: name: Push Docker images runs-on: ubuntu-latest + if: ${{ secrets.DOCKER_REPO }} steps: - name: Checkout uses: actions/checkout@v2 @@ -18,8 +19,8 @@ jobs: id: changes run: | if [[ -n "${DOCKER_REPO}" ]]; then - echo "name=docker_repo::$DOCKER_REPO" - echo "::set-output name=docker_repo::$DOCKER_REPO" + echo "name=docker_repo::$REPO_OWNER" + echo "::set-output name=docker_repo::$REPO_OWNER" else echo "name=docker_repo::lnis-uofu" echo "::set-output name=docker_repo::lnis-uofu" From de539432081125cd108130e070e8b017f444cd39 Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Mon, 18 Oct 2021 21:43:05 -0600 Subject: [PATCH 11/11] Removed dummy changes --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d68d2ebb4..dcb4ac4cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -190,8 +190,6 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx - # Temp change remove this - if: ${{ env.DOCKER_REPO }} uses: docker/setup-buildx-action@v1 - name: Login to GitHub Container Registry if: ${{ (github.ref == 'refs/heads/master' && (env.DOCKER_REPO)) || (needs.change_detect.outputs.force_upload == true) }}