From a7645cdf20effbef03e0ec0401807b63e3282c87 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 1 Jul 2024 07:53:52 -0700 Subject: [PATCH 1/3] misc, tests: Fix missing 's' in GPU tests (#1306) This caused the weekly tests to fail. It's 'tests' not 'test'. Copy of #1305 . --- .github/workflows/weekly-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index f30c283f78..46a3b564be 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -186,7 +186,7 @@ jobs: needs: - testlib-very-long-tests - dramsys-tests - - LULESH-test - - HACC-test + - LULESH-tests + - HACC-tests steps: - run: echo "This weekly tests have passed." From bb418d41eb6d87c0a0591869097005c16420c6aa Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 1 Jul 2024 12:40:16 -0700 Subject: [PATCH 2/3] misc: Add scheduler.yaml (#1308) --- .github/workflows/scheduler.yaml | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/scheduler.yaml diff --git a/.github/workflows/scheduler.yaml b/.github/workflows/scheduler.yaml new file mode 100644 index 0000000000..64a2f3d02f --- /dev/null +++ b/.github/workflows/scheduler.yaml @@ -0,0 +1,91 @@ +--- +name: Workflow Scheduler + +# GitHub scheduled workflows run on the default branch ('stable' in the case of +# gem5). this means for changes in a workflow to take effect, the default +# branch must be updated. This is not ideal as it requires regular commits into +# the stable branch. Ideally we just want to update the workflow on develop and +# have it run on the develop branch. +# +# This workflow is designed to run on the stable branch and will trigger other +# workflows on the develop branch. +# +# To do so we simply schedule this workflow to run every hour and use some +# simple bash logic to determine if the current time is when we want to run the +# other workflows. + +on: + schedule: + # Runs every hour, 30 minutes past the hour. + - cron: 30 * * * * + +env: + # This is the token used to authenticate with GitHub. + # It is required to run the `gh` CLI. + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + schedule-workflows: + runs-on: ubuntu-latest + steps: + # This step is necessary to allow the `gh` CLI to be used in the + # following steps. The `gh` CLI is used to trigger the workflows. + # and needs to be used inside a the same repository where the + # workflows are defined. + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Record day and time + id: timedate-recorder + run: | + # `date +H` returns the current hour as a number from + # `00` to `23`. + echo "HOUR=$(date +%H)" >> $GITHUB_OUTPUT + + # `date +%u` returns the day of the week as a number from + # `1` to `7`. + # `1` is Monday and `7` is Sunday. + echo "DAY=$(date +%u)" >> $GITHUB_OUTPUT + + - name: Daily Tests + env: + HOUR: ${{ steps.timedate-recorder.outputs.HOUR }} + run: | + # If current time is 7pm then run the workflow. + if [[ $HOUR == '19' ]] + then + gh workflow run daily-tests.yaml --ref develop >/dev/null + echo "Daily test scheduled to run on develop branch." + else + echo "Daily tests not scheduled." + fi + + - name: Weekly Tests + env: + DAY: ${{ steps.timedate-recorder.outputs.DAY }} + HOUR: ${{ steps.timedate-recorder.outputs.HOUR }} + run: | + # If the current day is Friday and the time is 7pm then run + # the workflow. + if [[ $DAY == '5' ]] && [[ $HOUR == '19' ]] + then + gh workflow run weekly-tests.yaml --ref develop >/dev/null + echo "Weekly test scheduled to run on develop branch." + else + echo "Weekly tests not scheduled." + fi + + - name: Compiler Tests + env: + DAY: ${{ steps.timedate-recorder.outputs.DAY }} + HOUR: ${{ steps.timedate-recorder.outputs.HOUR }} + run: | + # If the current day is Tuesday and the time is 9pm then run + # the workflow. + if [[ $DAY == '2' ]] && [[ $HOUR == '21' ]] + then + gh workflow run compiler-tests.yaml --ref develop >/dev/null + echo "Compiler tests scheduled to run on the develop branch." + else + echo "Compiler tests not scheduled." + fi From b88f814e633f879b71c636a6631f92b944017d5d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 18 Jul 2024 12:11:42 -0700 Subject: [PATCH 3/3] tests,misc: Sync .github dir develop -> stable (#1361) --- .github/workflows/compiler-tests.yaml | 13 +----- .github/workflows/daily-tests.yaml | 66 ++++----------------------- .github/workflows/weekly-tests.yaml | 30 +----------- 3 files changed, 11 insertions(+), 98 deletions(-) diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 9db1af6417..32c97ff8c8 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -4,10 +4,7 @@ name: Compiler Tests on: - # Runs every Friday from 7AM UTC - schedule: - - cron: 00 7 * * 5 - # Allows us to manually start workflow for testing + # This is triggered weekly via the 'scheduler.yaml' workflow. workflow_dispatch: jobs: @@ -25,10 +22,6 @@ jobs: container: ghcr.io/gem5/${{ matrix.image }}:latest steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Compile build/ALL/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/ALL/gem5${{ matrix.opts }} -j$(nproc) timeout-minutes: 600 # 10 hours @@ -47,10 +40,6 @@ jobs: container: ghcr.io/gem5/${{ matrix.image }}:latest steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Compile build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} -j$(nproc) timeout-minutes: 600 # 10 hours diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index a45c39a183..6ebdd5e8bd 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -4,10 +4,7 @@ name: Daily Tests on: - # Runs every day from 7AM UTC - schedule: - - cron: 0 7 * * * - # Allows us to manually start workflow for testing + # This is triggered weekly via the 'scheduler.yaml' workflow. workflow_dispatch: jobs: @@ -49,10 +46,6 @@ jobs: container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: defconfig gem5 if: ${{ matrix.setconfig-option != '' }} run: scons defconfig build/${{ matrix.image }} build_opts/${{ matrix.isa-option }} @@ -61,30 +54,12 @@ jobs: run: scons setconfig build/${{ matrix.image }} ${{ matrix.setconfig-option }} - name: Build gem5 run: scons build/${{ matrix.image }}/gem5.opt -j $(nproc) - - uses: actions/upload-artifact@v4.0.0 + - uses: actions/upload-artifact@v4 with: name: ${{ needs.name-artifacts.outputs.build-name }}${{ matrix.image }} path: '*build/${{ matrix.image }}/gem5.opt' retention-days: 1 - run: echo "This job's status is ${{ job.status }}." - # The actions/upload-artifact@v4 action has a special "merge" sub action - # which allows for the merging of multiple artifacts into a single one. - # This is otherwise not possible as artifacts are immutable after creation - # in v4. We createa a merged artifact here as we want to download all the - # gem5 build artifacts when running the long tests. - merge-gem5-build-artifacts: - runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest - needs: [build-gem5, name-artifacts] - steps: - - name: Merge gem5 build artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}} - pattern: ${{needs.name-artifacts.outputs.build-name}}* - retention-days: 1 - compression-level: 9 - # this builds both unittests.fast and unittests.debug unittests-fast-debug: @@ -96,10 +71,6 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: ALL/unittests.${{ matrix.type }} UnitTests run: scons build/ALL/unittests.${{ matrix.type }} -j $(nproc) @@ -112,22 +83,19 @@ jobs: stdlib, x86_boot_tests] runs-on: [self-hosted, linux, x64] container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest - needs: [name-artifacts, merge-gem5-build-artifacts] + needs: [name-artifacts, build-gem5] timeout-minutes: 1440 # 24 hours for entire matrix to run steps: - name: Clean runner run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop # download all artifacts for each test. Thoguh this is inelegant, # it's simpler than figuring otu which long tests requires which # binary. - - uses: actions/download-artifact@v4.0.0 + - uses: actions/download-artifact@v4 with: - name: ${{needs.name-artifacts.outputs.build-name}} + pattern: ${{needs.name-artifacts.outputs.build-name}}* + merge-multiple: true # The upload/download GitHub actions do not preserve the executable # bit of the files. We need to set the executable bit for the # gem5.opt binaries we've just downloaded. @@ -138,7 +106,7 @@ jobs: run: ./main.py run gem5/${{ matrix.test-type }} --length=long --skip-build -vv -t $(nproc) - name: upload results if: success() || failure() - uses: actions/upload-artifact@v4.0.0 + uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: @@ -163,11 +131,7 @@ jobs: - name: Clean runner run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - - uses: actions/download-artifact@v4.0.0 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL - run: chmod u+x build/ALL/gem5.opt @@ -177,7 +141,7 @@ jobs: --skip-build -vv - name: upload results if: success() || failure() - uses: actions/upload-artifact@v4.0.0 + uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: @@ -195,10 +159,6 @@ jobs: steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Build RISCV/libgem5_opt.so with SST run: scons build/RISCV/libgem5_opt.so --without-tcmalloc --duplicate-sources --ignore-style -j $(nproc) - name: Makefile ext/sst @@ -220,10 +180,6 @@ jobs: steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Build ARM/gem5.opt run: scons build/ARM/gem5.opt --ignore-style --duplicate-sources -j$(nproc) - name: disable systemc @@ -246,10 +202,6 @@ jobs: steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Compile build/VEGA_X86/gem5.opt run: scons build/VEGA_X86/gem5.opt -j $(nproc) - name: Get Square test-prog from gem5-resources diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 46a3b564be..1d4161731a 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -4,10 +4,7 @@ name: Weekly Tests on: - # Runs every Sunday from 7AM UTC - schedule: - - cron: 00 7 * * 6 - # Allows us to manually start workflow for testing + # This is triggered weekly via the 'scheduler.yaml' workflow. workflow_dispatch: jobs: @@ -16,10 +13,6 @@ jobs: container: ghcr.io/gem5/gcn-gpu:latest steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Build gem5 run: scons build/VEGA_X86/gem5.opt -j $(nproc) --ignore-style - uses: actions/upload-artifact@v4 @@ -36,10 +29,6 @@ jobs: timeout-minutes: 480 # 8 hours steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - name: Download build/VEGA_X86/gem5.opt uses: actions/download-artifact@v4 @@ -68,10 +57,6 @@ jobs: timeout-minutes: 120 # 2 hours steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - uses: actions/download-artifact@v4 with: name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega @@ -97,10 +82,6 @@ jobs: build-name: ${{ steps.artifact-name.outputs.name }} steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - id: artifact-name run: echo "name=$(date +"%Y-%m-%d_%H.%M.%S")-ALL" >> $GITHUB_OUTPUT - name: Build gem5 @@ -127,10 +108,6 @@ jobs: - name: Clean runner run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - uses: actions/download-artifact@v4 with: name: ${{needs.build-gem5.outputs.build-name}} @@ -156,11 +133,6 @@ jobs: timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v4 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - - name: Checkout DRAMSys working-directory: ${{ github.workspace }}/ext/dramsys run: git clone https://github.com/tukl-msd/DRAMSys --branch v5.0 --depth 1 DRAMSys