Skip to content

Bump the dev-dependencies group with 3 updates #415

Bump the dev-dependencies group with 3 updates

Bump the dev-dependencies group with 3 updates #415

Workflow file for this run

name: Load Test CI
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'intent_brokering/common/**'
- 'intent_brokering/src/**'
- 'intent_brokering/tests/**'
- 'intent_brokering/proto/**'
- 'intent_brokering/proto.rs/**'
- 'intent_brokering/examples/**'
- '.github/workflows/lt-ci.yml'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: write
deployments: write
pull-requests: write
env:
# Push the results to gh-pages only on merge to main.
AUTO_PUSH: ${{ github.event_name == 'push' }}
# Comment the performance numbers of the load tests only on PRs and if the PR
# comes from within the Eclipse organization.
COMMENT_ALWAYS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse-chariott/chariott' }}
jobs:
benchmark:
name: Execute load tests and memory profiling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable toolchain
run: rustup show
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Install dependencies for build
run: sudo apt-get install -y protobuf-compiler xmlstarlet
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build intent brokering container
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.intent_brokering.amd64
load: true
tags: intent_brokering:1
- name: Build valgrind enabled intent brokering container
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.intent_brokering.valgrind
load: true
tags: intent_brokering.valgrind:1
- name: Build lt-provider-app container
uses: docker/build-push-action@v3
with:
context: .
file: ./intent_brokering/examples/applications/Dockerfile.lt-provider-app.ci
build-args: APP_NAME=lt-provider-app
load: true
tags: lt-provider-app:1
- name: Start intent_brokering and lt-provider-app
run: |
docker run --init --detach --name intent_brokering --network host intent_brokering:1
docker run --init --detach --name lt-provider-app --network host lt-provider-app:1
- name: Run load tests
run: |
mkdir -p lt-output
cargo build --release -p lt-consumer-app
COLLECT_DOCKER_STATS=true TARGET_INVOKE_COUNT=90000 TARGET_RATE=3000 ./target/release/lt-consumer-app > lt-output/lt-consumer-app.log 2>&1
- name: Stop containers
run: |
docker kill --signal=SIGINT lt-provider-app
docker kill --signal=SIGINT intent_brokering
docker stop lt-provider-app
docker stop intent_brokering
- name: Print performance numbers
run: |
cat lt-output/app.out | jq
- name: Print docker memory numbers
run: |
cat lt-output/docker.out | jq
- name: Print log output
if: ${{ always() }}
run: |
docker logs intent_brokering
docker logs lt-provider-app
for f in lt-output/*.log; do
echo -e "Printing output of file $f:\n"
cat "$f";
done
- name: Start intent_brokering and lt-provider-app
run: |
docker rm lt-provider-app
docker rm intent_brokering
mkdir -p valgrind-output
sudo chown -R 10001:10001 valgrind-output
sudo chmod -R 777 valgrind-output
docker run --init --detach --name intent_brokering.valgrind --network host --volume $(pwd)/valgrind-output:/output intent_brokering.valgrind:1
docker run --init --detach --name lt-provider-app --network host lt-provider-app:1
- name: Run Memory Profiling using load tests
run: |
mv lt-output/app.out lt-output/loadtest.out
sleep 10
TARGET_INVOKE_COUNT=100 TARGET_RATE=5 ./target/release/lt-consumer-app > lt-output/lt-consumer-app.log 2>&1
rm lt-output/app.out
- name: Stop containers
run: |
docker kill --signal=SIGINT lt-provider-app
docker kill --signal=SIGINT intent_brokering.valgrind
docker stop lt-provider-app
docker stop intent_brokering.valgrind
- name: Create valgrind benchmark report
run: |
VALGRIND_OUTPUT=$(pwd)/valgrind-output/out.xml
DEFINITELY_LOST_BYTES=$(xmlstarlet sel -t -v "sum(//error[kind='Leak_DefinitelyLost']//xwhat/leakedbytes)" $VALGRIND_OUTPUT)
DEFINTIELY_LOST_BLOCKS=$(xmlstarlet sel -t -v "sum(//error[kind='Leak_DefinitelyLost']//xwhat/leakedblocks)" $VALGRIND_OUTPUT)
INDIRECTLY_LOST_BYTES=$(xmlstarlet sel -t -v "sum(//error[kind='Leak_IndirectlyLost']//xwhat/leakedbytes)" $VALGRIND_OUTPUT)
INDIRECTLY_LOST_BLOCKS=$(xmlstarlet sel -t -v "sum(//error[kind='Leak_IndirectlyLost']//xwhat/leakedblocks)" $VALGRIND_OUTPUT)
POSSIBLY_LOST_BYTES=$(xmlstarlet sel -t -v "sum(//error[kind='Leak_PossiblyLost']//xwhat/leakedbytes)" $VALGRIND_OUTPUT)
POSSIBLY_LOST_BLOCKS=$(xmlstarlet sel -t -v "sum(//error[kind='Leak_PossiblyLost']//xwhat/leakedblocks)" $VALGRIND_OUTPUT)
json_string=$(jq -n \
--arg dby "$DEFINITELY_LOST_BYTES" \
--arg dbl "$DEFINTIELY_LOST_BLOCKS" \
--arg iby "$INDIRECTLY_LOST_BYTES" \
--arg ibl "$INDIRECTLY_LOST_BLOCKS" \
--arg pby "$POSSIBLY_LOST_BYTES" \
--arg pbl "$POSSIBLY_LOST_BLOCKS" \
'[{name: "Definitely Lost Bytes", unit: "bytes", value: $dby}, {name: "Definitely Lost Blocks", unit: "blocks", value: $dbl}, {name: "Indirectly Lost Bytes", unit: "bytes", value: $iby}, {name: "Indirectly Lost Blocks", unit: "blocks", value: $ibl}, {name: "Possibly Lost Bytes", unit: "bytes", value: $pby}, {name: "Possibly Lost Blocks", unit: "blocks", value: $pbl}]')
echo $json_string > lt-output/valgrind.out
- name: Concatenate all benchmarks
run: |
find -type f -name "*.out" -exec cat {} \; | jq '.[]' | jq -s > lt-output/all.json
- name: Store combined benchmark result
env:
GIT_LFS_SKIP_SMUDGE: 1
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.event_name != 'workflow_dispatch' }}
with:
name: Intent Brokering Benchmark
tool: 'customSmallerIsBetter'
output-file-path: lt-output/all.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ env.AUTO_PUSH }}
comment-always: ${{ env.COMMENT_ALWAYS }}
- name: Print valgrind numbers
run: |
cat lt-output/valgrind.out | jq
- name: Print log output
if: ${{ always() }}
run: |
docker logs intent_brokering.valgrind
docker logs lt-provider-app
for f in lt-output/*.log; do
echo -e "Printing output of file $f:\n"
cat "$f";
done