Skip to content

feat(litmus): add pod annotations support #559

feat(litmus): add pod annotations support

feat(litmus): add pod annotations support #559

Workflow file for this run

name: LitmusHelm-E2E
on:
issue_comment:
types: [created]
jobs:
tests:
if: contains(github.event.comment.html_url, '/pull/') && startsWith(github.event.comment.body, '/run-e2e')
runs-on: ubuntu-latest
steps:
- name: Notification for e2e Start
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
**Test Status:** The e2e test has been started please wait for the results ...
****
| Experiment | Result | Runtime |
|------------|--------|---------|
#Using the last commit id of pull request
- uses: octokit/[email protected]
id: get_PR_commits
with:
route: GET /repos/:repo/pulls/:pull_number/commits
repo: ${{ github.repository }}
pull_number: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: set commit to output
id: getcommit
run: |
prsha=$(echo $response | jq '.[-1].sha' | tr -d '"')
echo "sha=$prsha" >> $GITHUB_OUTPUT
env:
response: ${{ steps.get_PR_commits.outputs.data }}
- uses: actions/checkout@v4
with:
ref: ${{steps.getcommit.outputs.sha}}
- name: Install helm and helmfile
run: |
echo "Installting helm .........................."
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
echo "Installting helmfile ......................"
wget https://github.com/roboll/helmfile/releases/download/v0.135.0/helmfile_linux_amd64 -O helmfile
chmod +x helmfile
#Install and configure a kind cluster
- name: Installing Prerequisites (KinD Cluster)
uses: engineerd/[email protected]
with:
version: "v0.7.0"
- name: Configuring and testing the Installation
run: |
kubectl cluster-info --context kind-kind
kind get kubeconfig --internal >$HOME/.kube/config
kubectl get nodes
- name: Deploy a sample application for chaos injection
run: |
kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml
sleep 30
- name: Setting up kubeconfig ENV for Github Chaos Action
run: echo ::set-env name=KUBE_CONFIG_DATA::$(base64 -w 0 ~/.kube/config)
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- run: ./helmfile sync
- name: Running Litmus pod delete chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-delete') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-delete
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
- name: Update pod delete result
if: startsWith(github.event.comment.body, '/run-e2e-pod-delete') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Delete | Pass | containerd |
- name: Running container kill chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-container-kill') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: container-kill
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
CONTAINER_RUNTIME: containerd
- name: Update container-kill result
if: startsWith(github.event.comment.body, '/run-e2e-container-kill') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Container Kill | Pass | containerd |
- name: Running node-cpu-hog chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-node-cpu-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: node-cpu-hog
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
- name: Update node-cpu-hog result
if: startsWith(github.event.comment.body, '/run-e2e-node-cpu-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Node CPU Hog | Pass | containerd |
- name: Running node-memory-hog chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-node-memory-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: node-memory-hog
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
- name: Update node-memory-hog result
if: startsWith(github.event.comment.body, '/run-e2e-node-memory-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Node MEMORY Hog | Pass | containerd |
- name: Running pod-cpu-hog chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-cpu-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-cpu-hog
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
CPU_CORES: 1
- name: Update pod-cpu-hog result
if: startsWith(github.event.comment.body, '/run-e2e-pod-cpu-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod CPU Hog | Pass | containerd |
- name: Running pod-memory-hog chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-memory-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-cpu-hog
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
MEMORY_CONSUMPTION: 500
- name: Update pod-memory-hog result
if: startsWith(github.event.comment.body, '/run-e2e-pod-memory-hog') || startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Memory Hog | Pass | containerd |
- name: Running pod network corruption chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-corruption') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-network-corruption
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
NETWORK_INTERFACE: eth0
CONTAINER_RUNTIME: containerd
- name: Update pod-network-corruption result
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-corruption') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Network Corruption | Pass | containerd |
- name: Running pod network duplication chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-duplication') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-network-duplication
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
NETWORK_INTERFACE: eth0
CONTAINER_RUNTIME: containerd
- name: Update pod-network-duplication result
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-duplication') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Network Duplication | Pass | containerd |
- name: Running pod-network-latency chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-latency') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-network-latency
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
NETWORK_INTERFACE: eth0
NETWORK_LATENCY: 60000
CONTAINER_RUNTIME: containerd
- name: Update pod-network-latency result
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-latency') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Network Latency | Pass | containerd |
- name: Running pod-network-loss chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-loss') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-network-loss
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
NETWORK_INTERFACE: eth0
NETWORK_PACKET_LOSS_PERCENTAGE: 100
CONTAINER_RUNTIME: containerd
- name: Update pod-network-loss result
if: startsWith(github.event.comment.body, '/run-e2e-pod-network-loss') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Network Loss | Pass | containerd |
- name: Running pod autoscaler chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-pod-autoscaler') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: pod-autoscaler
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TOTAL_CHAOS_DURATION: 60
- name: Update pod-autoscaler result
if: startsWith(github.event.comment.body, '/run-e2e-pod-autoscaler') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Pod Autoscaler | Pass | containerd |
- name: Running node-io-stress chaos experiment
if: startsWith(github.event.comment.body, '/run-e2e-node-io-stress') || startsWith(github.event.comment.body, '/run-e2e-io-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: mayadata-io/[email protected]
env:
EXPERIMENT_NAME: node-io-stress
EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG: ci
JOB_CLEANUP_POLICY: delete
TOTAL_CHAOS_DURATION: 120
FILESYSTEM_UTILIZATION_PERCENTAGE: 10
- name: Update node-io-stress result
if: startsWith(github.event.comment.body, '/run-e2e-node-io-stress') || startsWith(github.event.comment.body, '/run-e2e-io-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
| Node IO Stress | Pass | containerd |
- name: Check the test run
if: |
startsWith(github.event.comment.body, '/run-e2e-pod-delete') || startsWith(github.event.comment.body, '/run-e2e-container-kill') ||
startsWith(github.event.comment.body, '/run-e2e-node-cpu-hog') || startsWith(github.event.comment.body, '/run-e2e-node-memory-hog') ||
startsWith(github.event.comment.body, '/run-e2e-pod-cpu-hog') || startsWith(github.event.comment.body, '/run-e2e-pod-memory-hog') ||
startsWith(github.event.comment.body, '/run-e2e-pod-network-corruption') || startsWith(github.event.comment.body, '/run-e2e-pod-network-loss') ||
startsWith(github.event.comment.body, '/run-e2e-pod-network-latency') || startsWith(github.event.comment.body, '/run-e2e-pod-network-duplication') ||
startsWith(github.event.comment.body, '/run-e2e-pod-autoscaler') || startsWith(github.event.comment.body, '/run-e2e-node-io-stress') ||
startsWith(github.event.comment.body, '/run-e2e-resource-chaos') || startsWith(github.event.comment.body, '/run-e2e-network-chaos') ||
startsWith(github.event.comment.body, '/run-e2e-io-chaos') || startsWith(github.event.comment.body, '/run-e2e-all')
run: |
echo ::set-env name=TEST_RUN::true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Check for all the jobs are succeeded
if: ${{ success() && env.TEST_RUN == 'true' }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
****
**Test Result:** All tests are passed
**Run ID:** [${{ env.RUN_ID }}](https://github.com/litmuschaos/litmus-helm/actions/runs/${{ env.RUN_ID }})
reactions: hooray
env:
RUN_ID: ${{ github.run_id }}
- name: Check for any job failed
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
****
**Test Failed:** Some tests are failed please check
**Run ID:** [${{ env.RUN_ID }}](https://github.com/litmuschaos/litmus-helm/actions/runs/${{ env.RUN_ID }})
reactions: confused
env:
RUN_ID: ${{ github.run_id }}
- name: Deleting KinD cluster
if: ${{ always() }}
run: kind delete cluster
- name: Check if any test ran or not
if: env.TEST_RUN != 'true'
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: "${{ github.event.comment.id }}"
body: |
****
**Test Result:** No test found
**Run ID:** [${{ env.RUN_ID }}](https://github.com/litmuschaoslitmus-helm/actions/runs/${{ env.RUN_ID }})
reactions: eyes
env:
RUN_ID: ${{ github.run_id }}