Skip to content

Commit

Permalink
components register check added
Browse files Browse the repository at this point in the history
Signed-off-by: asubedy <[email protected]>
  • Loading branch information
asubedy committed Jul 17, 2023
1 parent 79fbbe9 commit 69f382f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 38 deletions.
79 changes: 58 additions & 21 deletions .github/workflows/scheduled-istioCrypto-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }}
# strategy:
# fail-fast: false
# matrix:
# service-mesh: ['istio', 'linkerd', 'osm']
# load-generator: ['fortio', 'wrk2']
# test-configuration: ['load-test','soak-test']
outputs:
github_run_id: ${{ env.GITHUB_RUN_ID }} # use this github_run_id as a suffix for CIL machines and runners
steps:
Expand Down Expand Up @@ -64,12 +58,6 @@ jobs:
- start-runners-scheduled
runs-on: istioCrypto-fortio-load-${{ github.run_id }}
if: ${{ github.event_name == 'schedule' }}
strategy:
# fail-fast: false
# matrix:
# service-mesh: ['istio', 'linkerd', 'osm']
# load-generator: ['fortio', 'wrk2']
# test-configuration: ['load-test','soak-test']
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -99,6 +87,60 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Istio Operator and Gateway CRD
run: |
cat /proc/cpuinfo | grep avx
curl -L https://istio.io/downloadIstio | sh -
cd istio-1.18.0
export PATH=$PWD/bin:$PATH
istioctl operator init
pwd
kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.6.2" | kubectl apply -f -;
- name: MeshModel Component Register Check
run: |
kubectl config view --minify --flatten > ~/minified_config
mv ~/minified_config ~/.kube/config
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 -
#forces meshery to register components and checks
curl --location 'localhost:9081/api/system/sync' \
--header 'meshery-token:${{ secrets.MESHERY_TOKEN }} \
--header 'Cookie: meshery-provider=Meshery; meshery.layer5.io_ref=/;token=${{ secrets.MESHERY_TOKEN }}
curl --location 'localhost:9081/api/system/sync' \
--header 'meshery-token:${{ secrets.MESHERY_TOKEN }} \
--header 'Cookie: meshery-provider=Meshery; meshery.layer5.io_ref=/;token=${{ secrets.MESHERY_TOKEN }}
check_endpoint() {
response=$(curl -s http://localhost:9081/api/meshmodels/models/kubernetes/components/IstioOperator \
-H 'Cookie: meshery-provider=Meshery;token=${{ secrets.MESHERY_TOKEN }}
)
total_count=$(echo "$response" | grep -oP '(?<="total_count":)\d+')
if [[ $total_count -ne 0 ]]; then
echo "Components Registered"
exit 0
fi
}
# Set the duration for script execution (in seconds)
duration=$((5 * 60))
# Calculate the end time
end_time=$((SECONDS + duration))
# Loop until the end time is reached
while [[ $SECONDS -lt $end_time ]]; do
check_endpoint
echo "Checked, Components not registered"
sleep 60
done
echo "Waited for 5 minutes components not registered"
- name: Deploy Istio Crypto design and deploy httpbin application
run: |
chmod +x .github/workflows/scripts/istioCrypto.sh
Expand All @@ -114,11 +156,11 @@ jobs:
with:
provider_token: ${{ secrets.MESHERY_TOKEN }}
platform: docker
profile_filename: ${{ matrix.test-configuration }}.yaml
profile_filename: load-test.yaml
endpoint_url: ${{env.ENDPOINT_URL}}
service_mesh: ${{env.SERVICE_MESH}}
load_generator: ${{ matrix.load-generator }}
profile_name: 'istioCrypto-${{ matrix.test-configuration }}'
load_generator: fortio
profile_name: 'istioCrypto-load-test.yaml'
test_name: '${{ steps.date.outputs.date }}'

stop-runner-scheduled:
Expand All @@ -128,17 +170,12 @@ jobs:
- start-runners-scheduled # required to get output from the start-runner job
- scheduled-test # required to wait when the main job is done
runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# service-mesh: ['istio', 'linkerd', 'osm']
# load-generator: ['fortio', 'wrk2']
# test-configuration: ['load-test','soak-test']
if: ${{ always() && github.event_name == 'schedule' }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Checkout Code
uses: actions/checkout@v2


- name: Stop CNCF CIL runner
run: |
chmod +x .github/workflows/scripts/stop-cil-runner.sh
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/scripts/istioCrypto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
export MESH_NAME='Istio'
export SERVICE_MESH='ISTIO'

# 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

sleep 200
kubectl get pods -n meshery

echo "Meshery has been installed."
Expand All @@ -22,25 +15,20 @@ echo "Meshery has been installed."

sleep 200

kubectl get all -n istio-system

# so that istio operator gets initialized
mesheryctl system stop

sleep 400

mesheryctl system start

# Applying/deploying crpyto pattern
mesheryctl pattern apply -f ../CryptoMB-design.yaml
echo "Applying IstioCrypto Design"
mesheryctl pattern apply -f ../CryptoMB-design.yaml --token "./.github/workflows/auth.json"

sleep 200


kubectl get all -n istio-operator

# deplyoing httbin application
mesheryctl app onboard -f ../httpbin.yaml -s "Kubernetes Manifest"
echo "OnBoarding IstioCrypto Design"
mesheryctl app onboard -f ../httpbin.yaml -s "Kubernetes Manifest" --token "./.github/workflows/auth.json"

sleep 100

Expand All @@ -62,5 +50,5 @@ export GATEWAY_URL=http://$INGRESS_HOST:$INGRESS_PORT/headers

echo "Service Mesh: $MESH_NAME - $SERVICE_MESH"
echo "Gateway URL: $GATEWAY_URL"
echo "ENDPOINT_URL=$GATEWAY_URL/productpage" >> $GITHUB_ENV
echo "ENDPOINT_URL=$GATEWAY_URL >> $GITHUB_ENV
echo "SERVICE_MESH=$SERVICE_MESH" >> $GITHUB_ENV

0 comments on commit 69f382f

Please sign in to comment.