Skip to content
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

feature: Add deploy workflow #105

Merged
merged 5 commits into from
Jun 20, 2024
Merged
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
74 changes: 74 additions & 0 deletions .github/workflows/benchmark-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: benchmark-pipeline
on:
workflow_dispatch:
inputs:
cncf_project:
description: Project to be deployed e.g. falco
required: true
cncf_project_sub:
description: Subcomponent if project has multiple variants they wish to test
required: false
version:
description: Version of project to be tested e.g. 0.37.0
required: true

concurrency:
group: benchmark

jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: azure/setup-kubectl@v4
with:
version: v1.30.2
id: install
- run: mkdir ~/.kube && echo ${{ secrets.KUBECONFIG }} > ~/.kube/config
- name: Select the manifest
run: |
MANIFEST=projects/${{ inputs.cncf_project }}
CNCF_PROJECT_SUB=${{ inputs.cncf_project_sub }}
if [[ -n $CNCF_PROJECT_SUB ]]; then
echo "Sub project provided"
MANIFEST=$MANIFEST/$CNCF_PROJECT_SUB.yaml
else
MANIFEST=$MANIFEST/${{ inputs.cncf_project }}.yaml
fi

if ! test -f "$MANIFEST"; then
echo "The provided inputs are invalid."
exit 1
fi

export VERSION=${{ inputs.version }}
envsubst < $MANIFEST > manifest.yaml
- uses: actions/upload-artifact@v4
with:
name: manifest
path: manifest.yaml
- name: Apply the manifest
run: |
kubectl apply -f manifest.yaml

kubectl wait pod \
--all \
--for=condition=Ready \
--namespace=benchmark

delete:
runs-on: ubuntu-22.04
needs: deploy
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- uses: azure/setup-kubectl@v4
with:
version: v1.30.2
id: install
- run: mkdir ~/.kube && echo ${{ secrets.KUBECONFIG }} > ~/.kube/config

- uses: actions/download-artifact@v4
with:
name: manifest
- run: kubectl delete -f manifest.yaml --wait
4 changes: 4 additions & 0 deletions clusters/base/benchmark-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: benchmark
35 changes: 35 additions & 0 deletions projects/falco/ebpf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: falco-cncf-green-review-testing
namespace: benchmark
spec:
interval: 6h
ref:
branch: main
url: https://github.com/falcosecurity/cncf-green-review-testing
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: falco-cncf-green-review-testing
namespace: benchmark
spec:
interval: 6h
path: ./kustomize
prune: true
retryInterval: 2m0s
sourceRef:
kind: GitRepository
name: falco-cncf-green-review-testing
targetNamespace: benchmark
timeout: 3m0s
wait: true
images:
- name: docker.io/falcosecurity/falco-no-driver
newTag: $VERSION
rossf7 marked this conversation as resolved.
Show resolved Hide resolved
- name: docker.io/falcosecurity/falco-driver-loader
newTag: $VERSION
commonMetadata:
labels:
app.kubernetes.io/version: "$VERSION"
35 changes: 35 additions & 0 deletions projects/falco/kmod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: falco-cncf-green-review-testing
namespace: benchmark
spec:
interval: 6h
ref:
branch: main
url: https://github.com/falcosecurity/cncf-green-review-testing
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: falco-cncf-green-review-testing
namespace: benchmark
spec:
interval: 6h
path: ./kustomize
prune: true
retryInterval: 2m0s
sourceRef:
kind: GitRepository
name: falco-cncf-green-review-testing
targetNamespace: benchmark
timeout: 3m0s
wait: true
images:
- name: docker.io/falcosecurity/falco-no-driver
newTag: $VERSION
- name: docker.io/falcosecurity/falco-driver-loader
newTag: $VERSION
commonMetadata:
labels:
app.kubernetes.io/version: "$VERSION"
35 changes: 35 additions & 0 deletions projects/falco/modern-ebpf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: falco-cncf-green-review-testing
namespace: benchmark
spec:
interval: 6h
ref:
branch: main
url: https://github.com/falcosecurity/cncf-green-review-testing
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: falco-cncf-green-review-testing
namespace: benchmark
spec:
interval: 6h
path: ./kustomize
prune: true
retryInterval: 2m0s
sourceRef:
kind: GitRepository
name: falco-cncf-green-review-testing
targetNamespace: benchmark
timeout: 3m0s
wait: true
images:
- name: docker.io/falcosecurity/falco-no-driver
newTag: $VERSION
- name: docker.io/falcosecurity/falco-driver-loader
newTag: $VERSION
commonMetadata:
labels:
app.kubernetes.io/version: "$VERSION"