Skip to content

Commit

Permalink
Lifted changes from alphaX86:enhance and changed Bookinfo URL + Wrote…
Browse files Browse the repository at this point in the history
… emojivoto to a file

Signed-off-by: hershd23 <[email protected]>
  • Loading branch information
hershd23 committed Jun 15, 2022
1 parent fdd0c3f commit ac95f73
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 105 deletions.
1 change: 1 addition & 0 deletions .github/workflows/auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meshery-provider":"None","token":""}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on:
jobs:
start-runner:
name: Start self-hosted CNCF CIL runner
timeout-minutes: 60
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
outputs:
Expand Down Expand Up @@ -62,6 +63,7 @@ jobs:

run-benchmarks:
name: Run the configurable benchmarks on the runner
timeout-minutes: 60
needs:
- start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
Expand Down Expand Up @@ -111,6 +113,7 @@ jobs:

stop-runner:
name: Stop self-hosted runner
timeout-minutes: 60
needs:
- start-runner # required to get output from the start-runner job
- run-benchmarks # required to wait when the main job is done
Expand All @@ -127,6 +130,7 @@ jobs:
shell: bash

- name: Remove CNCF CIL runner from github repository
if: always()
run: |
runner_id=$(curl -s -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners | jq '.runners[] | select(.name == "${{ needs.start-runner.outputs.hostname }}") | {id}' | jq -r .id)
curl -X DELETE -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners/$runner_id
Expand Down
132 changes: 68 additions & 64 deletions .github/workflows/configurable-benchmark-test.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
# This workflow runs performance benchmarks with Meshery based on the configuration provided
# This workflow needs to be triggered manually by providing the test configuration

name: Configurable Benchmark Test
on:
# for triggering the workflow, provide these inputs
workflow_dispatch:
inputs:
profile_name:
description: "performance profile to use"
required: false
profile_filename:
description: "test configuration file"
required: false
service_mesh:
type: choice
required: false
description: "service mesh being tested"
options:
- istio
- linkerd
load_generator:
type: choice
required: false
description: "load generator to run tests with"
options:
- fortio
- wrk2
- nighthawk

jobs:
manual-test:
name: Configurable Benchmark Test
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Setup Kubernetes
uses: manusa/[email protected]
with:
minikube version: 'v1.23.2'
kubernetes version: 'v1.23.2'
driver: docker
start args: "--v=5"

- name: Checkout Code
uses: actions/checkout@v2

- name: Install Service Mesh and Deploy Application
run: |
chmod +x .github/workflows/scripts/${{ github.event.inputs.service_mesh }}_deploy.sh
.github/workflows/scripts/${{ github.event.inputs.service_mesh }}_deploy.sh
shell: bash

- name: Run Benchmark Tests
uses: layer5io/meshery-smp-action@master
with:
provider_token: ${{ secrets.MESHERY_TOKEN }}
platform: docker
profile_name: ${{ github.event.inputs.profile_name }}
profile_filename: ${{ github.event.inputs.profile_filename }}
endpoint_url: ${{env.ENDPOINT_URL}}
service_mesh: ${{env.SERVICE_MESH}}
load_generator: ${{ github.event.inputs.load_generator }}
test_name: '${{ github.event.inputs.service_mesh }}-${{ github.event.inputs.load_generator }}-${{ github.event.inputs.profile_filename }}${{ github.event.inputs.profile_name }}'
# This workflow runs performance benchmarks with Meshery based on the configuration provided
# This workflow needs to be triggered manually by providing the test configuration

name: Configurable Benchmark Test
on:
# for triggering the workflow, provide these inputs
workflow_dispatch:
inputs:
profile_name:
description: "performance profile to use"
required: false
profile_filename:
description: "test configuration file"
required: false
service_mesh:
type: choice
required: false
description: "service mesh being tested"
options:
- istio
- linkerd
load_generator:
type: choice
required: false
description: "load generator to run tests with"
options:
- fortio
- wrk2
- nighthawk

jobs:
manual-test:
name: Configurable Benchmark Test
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Setup Kubernetes
uses: medyagh/[email protected]
with:
minikube version: v1.23.2
kubernetes version: v1.23.2
driver: docker
apus: 4
memory: 5192

- name: Checkout Code
uses: actions/checkout@v2

- name: Install Service Mesh and Deploy Application
run: |
chmod +x .github/workflows/scripts/${{ github.event.inputs.service_mesh }}_deploy.sh
.github/workflows/scripts/${{ github.event.inputs.service_mesh }}_deploy.sh
shell: bash

