+
Skip to content

chores(test): test install action #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 12 additions & 106 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,14 @@ jobs:
permissions:
pull-requests: write
steps:

- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

## Documents should contain desc. of all these fields and how to generate and store the baseline
## Set of examples [With all the fields]
##FAQs:
## - My app. creates temp files and I need to ignore those files, what should be the solution here?
## - I want my CI to pass, but still generate the report
## - I want to only list Process, file or syscall events, what should I do?
## TODO: Create similar action for k8tls
#
# - name: Kubearmor action [2 Actions]
# uses: accuknox-action@semver
# with:
# kubearmor-image: stable[IMAGE_NAME]
# discovery-engine: stable[IMAGE_NAME]
# workload-namespace: [""] [Phase 2]
# license-key: "string"[Secrets] [Phase 2]
# user-id: "" [Phase 2]
#
# - name: Kubearmor action to generate report[2 Actions]
# uses: accuknox-report@semver
# with:
# baseline-report-path: "" [Github]
# labels: "" ["kubearmor-app: kubearmor-relay"]
# operation: ""[Process, file, Network, Syscall]
# container-name: "" []
# namespaces: [""]
# workloads: ["deployment/mysql","statefulsets/vault","deployment/*"]
# source: ""
# process-ignore-paths: "/sbin" [Regex]
# file-ignore-paths: "/sbin" [Regex]
# ignore-return-code: true/false
# view: tabular/ [Phase 2]


# - name: Installing Prerequisites (Kind Cluster)
# uses: helm/kind-action@v1.4.0
- uses: actions/setup-go@v3
with:
go-version: "v1.20"

- name: Checkout kubearmor repo
uses: actions/checkout@v3
Expand All @@ -62,30 +29,6 @@ jobs:
ref: main
path: Kubearmor

- name: Checkout Discovery engine repo
uses: actions/checkout@v3
with:
repository: accuknox/discovery-engine
ref: dev
path: discovery-engine

- uses: actions/setup-go@v3
with:
go-version: "v1.20"

# - name: Install the latest LLVM toolchain
# run: ./Kubearmor/.github/workflows/install-llvm.sh
#
# - name: Compile libbpf
# run: |
# ls
# cd Kubearmor
# ls
# cd KubeArmor/BPF
# git submodule update --init --recursive
# ls
# make -C libbpf/src

- name: Setup a Kubernetes environment
run: ./Kubearmor/contribution/k3s/install_k3s.sh

Expand All @@ -94,24 +37,10 @@ jobs:
kubectl wait --for=condition=Ready nodes --all --timeout=120s
sudo apt install socat

- name: Checkout accuknox-cli repo
uses: actions/checkout@v3
- name: test-install
uses: rajaSahil/gh-action@v0.0.6
with:
repository: rajaSahil/accuknox-cli
ref: feat-report
path: accuknox-cli

- name: Install accuknox-cli, kubearmor and discovery engine
run: |
cd accuknox-cli
./accuknox-cli version
./accuknox-cli install
kubectl get pods -A
sleep 100
kubectl get pods -A

# kubectl describe -f $(kubectl get pods -l app=discovery-engine -A -o jsonpath='{.items[0].metadata.name}') -n accuknox-agents

action: 'install'

- name: Deploy test application
run: |
Expand All @@ -127,35 +56,10 @@ jobs:
helm repo update
helm install kps prometheus-community/kube-prometheus-stack

# - name: Test KubeArmor using Ginkgo
# run: |
# cd Kubearmor
# go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
# make -C tests/
# timeout-minutes: 30

# - name: Test Discovery engine using Ginkgo
# run: |
# curl -sfL http://get.kubearmor.io/ | sudo sh -s -- -b /usr/local/bin
# cd discovery-engine/tests
# go mod tidy
# go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
# ginkgo -r
# timeout-minutes: 30

- name: Generate report
run: |
kubectl get pods -A
sleep 200
kubectl get pods -A
mkdir downloads
touch table
./accuknox-cli/accuknox-cli report -b "baseline/report.json" > downloads/table
cat downloads/table
mv /tmp/report-*.json downloads/report.json
mv /tmp/diff-report-*.json downloads/diff-report.json
mv /tmp/diff-report-*.md downloads/diff-report.md

- name: test-install
uses: rajaSahil/gh-action@v0.0.6
with:
action: 'report'

- name: Upload artifects
uses: actions/upload-artifact@v2
Expand All @@ -167,3 +71,5 @@ jobs:
uses: thollander/actions-comment-pull-request@v2
with:
filePath: downloads/diff-report.md


Empty file added actions/install/action.yaml
Empty file.
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载