Skip to content

Commit e51ebe1

Browse files
authored
updating image to remove vulnerabilities and added e2e pipeline (#30)
Signed-off-by: Oum Kale <[email protected]>
1 parent afb46c8 commit e51ebe1

File tree

5 files changed

+108
-7
lines changed

5 files changed

+108
-7
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ jobs:
6666
exit-code: '1'
6767
ignore-unfixed: true
6868
vuln-type: 'os,library'
69-
severity: 'CRITICAL,HIGH'
69+
severity: 'CRITICAL,HIGH'
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
name: Pod-Level-Pipeline
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
e2eTestRepo:
7+
default: "litmuschaos/litmus-e2e"
8+
e2eTestBranch:
9+
default: "master"
10+
experimentImage:
11+
default: "litmuschaos/py-runner:ci"
12+
operatorImage:
13+
default: "litmuschaos/chaos-operator:ci"
14+
runnerImage:
15+
default: "litmuschaos/chaos-runner:ci"
16+
expTunnableNS:
17+
default: "experiments-tunnable"
18+
chaosNamespace:
19+
default: "litmus"
20+
imagePullPolicy:
21+
default: "Always"
22+
chaosServiceAccount:
23+
default: ""
24+
25+
jobs:
26+
Pod_Delete_Test:
27+
if: always()
28+
runs-on: ubuntu-latest
29+
env:
30+
OPERATOR_IMAGE: "${{ github.event.inputs.operatorImage }}"
31+
RUNNER_IMAGE: "${{ github.event.inputs.runnerImage }}"
32+
IMAGE_PULL_POLICY: "${{ github.event.inputs.imagePullPolicy }}"
33+
EXPERIMENT_IMAGE: "${{ github.event.inputs.experimentImage }}"
34+
CHAOS_NAMESPACE: "${{ github.event.inputs.chaosNamespace }}"
35+
APP_NS: "${{ github.event.inputs.chaosNamespace }}"
36+
CHAOS_SERVICE_ACCOUNT: "${{ github.event.inputs.chaosServiceAccount }}"
37+
UPDATE_WEBSITE: "false"
38+
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
39+
POD_LEVEL: "true"
40+
ARGS: "-c,python3 -u experiment"
41+
COMMAND: "/bin/bash"
42+
43+
steps:
44+
- uses: actions/setup-go@v2
45+
with:
46+
go-version: '1.16'
47+
48+
- uses: actions/checkout@v2
49+
with:
50+
lfs: true
51+
repository: '${{ github.event.inputs.e2eTestRepo }}'
52+
ref: '${{ github.event.inputs.e2eTestBranch }}'
53+
54+
- name: Installing Prerequisites (K3S Cluster)
55+
run: |
56+
curl -sfL https://get.k3s.io | sh -s - --docker --write-kubeconfig-mode 664
57+
kubectl wait node --all --for condition=ready --timeout=90s
58+
kubectl get nodes
59+
60+
- name: Litmus Infra Setup In Cluster-1
61+
if: ${{ always() }}
62+
run: |
63+
make build-litmus
64+
65+
- name: Deploy App In Cluster-1
66+
if: ${{ always() }}
67+
run: make app-deploy
68+
69+
- name: TCID-K3S-GENERIC-APP-POD-DELETE
70+
if: ${{ always() }}
71+
run: make pod-delete
72+
73+
- name: "[Debug]: check chaos resources"
74+
if: ${{ failure() }}
75+
continue-on-error: true
76+
run: |
77+
bash <(curl -s https://raw.githubusercontent.com/litmuschaos/litmus-e2e/master/build/debug.sh)
78+
79+
- name: "[Debug]: check operator logs"
80+
if: ${{ failure() }}
81+
continue-on-error: true
82+
run: |
83+
operator_name=$(kubectl get pods -n litmus -l app.kubernetes.io/component=operator --no-headers | awk '{print$1}')
84+
kubectl logs $operator_name -n litmus > logs.txt
85+
cat logs.txt
86+
87+
- name: Application Cleanup
88+
if: ${{ always() }}
89+
run: make app-cleanup
90+
91+
- name: Litmus Cleanup
92+
if: ${{ always() }}
93+
run: make litmus-cleanup
94+
95+
- name: Deleting K3S cluster
96+
if: always()
97+
run: /usr/local/bin/k3s-uninstall.sh

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to Litmus-Go
1+
# Contributing to Litmus-Python
22

33
Litmus is an Apache 2.0 Licensed project and uses the standard GitHub pull requests process to review and accept contributions.
44

@@ -47,7 +47,7 @@ You can also use git [aliases](https://git-scm.com/book/tr/v2/Git-Basics-Git-Ali
4747

4848
## Setting up your Development Environment
4949

50-
This project is implemented using Go and uses the standard golang tools for development and build. In addition, this project heavily relies on Docker and Kubernetes. It is expected that the contributors.
50+
This project is implemented using Python and uses the standard python tools for development and build. In addition, this project heavily relies on Docker and Kubernetes. It is expected that the contributors.
5151

5252
- are familiar with working with Python
5353
- are familiar with Docker containers

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
FROM python:3.8
32

43
LABEL maintainer="LitmusChaos"
@@ -8,6 +7,7 @@ ARG TARGETARCH
87
# upgrade and setup python
98
RUN apt-get update \
109
&& apt-get -y install gcc python3-pip python-dev curl \
10+
&& apt-get install -y libapr1-dev linux-libc-dev \
1111
&& pip install --upgrade pip \
1212
&& pip install jinja2 pyYaml
1313

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### litmus-python:
1+
# litmus-python:
22

33
[![Slack Channel](https://img.shields.io/badge/Slack-Join-purple)](https://slack.litmuschaos.io)
44
![GitHub Workflow](https://github.com/litmuschaos/litmus-python/actions/workflows/push.yml/badge.svg?branch=master)
@@ -7,14 +7,14 @@
77
[![Twitter Follow](https://img.shields.io/twitter/follow/litmuschaos?style=social)](https://twitter.com/LitmusChaos)
88
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5298/badge)](https://bestpractices.coreinfrastructure.org/projects/5298)
99
[![YouTube Channel](https://img.shields.io/badge/YouTube-Subscribe-red)](https://www.youtube.com/channel/UCa57PMqmz_j0wnteRa9nCaw)
10-
<br><br>
10+
<br>
1111

1212
- This repo consists of Litmus Chaos Experiments written in python. The examples in this repo are good indicators of how to construct the experiments in python: complete with steady state checks, chaosresult generation, chaos injection,
1313
post chaos checks, create events and reports for observability and configure sinks for these.
1414

1515
**NOTE**
1616

17-
- This repo can be viewed as an extension to the [litmuschaos/litmus](https://github.com litmuschaos/litmus) repo in the sense that the litmus repo also houses a significant set of experiments, built using ansible. The litmus repo will also continue to be the project's community-facing meta repo housing other important project artifacts. In that sense, litmus-py is very similar to and therefore a sister repo of [litmus-go](https://github.com/litmuschaos/litmus-go) which houses examples for experiment business logic written in python.
17+
- This repo can be viewed as an extension to the [litmuschaos/litmus](https://github.com/litmuschaos/litmus) repo. The litmus repo will also continue to be the project's community-facing meta repo housing other important project artifacts. In that sense, litmus-py is very similar to and therefore a sister repo of [litmus-go](https://github.com/litmuschaos/litmus-go) which houses examples for experiment business logic written in go.
1818

1919
## Litmus SDK
2020

@@ -34,5 +34,9 @@ You can contribute by raising issues, improving the documentation, contributing
3434

3535
Head over to the [Contribution guide](CONTRIBUTING.md)
3636

37+
38+
### Blogs
39+
- [Create Chaos Experiments Using the LitmusChaos Python SDK](https://dev.to/oumkale/create-chaos-experiments-using-the-litmuschaos-python-sdk-4492)
40+
3741
## License
3842
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flitmuschaos%2Flitmus-python.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Flitmuschaos%2Flitmus-python?ref=badge_large)

0 commit comments

Comments
 (0)