Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/artifacts_tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
52 changes: 48 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,55 @@ on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
instance_id:
description: 'Instance ID'
type: string
instance_image_id:
description: 'Instance AMI ID'
type: string
instance_type:
description: 'Instance product type'
type: string
runner_name:
description: 'Action runner name'
type: string
request_id:
description: 'Slab request ID'
type: string

jobs:
tests:
runs-on: self-hosted
tests1:
#runs-on: ubuntu-latest
runs-on: ${{ github.event.inputs.runner_name }}
steps:
- name: Instance configuration used
run: |
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 }}"
echo "Matrix item: ${{ github.event.inputs.matrix_item }}"
- 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: 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
41 changes: 41 additions & 0 deletions ci/fake_bench_data_generator.py
Original file line number Diff line number Diff line change
@@ -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)
27 changes: 27 additions & 0 deletions ci/hmac_calculator.sh
Original file line number Diff line number Diff line change
@@ -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 <Filepath> <SecretKey>"
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/^.* //'
23 changes: 23 additions & 0 deletions ci/slab.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[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)"
#matrix = [2, 4, 6]
#max_parallel_jobs = 2

[command.gpu_test]
workflow = "main.yml"
profile = "gpu"
check_run_name = "AWS tests spawn GPU (Slab)"

1 change: 1 addition & 0 deletions src/alphabets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [
Expand Down