- name: Initiate tmate session
uses: mxschmitt/action-tmate@v3

- name: Run Benchmark Tests
uses: layer5io/meshery-smp-action@master
with:
provider_token: ${{ secrets.MESHERY_TOKEN }}
platform: docker
profile_name: ${{ github.event.inputs.profile_name }}
profile_filename: ${{ github.event.inputs.profile_filename }}
endpoint_url: ${{env.ENDPOINT_URL}}
service_mesh: ${{env.SERVICE_MESH}}
load_generator: ${{ github.event.inputs.load_generator }}
test_name: '${{ github.event.inputs.service_mesh }}-${{ github.event.inputs.load_generator }}-${{ github.event.inputs.profile_filename }}${{ github.event.inputs.profile_name }}'
20 changes: 16 additions & 4 deletions .github/workflows/scheduled-benchmarks-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ on:
profile_filename:
description: "test configuration file"
required: false
# scheduled to run at everyday at 13:00
# scheduled to run on everyhour
schedule:
- cron: '0 13 * * *'
- cron: '0 * * * *'

jobs:
# Manual Benchmark Test
start-runners-manual:
name: Start self-hosted CNCF CIL runners for manual test
timeout-minutes: 60
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
strategy:
Expand Down Expand Up @@ -60,6 +61,7 @@ jobs:

manual-test:
name: Manual Benchmark Test
timeout-minutes: 60
needs:
- start-runners-manual
runs-on: ${{ matrix.service-mesh }}-${{ matrix.load-generator }}-${{ github.run_id }}
Expand All @@ -84,6 +86,8 @@ jobs:
sudo apt-cache policy docker-ce
sudo apt install -y docker-ce
sudo systemctl status docker
sudo mkdir -p ~/.kube
sudo chmod 777 ~/.kube
- name: Setup Kubernetes
uses: manusa/[email protected]
Expand Down Expand Up @@ -119,6 +123,7 @@ jobs:

stop-runner-manual:
name: Stop self-hosted runner
timeout-minutes: 60
needs:
- start-runners-manual # required to get output from the start-runner job
- manual-test # required to wait when the main job is done
Expand All @@ -140,6 +145,7 @@ jobs:
shell: bash

- name: Remove CNCF CIL runner from github repository
if: always()
run: |
runner_id=$(curl -s -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners | jq '.runners[] | select(.name == "${{ matrix.service-mesh }}-${{ matrix.load-generator }}-${{ needs.start-runners-manual.outputs.github_run_id }}") | {id}' | jq -r .id)
curl -X DELETE -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners/$runner_id
Expand All @@ -148,6 +154,7 @@ jobs:
# Scheduled Benchmark Test
start-runners-scheduled:
name: Start self-hosted CNCF CIL runners for scheduled test
timeout-minutes: 60
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }}
strategy:
Expand Down Expand Up @@ -189,6 +196,7 @@ jobs:

scheduled-test:
name: Scheduled Benchmark Test
timeout-minutes: 60
needs:
- start-runners-scheduled
runs-on: ${{ matrix.service-mesh }}-${{ matrix.load-generator }}-${{ matrix.test-configuration }}-${{ github.run_id }}
Expand All @@ -214,6 +222,8 @@ jobs:
sudo apt-cache policy docker-ce
sudo apt install -y docker-ce
sudo systemctl status docker
sudo mkdir -p ~/.kube
sudo chmod 777 ~/.kube
- name: Setup Kubernetes
uses: manusa/[email protected]
Expand All @@ -236,7 +246,7 @@ jobs:
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H.%M.%S')"

- name: Run Benchmark Tests
uses: layer5io/meshery-smp-action@self-hosted
uses: layer5io/meshery-smp-action@master
with:
provider_token: ${{ secrets.MESHERY_TOKEN }}
platform: docker
Expand All @@ -249,6 +259,7 @@ jobs:

stop-runner-scheduled:
name: Stop self-hosted runner
timeout-minutes: 60
needs:
- start-runners-scheduled # required to get output from the start-runner job
- scheduled-test # required to wait when the main job is done
Expand All @@ -271,7 +282,8 @@ jobs:
shell: bash

