feat: Add otel metrics #93
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci-alpha-build | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "apis/**" | |
- "cmd/**" | |
- "config/**" | |
- "internal/**" | |
- "pkg/**" | |
- ".gitmodules" | |
- "manifests/**" | |
- "vArmor-ebpf/**" # check submodule content | |
permissions: read-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.SetVersion.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.22" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64/v8 | |
- name: Run build | |
run: make docker-build-dev-ci | |
- name: Package helm chart | |
run: make helm-package-dev | |
- name: Upload Helm Chart as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: helm-chart | |
path: varmor-*.tgz | |
- name: Upload Docker images as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-images | |
path: | | |
varmor-amd64.tar | |
classifier-amd64.tar | |
- id: SetVersion | |
run: echo "version=$(git describe --tags --match "v[0-9]*" | sed 's/^v//')">> "$GITHUB_OUTPUT" | |
deploy-and-basic-test: | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
k8s_version: [ "1.20.15", "1.26.15", "1.30.6" ] | |
os: ["ubuntu-latest" ] | |
runs-on: ${{ matrix.os }} | |
env: | |
KUBE_VER: ${{ matrix.k8s_version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup a Kubernetes environment | |
run: ./.github/scripts/create-k3s-cluster.sh ${{ matrix.k8s_version }} | |
- name: Download Helm Chart Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: helm-chart | |
- name: Download Docker images | |
uses: actions/download-artifact@v4 | |
with: | |
name: docker-images | |
- name: Load Docker images | |
run: | | |
sudo ctr images import varmor-amd64.tar | |
sudo ctr images import classifier-amd64.tar | |
docker load -i varmor-amd64.tar | |
docker load -i classifier-amd64.tar | |
sudo k3s ctr images import varmor-amd64.tar | |
sudo k3s ctr images import classifier-amd64.tar | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Install varmor alpha version | |
run: | | |
helm install varmor varmor-*.tgz \ | |
--namespace varmor --create-namespace \ | |
--set image.registry="elkeid-ap-southeast-1.cr.volces.com" \ | |
--set bpfLsmEnforcer.enabled=true \ | |
--set "agent.bpfRelated.volumes[0].hostPath.type=Directory,agent.bpfRelated.volumes[0].hostPath.path=/sys/fs/bpf,agent.bpfRelated.volumes[0].name=bpffs" \ | |
--set "agent.bpfRelated.volumes[1].hostPath.type=File,agent.bpfRelated.volumes[1].hostPath.path=/sys/kernel/btf/vmlinux,agent.bpfRelated.volumes[1].name=btf" \ | |
--set image.namespace="varmor-test" \ | |
--set manager.image.pullPolicy="Never" \ | |
--set agent.image.pullPolicy="Never" \ | |
--set classifier.image.pullPolicy="Never" | |
- name: Run basic test | |
run: ./.github/scripts/basic-test.sh | |
# - name: Kill all and clean up | |
# if: ${{ always() }} | |
# run: ./.github/scripts/kill-and-clean-all.sh |