From c60718dc13ebbdae243e096a65d6c62803a36bf6 Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 14:49:19 +0700 Subject: [PATCH 1/7] Moved Script Evaluation Test to GHA --- .github/workflows/script-evaluation-test.yml | 37 ++++++++++++++++++++ build/buildkite/script-evaluation-test.yml | 25 ------------- 2 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/script-evaluation-test.yml delete mode 100644 build/buildkite/script-evaluation-test.yml diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml new file mode 100644 index 00000000000..55b8a46ef5f --- /dev/null +++ b/.github/workflows/script-evaluation-test.yml @@ -0,0 +1,37 @@ +# A nightly job which downloads script evaluation dumps from S3 and runs a regression test. +name: Script Evaluation Test +on: + schedule: + - cron: 30 3 * * * # 3:30am every day + +jobs: + script-evaluation-test: + runs-on: [self-hosted, plutus-benchmark] + + steps: + - name: Checkout + uses: actions/checkout@v3.3.0 + + - name: Download and Unzip Dump Files + run: | + export LOCAL_DIR="$HOME/mainnet-script-dump-downloaded" + nix develop --no-warn-dirty --accept-flake-config --command \ + bash ./scripts/s3-sync-unzip.sh s3://plutus/mainnet-script-dump/ \*.event.bz2 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-1 + AWS_ENDPOINT_URL: https://s3.devx.iog.io + + - name: Run Script Evaluation Test + # Run the test cases sequentially. This ensures we don't need to simultaneously store + # multiple `ScriptEvaluationEvents`, which are large, in memory. Each test case + # contains many script evaluation events, and those are run in parallel based on + # the number of available processors. + run: | + export EVENT_DUMP_DIR="$HOME/mainnet-script-dump-downloaded" + nix develop --no-warn-dirty --accept-flake-config --command cabal update + nix develop --no-warn-dirty --accept-flake-config --command \ + cabal v2-run plutus-ledger-api:evaluation-test -- --num-threads=1 + + diff --git a/build/buildkite/script-evaluation-test.yml b/build/buildkite/script-evaluation-test.yml deleted file mode 100644 index 4f561910670..00000000000 --- a/build/buildkite/script-evaluation-test.yml +++ /dev/null @@ -1,25 +0,0 @@ -# A nightly job which downloads script evaluation dumps from S3 and runs a regression test. -steps: - - label: "Download and unzip dump files" - command: | - nix-shell --run 'LOCAL_DIR=$HOME/mainnet-script-dump-downloaded ./scripts/s3-sync-unzip.sh s3://plutus/mainnet-script-dump/ *.event.bz2' -# TODO(std) check that this works -# nix develop --command 'LOCAL_DIR=$HOME/mainnet-script-dump-downloaded ./scripts/s3-sync-unzip.sh s3://plutus/mainnet-script-dump/ *.event.bz2' - concurrency: 1 - concurrency_group: "plutus-script-evaluation" - agents: - queue: "plutus" - - wait - - label: "Script evaluation test" - # Run the test cases sequentially. This ensures we don't need to simultaneously store - # multiple `ScriptEvaluationEvents`, which are large, in memory. Each test case - # contains many script evaluation events, and those are run in parallel based on - # the number of available processors. - command: | - nix-shell --run 'cabal update && EVENT_DUMP_DIR=$HOME/mainnet-script-dump-downloaded cabal v2-run plutus-ledger-api:evaluation-test -- --num-threads=1' -# TODO(std) check that this works -# nix develop --command 'cabal update && EVENT_DUMP_DIR=$HOME/mainnet-script-dump-downloaded cabal v2-run plutus-ledger-api:evaluation-test -- --num-threads=1' - concurrency: 1 - concurrency_group: "plutus-script-evaluation" - agents: - queue: "plutus" From 78c42b1460f22002725db61e8d373c38e79d0392 Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 15:07:59 +0700 Subject: [PATCH 2/7] Cosmetics --- .github/workflows/add-triage-label.yml | 7 ++++--- .github/workflows/benchmark.yml | 7 ++++--- .github/workflows/hlint.yml | 19 +++++++++++++------ .../{test.yml => pre-commit-check.yml} | 14 +++++++++----- .github/workflows/script-evaluation-test.yml | 2 +- 5 files changed, 31 insertions(+), 18 deletions(-) rename .github/workflows/{test.yml => pre-commit-check.yml} (52%) diff --git a/.github/workflows/add-triage-label.yml b/.github/workflows/add-triage-label.yml index 6c9bc6b2eb1..554c366bbab 100644 --- a/.github/workflows/add-triage-label.yml +++ b/.github/workflows/add-triage-label.yml @@ -1,16 +1,17 @@ -name: Add triage label +name: Add Triage Label on: issues: types: - reopened - opened jobs: - add_triage_label: + add-triage-label: runs-on: ubuntu-latest permissions: issues: write steps: - - uses: actions/github-script@v6 + - name: Run + uses: actions/github-script@v6 with: script: | github.rest.issues.addLabels({ diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index da27610f4ea..9350c83db39 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,4 +1,4 @@ -name: Benchmarking +name: Benchmark on: issue_comment: types: [created] @@ -87,8 +87,9 @@ jobs: core.setFailed(`Error: ${error}`); } - - run: | - nix develop --no-warn-dirty --accept-flake-config --command bash ./scripts/ci-plutus-benchmark.sh + - name: Run + run: | + nix develop --no-warn-dirty --accept-flake-config --command bash ./scripts/ci-plutus-benchmark.sh if: success() env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/hlint.yml b/.github/workflows/hlint.yml index 386b96573ce..059cdd41ad4 100644 --- a/.github/workflows/hlint.yml +++ b/.github/workflows/hlint.yml @@ -11,18 +11,25 @@ jobs: hlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: haskell/actions/hlint-setup@v2 + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup HLint + uses: haskell/actions/hlint-setup@v2 with: version: '3.4' - - uses: nixbuild/nix-quick-install-action@v21 + + - name: Quick Install Nix + uses: nixbuild/nix-quick-install-action@v21 with: nix_conf: | experimental-features = nix-command flakes accept-flake-config = true - - name: Build HLint - run: nix build .#hlint - - name: Run HLint + + - name: Build + run: nix build .#hlint + + - name: Run uses: haskell/actions/hlint-run@v1 with: hlint-bin: "./result/bin/hlint --hint=./.github/.hlint.yaml" diff --git a/.github/workflows/test.yml b/.github/workflows/pre-commit-check.yml similarity index 52% rename from .github/workflows/test.yml rename to .github/workflows/pre-commit-check.yml index d9efa1c36b5..7fd864c3df1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/pre-commit-check.yml @@ -1,15 +1,19 @@ -name: "Tests" +name: Pre Commit Check on: pull_request: jobs: - nix-sanity-checks: + pre-commit-check: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v3 - - uses: nixbuild/nix-quick-install-action@v21 + - name: Checkout + uses: actions/checkout@v3 + + - name: Quick Install Nix + uses: nixbuild/nix-quick-install-action@v21 with: nix_conf: | experimental-features = nix-command flakes accept-flake-config = true - - name: Pre-commit check + + - name: Run run: nix build .#pre-commit-check diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml index 55b8a46ef5f..f62c94e7087 100644 --- a/.github/workflows/script-evaluation-test.yml +++ b/.github/workflows/script-evaluation-test.yml @@ -23,7 +23,7 @@ jobs: AWS_DEFAULT_REGION: us-east-1 AWS_ENDPOINT_URL: https://s3.devx.iog.io - - name: Run Script Evaluation Test + - name: Run # Run the test cases sequentially. This ensures we don't need to simultaneously store # multiple `ScriptEvaluationEvents`, which are large, in memory. Each test case # contains many script evaluation events, and those are run in parallel based on From 4669bc2035c9b676c855662a2f7131d7b5e4d696 Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 21:38:58 +0700 Subject: [PATCH 3/7] Applied requested changes --- .github/workflows/benchmark.yml | 4 ++++ .github/workflows/script-evaluation-test.yml | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9350c83db39..e2de98a3a3d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -3,6 +3,10 @@ on: issue_comment: types: [created] +concurrency: + group: plutus-benchmark + cancel-in-progress: true + jobs: benchmark: runs-on: [self-hosted, plutus-benchmark] diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml index f62c94e7087..b2ff534fc8f 100644 --- a/.github/workflows/script-evaluation-test.yml +++ b/.github/workflows/script-evaluation-test.yml @@ -4,6 +4,10 @@ on: schedule: - cron: 30 3 * * * # 3:30am every day +concurrency: + group: script-evaluation-test + cancel-in-progress: true + jobs: script-evaluation-test: runs-on: [self-hosted, plutus-benchmark] @@ -30,8 +34,7 @@ jobs: # the number of available processors. run: | export EVENT_DUMP_DIR="$HOME/mainnet-script-dump-downloaded" - nix develop --no-warn-dirty --accept-flake-config --command cabal update - nix develop --no-warn-dirty --accept-flake-config --command \ - cabal v2-run plutus-ledger-api:evaluation-test -- --num-threads=1 + Alternatively, what about + nix run .#x86_64-linux.plutus.library.plutus-project-924.hsPkgs.plutus-ledger-api.components.exes.evaluation-test -- --num-threads=1 From fcc5ac4cde326424e9704f4bf6972513001e6890 Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 21:40:14 +0700 Subject: [PATCH 4/7] WIP --- .github/workflows/script-evaluation-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml index b2ff534fc8f..b9f32d041b6 100644 --- a/.github/workflows/script-evaluation-test.yml +++ b/.github/workflows/script-evaluation-test.yml @@ -34,7 +34,6 @@ jobs: # the number of available processors. run: | export EVENT_DUMP_DIR="$HOME/mainnet-script-dump-downloaded" - Alternatively, what about nix run .#x86_64-linux.plutus.library.plutus-project-924.hsPkgs.plutus-ledger-api.components.exes.evaluation-test -- --num-threads=1 From dd93a979c3ec28e4a67b0b87936789b1a81a5a32 Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 22:05:16 +0700 Subject: [PATCH 5/7] WIP --- .github/workflows/benchmark.yml | 1 - .github/workflows/script-evaluation-test.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e2de98a3a3d..999ba4920d7 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -5,7 +5,6 @@ on: concurrency: group: plutus-benchmark - cancel-in-progress: true jobs: benchmark: diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml index b9f32d041b6..ec41b31bea0 100644 --- a/.github/workflows/script-evaluation-test.yml +++ b/.github/workflows/script-evaluation-test.yml @@ -6,7 +6,6 @@ on: concurrency: group: script-evaluation-test - cancel-in-progress: true jobs: script-evaluation-test: From 78a2ceee0e2218590ea172de3294f4c77b55604b Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 22:07:14 +0700 Subject: [PATCH 6/7] WIP --- .github/workflows/script-evaluation-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml index ec41b31bea0..d7e640d9054 100644 --- a/.github/workflows/script-evaluation-test.yml +++ b/.github/workflows/script-evaluation-test.yml @@ -6,6 +6,7 @@ on: concurrency: group: script-evaluation-test + cancel-in-progress: true # We only want at most one job running at a time jobs: script-evaluation-test: From ebca4641e3274906066d3e57dfd319b2b554ceab Mon Sep 17 00:00:00 2001 From: zeme-iohk Date: Tue, 31 Jan 2023 22:07:42 +0700 Subject: [PATCH 7/7] WIP --- .github/workflows/script-evaluation-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml index d7e640d9054..826539df5d3 100644 --- a/.github/workflows/script-evaluation-test.yml +++ b/.github/workflows/script-evaluation-test.yml @@ -6,7 +6,8 @@ on: concurrency: group: script-evaluation-test - cancel-in-progress: true # We only want at most one job running at a time + # We only want at most one evaluation test running at a time + cancel-in-progress: true jobs: script-evaluation-test: