diff --git a/.github/workflows/auto_fetch.yml b/.github/workflows/auto_fetch.yml new file mode 100644 index 000000000..1e3f44a47 --- /dev/null +++ b/.github/workflows/auto_fetch.yml @@ -0,0 +1,25 @@ +name: Create Pull Request for Upstream Changes +on: + push: + branches: + - update_from_upstream +jobs: + pull-request: + runs-on: ubuntu-latest + env: + BRANCH_UPSTREAM: update_from_upstream + steps: + - uses: actions/checkout@v2 + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + source_branch: ${{env.BRANCH_UPSTREAM}} # name of branch for PR + destination_branch: "master" # name of branch on which PR go + pr_title: "Pulling ${{ github.ref }} into master" # Title of pull request + pr_body: ":crown: *An automated PR*" # Full markdown support, requires pr_title + pr_reviewer: "tangxifan" # Comma-separated list (no spaces) + pr_assignee: "nadeemyaseen-rs,mahmoodulhassan-rs" # Comma-separated list (no spaces) + pr_label: "auto-pr" # Comma-separated list (no spaces) + pr_allow_empty: true # Creates pull request even if there are no changes + github_token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77ccb1527..dcb4ac4cd 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::$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" + 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/lnis-uofu/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 @@ -181,7 +192,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 == 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 @@ -192,15 +203,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/lnis-uofu/openfpga-master:latest - ghcr.io/lnis-uofu/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/lnis-uofu/openfpga-env - needs: linux_build + needs: [linux_build, change_detect] + container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env strategy: fail-fast: false matrix: @@ -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/lnis-uofu/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 bfce9fc79..d1cf27e40 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,13 +1,30 @@ 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 runs-on: ubuntu-latest + if: ${{ secrets.DOCKER_REPO }} 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::$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" + fi - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -16,7 +33,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 +41,14 @@ jobs: context: . file: ./docker/Dockerfile.base push: true - tags: ghcr.io/lnis-uofu/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/lnis-uofu/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 +74,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 +82,4 @@ jobs: context: . file: ./docker/Dockerfile.${{ matrix.compiler }} push: true - tags: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.compiler }}:latest + tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-${{ matrix.compiler }}:latest 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 } diff --git a/openfpga_flow/scripts/run_fpga_flow.py b/openfpga_flow/scripts/run_fpga_flow.py index a333ebb8f..93883d330 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() @@ -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(): @@ -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") @@ -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)