From 5cdccf168e4ac781e2d12ccea985831bcd83bd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Fri, 28 Jan 2022 16:49:13 +0100 Subject: [PATCH 01/19] Comment with no impact --- src/alphabets.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/alphabets.rs b/src/alphabets.rs index 277326c..1bd68b3 100644 --- a/src/alphabets.rs +++ b/src/alphabets.rs @@ -23,6 +23,7 @@ impl Alphabet for AsciiLowerCaseAlphabet { #[derive(Debug, Eq, PartialEq)] pub struct IncompleteAscii; +// A comment with no impact impl Alphabet for IncompleteAscii { fn letters() -> &'static [char] { const INCOMPLETE_ASCII: [char; 60] = [ From 74afa6f940523c7a4eba70e3ee762c66f166e946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Mon, 28 Mar 2022 15:41:49 +0200 Subject: [PATCH 02/19] Runs github Action on ubuntu latest --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a53e62..54fd332 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ on: jobs: tests: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run test suite with cargo From 580a50f046e131325e4474a3795e6e4911de38f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Tue, 29 Mar 2022 14:42:09 +0200 Subject: [PATCH 03/19] Use self hosted runner on AWs to test purpose --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54fd332..98eaadc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: [self-hosted, aws_runner_cpu] steps: - uses: actions/checkout@v2 - name: Run test suite with cargo From af32dfe214532b733232599cf8d20c24b8722a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Tue, 29 Mar 2022 16:04:52 +0200 Subject: [PATCH 04/19] Run on github runner to check for input log --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98eaadc..09385d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,8 @@ on: jobs: tests: - runs-on: [self-hosted, aws_runner_cpu] + runs-on: ubuntu-latest + #runs-on: [self-hosted, aws_runner_cpu] steps: - uses: actions/checkout@v2 - name: Run test suite with cargo From 5bbc2ff35f29ec37d36d9148740c690a357f4973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Tue, 29 Mar 2022 16:35:12 +0200 Subject: [PATCH 05/19] Add inputs into the workflow --- .github/workflows/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09385d4..8325cb3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,27 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + inputs: + instance_ids: + description: 'Instance IDs' + type: string + instance_image_id: + description: 'Instance AMI ID' + type: string + instance_type: + description: 'Instance product type' + type: string jobs: tests: runs-on: ubuntu-latest #runs-on: [self-hosted, aws_runner_cpu] steps: + - name: Instance configuration used + run: | + echo "IDs: ${{ github.event.inputs.instance_ids }}" + echo "AMI: ${{ github.event.inputs.instance_image_id }}" + echo "Type: ${{ github.event.inputs.instance_type }}" - uses: actions/checkout@v2 - name: Run test suite with cargo run: cargo test From a4c384f1ff1a022814848475e8324930dd4e5741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= <21966645+soonum@users.noreply.github.com> Date: Wed, 11 May 2022 10:59:14 +0200 Subject: [PATCH 06/19] Add sleep to check EC2 activity tracker --- .github/workflows/main.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8325cb3..730dfa4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,8 +9,8 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: inputs: - instance_ids: - description: 'Instance IDs' + instance_id: + description: 'Instance ID' type: string instance_image_id: description: 'Instance AMI ID' @@ -21,14 +21,16 @@ on: jobs: tests: - runs-on: ubuntu-latest - #runs-on: [self-hosted, aws_runner_cpu] + #runs-on: ubuntu-latest + runs-on: [self-hosted, aws_runner_cpu] steps: - name: Instance configuration used run: | - echo "IDs: ${{ github.event.inputs.instance_ids }}" + echo "IDs: ${{ github.event.inputs.instance_id }}" echo "AMI: ${{ github.event.inputs.instance_image_id }}" echo "Type: ${{ github.event.inputs.instance_type }}" - uses: actions/checkout@v2 - name: Run test suite with cargo run: cargo test + - name: EC2 activity tracker check + run: sleep 180 From 85843d9ac756208b41053a542bed0dbbf2523607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= <21966645+soonum@users.noreply.github.com> Date: Wed, 11 May 2022 12:24:51 +0200 Subject: [PATCH 07/19] Comment out Rust tests (EC2 image w/o rust tools) --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 730dfa4..32a8294 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: echo "AMI: ${{ github.event.inputs.instance_image_id }}" echo "Type: ${{ github.event.inputs.instance_type }}" - uses: actions/checkout@v2 - - name: Run test suite with cargo - run: cargo test + #- name: Run test suite with cargo + # run: cargo test - name: EC2 activity tracker check run: sleep 180 From a4ef3a7321d30a4d6b26fa7552b055f81f054c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= <21966645+soonum@users.noreply.github.com> Date: Fri, 13 May 2022 16:35:12 +0200 Subject: [PATCH 08/19] Run action on runner with unique name --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 32a8294..c2591ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,11 +18,14 @@ on: instance_type: description: 'Instance product type' type: string + runner_name: + description: 'Action runner name' + type: string jobs: tests: #runs-on: ubuntu-latest - runs-on: [self-hosted, aws_runner_cpu] + runs-on: $${{ github.event.inputs.runner_name }} steps: - name: Instance configuration used run: | From 08796e1cbad483c055eb51ac1d2cef1a7a9d235e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= <21966645+soonum@users.noreply.github.com> Date: Fri, 13 May 2022 16:37:52 +0200 Subject: [PATCH 09/19] fix typo in runs-on directive --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c2591ec..530c8e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ on: jobs: tests: #runs-on: ubuntu-latest - runs-on: $${{ github.event.inputs.runner_name }} + runs-on: ${{ github.event.inputs.runner_name }} steps: - name: Instance configuration used run: | From 58086203ee9463306e64aee8e6269c88750751ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= <21966645+soonum@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:17:09 +0200 Subject: [PATCH 10/19] Test github app re-auth after one hour --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 530c8e1..41c0ccf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,4 +36,4 @@ jobs: #- name: Run test suite with cargo # run: cargo test - name: EC2 activity tracker check - run: sleep 180 + run: sleep 3700 From b95fa1bccfb31f0cbb5db971680127d9d5768ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= <21966645+soonum@users.noreply.github.com> Date: Fri, 5 Aug 2022 09:02:38 +0200 Subject: [PATCH 11/19] Get back to rapid test with 60 sleep --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41c0ccf..99c806b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,4 +36,4 @@ jobs: #- name: Run test suite with cargo # run: cargo test - name: EC2 activity tracker check - run: sleep 3700 + run: sleep 60 From 95069fbaffc5e5b717bfdc1467bd365960df9a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Wed, 10 Aug 2022 16:10:12 +0200 Subject: [PATCH 12/19] Add remote configuration file for Slab --- ci/slab.toml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ci/slab.toml diff --git a/ci/slab.toml b/ci/slab.toml new file mode 100644 index 0000000..dd28ec2 --- /dev/null +++ b/ci/slab.toml @@ -0,0 +1,21 @@ +[profile.cpu] +region = "eu-west-3" +image_id = "ami-021d41cbdefc0c994" # AWS Linux x86 +instance_type = "t3.micro" +subnet_id = "subnet-0e042c7621461f754" + +[profile.gpu] +region = "eu-west-1" # Ireland +image_id = "ami-0261faf04cf54fe0a" # GPU image in eu-west-1 to test auto retry +instance_type = "p3.2xlarge" + +[command.cpu_test] +workflow = "main.yml" +profile = "cpu" +check_run_name = "AWS tests (Slab)" + +[command.gpu_test] +workflow = "main.yml" +profile = "gpu" +check_run_name = "AWS tests spawn GPU (Slab)" + From ea5d545fb72229f381d74df8082ce6f7d652df8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Fri, 16 Sep 2022 15:55:47 +0200 Subject: [PATCH 13/19] Action to test artifact and sending results to slab --- .github/workflows/artifacts_tests.yml | 47 +++++++++++++++++++++++++++ ci/fake_bench_data_generator.py | 41 +++++++++++++++++++++++ ci/hmac_calculator.sh | 27 +++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 .github/workflows/artifacts_tests.yml create mode 100644 ci/fake_bench_data_generator.py create mode 100755 ci/hmac_calculator.sh diff --git a/.github/workflows/artifacts_tests.yml b/.github/workflows/artifacts_tests.yml new file mode 100644 index 0000000..0c923e8 --- /dev/null +++ b/.github/workflows/artifacts_tests.yml @@ -0,0 +1,47 @@ +name: Artifact tests + +on: + workflow_dispatch: + +jobs: + generation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + #- name: Run test suite with cargo + # run: cargo test + - name: Generate data + run: python3 ci/fake_bench_data_generator.py my_test_results.json + shell: bash + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: results + path: my_test_results.json + + publication: + runs-on: ubuntu-latest + needs: generation + steps: + - uses: actions/checkout@v2 + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: results + path: results_artifact + + - name: Send data to slab + shell: bash + run: | + echo "Computing HMac on downloaded artifact" + SIGNATURE="$(./ci/hmac_calculator.sh ./results_artifact/my_test_results.json '${{ secrets.JOB_SECRET }}')" + + echo "Sending results to Slab..." + curl -v -k \ + -H "Content-Type: application/json" \ + -H "X-Slab-Repository: ${{ github.repository }}" \ + -H "X-Slab-Command: plot_data" \ + -H "X-Hub-Signature-256: sha256=${SIGNATURE}" \ + -d @results_artifact/my_test_results.json \ + ${{ secrets.SLAB_URL }} diff --git a/ci/fake_bench_data_generator.py b/ci/fake_bench_data_generator.py new file mode 100644 index 0000000..ce1b986 --- /dev/null +++ b/ci/fake_bench_data_generator.py @@ -0,0 +1,41 @@ +import argparse +import pathlib +import json + +parser = argparse.ArgumentParser() +parser.add_argument("filename") + + +def create_data(): + return [{ + "series_name": "david_test_series", + "series_help": "A series used to test the whole CI chain", + "series_tags": {"tag_1": "spam", }, + "points": [ + {"value": 42.0, + "tags": { + "tag_2": "eggs", + }, + }, + {"value": 1234.0, + "tags": { + "tag_2": "ham", + }, + }, + {"value": 789.5, + "tags": { + "tag_2": "foo", + }, + }, + ], + }] + + +def dump_results(results, filename): + dump_file = pathlib.Path(filename) + dump_file.write_text(json.dumps(results)) + + +if __name__ == "__main__": + args = parser.parse_args() + dump_results(create_data(), args.filename) diff --git a/ci/hmac_calculator.sh b/ci/hmac_calculator.sh new file mode 100755 index 0000000..a389acd --- /dev/null +++ b/ci/hmac_calculator.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# +# Compute a Hmac signature by providing a filepath and a secret key encoded as hexadecimal. +# + +if [ $# -lt 2 ]; then + echo "Not enough argument provided" + echo "Usage: hmac_calculator.sh " + exit 1 +fi + +FILE_PROVIDED="$1" +SECRET_KEY="$2" + +if [ ! -f "${FILE_PROVIDED}" ]; then + echo "File $FILE_PROVIDED doesn't exist" + exit 1 +fi + +if [ -z "$SECRET_KEY" ]; then + echo "Hmac secret is empty" + exit 1 +fi + +# Compute HMAC signature. +openssl sha256 -hmac "$SECRET_KEY" < "${FILE_PROVIDED}" | sed -e 's/^.* //' From bc2a3583e70307ef7d641a49b47a4b0c7ba15919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Wed, 9 Nov 2022 10:41:36 +0100 Subject: [PATCH 14/19] Add Slab request id in workflow --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 99c806b..7c59d04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,9 @@ on: runner_name: description: 'Action runner name' type: string + request_id: + description: 'Slab request ID ' + type: string jobs: tests: @@ -32,6 +35,7 @@ jobs: echo "IDs: ${{ github.event.inputs.instance_id }}" echo "AMI: ${{ github.event.inputs.instance_image_id }}" echo "Type: ${{ github.event.inputs.instance_type }}" + echo "Request ID: ${{ github.event.inputs.request_id }}" - uses: actions/checkout@v2 #- name: Run test suite with cargo # run: cargo test From 3fe05621c696eebe4e391d8aee5253b4c152cc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Thu, 10 Nov 2022 10:00:20 +0100 Subject: [PATCH 15/19] Add matrix_item workflow dispatch input --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c59d04..776ac14 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,10 @@ on: description: 'Action runner name' type: string request_id: - description: 'Slab request ID ' + description: 'Slab request ID' + type: string + matrix_item: + description: 'Build matrix item' type: string jobs: @@ -36,6 +39,7 @@ jobs: echo "AMI: ${{ github.event.inputs.instance_image_id }}" echo "Type: ${{ github.event.inputs.instance_type }}" echo "Request ID: ${{ github.event.inputs.request_id }}" + echo "Matrix item: ${{ github.event.inputs.matrix_item }}" - uses: actions/checkout@v2 #- name: Run test suite with cargo # run: cargo test From 9ed4d83797da13567001a38cd844bef84591d1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Thu, 17 Nov 2022 16:05:40 +0100 Subject: [PATCH 16/19] use matrix build in ci config file --- ci/slab.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/slab.toml b/ci/slab.toml index dd28ec2..5683aa4 100644 --- a/ci/slab.toml +++ b/ci/slab.toml @@ -13,6 +13,8 @@ instance_type = "p3.2xlarge" workflow = "main.yml" profile = "cpu" check_run_name = "AWS tests (Slab)" +matrix = [2, 4, 6] +max_parallel_jobs = 2 [command.gpu_test] workflow = "main.yml" From 8e39391b8e061bab0916841d0975e50fffb50bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Thu, 26 Jan 2023 15:50:15 +0100 Subject: [PATCH 17/19] deactivate matrix build --- ci/slab.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/slab.toml b/ci/slab.toml index 5683aa4..191dbb9 100644 --- a/ci/slab.toml +++ b/ci/slab.toml @@ -13,8 +13,8 @@ instance_type = "p3.2xlarge" workflow = "main.yml" profile = "cpu" check_run_name = "AWS tests (Slab)" -matrix = [2, 4, 6] -max_parallel_jobs = 2 +#matrix = [2, 4, 6] +#max_parallel_jobs = 2 [command.gpu_test] workflow = "main.yml" From 361a6d2b896816eb616d5e63a6967b31add33add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Thu, 26 Jan 2023 18:05:46 +0100 Subject: [PATCH 18/19] remove reference to matrix_item inputs --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 776ac14..984c11c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,9 +24,6 @@ on: request_id: description: 'Slab request ID' type: string - matrix_item: - description: 'Build matrix item' - type: string jobs: tests: From 8c1e7ed316430a18972903bdb10e0a43a0a106d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Wed, 1 Feb 2023 15:07:21 +0100 Subject: [PATCH 19/19] Add second job also running on aws --- .github/workflows/main.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 984c11c..a951171 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ on: type: string jobs: - tests: + tests1: #runs-on: ubuntu-latest runs-on: ${{ github.event.inputs.runner_name }} steps: @@ -41,4 +41,22 @@ jobs: #- name: Run test suite with cargo # run: cargo test - name: EC2 activity tracker check - run: sleep 60 + #run: echo 999999^999999 | bc + run: sleep 45 +# +# intermediate_test: +# needs: tests1 +# runs-on: ubuntu-latest +# steps: +# - name: A intermediate sleep +# run: sleep 45 +# +# tests2: +# runs-on: ${{ github.event.inputs.runner_name }} +# needs: intermediate_test +# steps: +# - uses: actions/checkout@v2 +# #- name: Run test suite with cargo +# # run: cargo test +# - name: Another sleep +# run: echo 999999^999999 | bc