- name: Remove CNCF CIL runner from github repository
if: always()
run: |
runner_id=$(curl -s -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners | jq '.runners[] | select(.name == "${{ matrix.service-mesh }}-${{ matrix.load-generator }}-${{ matrix.test-configuration }}-${{ needs.start-runners-scheduled.outputs.github_run_id }}") | {id}' | jq -r .id)
curl -X DELETE -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners/$runner_id
shell: bash
shell: bash
8 changes: 4 additions & 4 deletions .github/workflows/scheduled-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
load-generator: ['fortio', 'wrk2']
steps:
- name: Setup Kubernetes
uses: manusa/[email protected].1
uses: manusa/[email protected].3
with:
minikube version: 'v1.23.2'
kubernetes version: 'v1.22.2'
kubernetes version: 'v1.23.2'
driver: docker

- name: Checkout Code
Expand Down Expand Up @@ -71,10 +71,10 @@ jobs:
test-configuration: ['load-test.yaml','soak-test.yaml']
steps:
- name: Setup Kubernetes
uses: manusa/[email protected].1
uses: manusa/[email protected].3
with:
minikube version: 'v1.23.2'
kubernetes version: 'v1.22.2'
kubernetes version: 'v1.23.2'
driver: docker

- name: Checkout Code
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/scripts/istio_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#!/usr/bin/env bash

# This script is used to deploy Istio on Kubernetes
#
# Also deploys the bookinfo application on Istio and passes the gateway URL to Meshery

# See: https://github.com/service-mesh-performance/service-mesh-performance/blob/master/protos/service_mesh.proto

export MESH_NAME='Istio'
export SERVICE_MESH='ISTIO'

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.11.4 sh -
cd istio-1.11.4
export PATH=$PWD/bin:$PATH
istioctl install --set profile=demo -y
kubectl label namespace default istio-injection=enabled
# Check if mesheryctl is present, else install it
if ! [ -x "$(command -v mesheryctl)" ]; then
echo 'mesheryctl is not installed. Installing mesheryctl client... Standby... (Starting Meshery as well...)' >&2
curl -L https://meshery.io/install | ADAPTERS=istio PLATFORM=kubernetes bash -
fi

kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
sleep 10
#mesheryctl system login --provider None
echo 'E' | mesheryctl mesh deploy adapter meshery-istio:10000 --token "./.github/workflows/auth.json"
sleep 50
echo "Onboarding application... Standby for few minutes..."
mesheryctl pattern apply -f "https://raw.githubusercontent.com/service-mesh-patterns/service-mesh-patterns/master/samples/bookInfoPattern.yaml" --token "./.github/workflows/auth.json"

# Wait for the application to be ready
sleep 100
sleep 50

# Get the gateway URL and export it and
# Expose the service inside the cluster
Expand All @@ -31,6 +34,5 @@ minikube tunnel &> /dev/null &

echo "Service Mesh: $MESH_NAME - $SERVICE_MESH"
echo "Gateway URL: $GATEWAY_URL"

echo "ENDPOINT_URL=$GATEWAY_URL/productpage" >> $GITHUB_ENV
echo "SERVICE_MESH=$SERVICE_MESH" >> $GITHUB_ENV
20 changes: 11 additions & 9 deletions .github/workflows/scripts/linkerd_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
export MESH_NAME='Linkerd'
export SERVICE_MESH='LINKERD'

curl -fsL https://run.linkerd.io/install | sh
export PATH=$PATH:/home/runner/.linkerd2/bin
linkerd version
linkerd check --pre
linkerd install | kubectl apply -f -
linkerd check
# Check if mesheryctl is present, else install it
if ! [ -x "$(command -v mesheryctl)" ]; then
echo 'mesheryctl is not installed. Installing mesheryctl client... Standby... (Starting Meshery as well...)' >&2
curl -L https://meshery.io/install | ADAPTERS=linkerd PLATFORM=kubernetes bash -
fi

curl -fsL https://run.linkerd.io/emojivoto.yml | kubectl apply -f -
kubectl -n emojivoto port-forward svc/web-svc 8080:80 &> /dev/null &
kubectl get -n emojivoto deploy -o yaml | linkerd inject - | kubectl apply -f -
curl -fsL https://run.linkerd.io/emojivoto.yml --output emojivoto.yml
sleep 10
mesheryctl system login --provider None
mesheryctl mesh deploy adapter meshery-linkerd:10001
echo "Onboarding application... Standby for few minutes..."
mesheryctl app onboard -f "./emojivoto.yml"

# Wait for the application to be ready
sleep 100
Expand Down
Loading

0 comments on commit ac95f73

Please sign in to comment.