tarian-detector integration and existing ebpf code removal #489
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: charts | |
on: | |
release: | |
types: [created] | |
pull_request: | |
branches: | |
- main | |
paths: | |
- charts/** | |
- .github/workflows/charts.yml | |
- "**.go" | |
permissions: read-all | |
jobs: | |
# SKIP: Need more refactoring for this workflow, it needs images to be pushed to registry first | |
# lint-helm-chart-test: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
# with: | |
# fetch-depth: 0 | |
# - name: Set up Helm | |
# uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5 | |
# with: | |
# version: v3.12.1 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: '3.9' | |
# check-latest: true | |
# - name: Set up chart-testing | |
# uses: helm/[email protected] | |
# - name: Run chart-testing (list-changed) | |
# id: list-changed | |
# run: | | |
# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) | |
# if [[ -n "$changed" ]]; then | |
# echo "changed=true" >> "$GITHUB_OUTPUT" | |
# fi | |
# - name: Run chart-testing (lint) | |
# if: steps.list-changed.outputs.changed == 'true' | |
# run: ct lint --target-branch ${{ github.event.repository.default_branch }} | |
# - name: Create kind cluster | |
# if: steps.list-changed.outputs.changed == 'true' | |
# uses: helm/[email protected] | |
# - name: Run chart-testing (install) | |
# if: steps.list-changed.outputs.changed == 'true' | |
# run: ct install --target-branch ${{ github.event.repository.default_branch }} | |
charts-test: | |
runs-on: ubuntu-latest | |
# needs: lint-helm-chart-test | |
env: | |
GOPATH: ${{ github.workspace }}/../go | |
HOME: ${{ github.workspace }}/.. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
with: | |
submodules: "recursive" | |
- name: Set up Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #4.1.0 | |
with: | |
go-version: "1.21" | |
cache: false | |
- name: Install helm | |
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5 | |
- name: Kind Cluster | |
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 #v1.8.0 | |
with: | |
config: "dev/cluster-config.yaml" | |
cluster_name: tarian-helm-chart-testing | |
- name: Testing Kind cluster setup | |
run: | | |
set -x | |
# Verify Kind cluster setup | |
kubectl cluster-info | |
kubectl get pods -n kube-system | |
echo "kubectl config current-context:" $(kubectl config current-context) | |
echo "KUBECONFIG env var:" ${KUBECONFIG} | |
- name: Create Kind registry | |
run: | | |
set -x | |
# Create a Kind registry | |
./dev/run-kind-registry.sh | |
- name: Build Tarian | |
run: | | |
set -x | |
sudo apt update && sudo apt install -y jq pkg-config libelf-dev clang | |
go install google.golang.org/protobuf/cmd/protoc-gen-go@32051b4f86e54c2142c7c05362c6e96ae3454a1c # @v1.28.0 | |
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@938f6e2f7550e542bd78f3b9e8812665db109e02 # @v1.1.0 | |
make bin/protoc bin/goreleaser | |
bash ./dev/run-kind-registry.sh | |
make generate | |
./bin/goreleaser release --snapshot --rm-dist | |
make push-local-images | |
cp dist/tarianctl_linux_amd64/tarianctl ./bin/ | |
- name: Install Tarian | |
run: | | |
set -x | |
./bin/tarianctl install --charts ./charts -l debug --agents-values ./dev/values/agents.yaml --server-values ./dev/values/server.yaml | |
continue-on-error: true | |
- name: Wait for pods to be ready | |
id: wait-until-tarian-is-ready | |
run: | | |
set -x | |
# Wait for all pods in the tarian-system namespace to be in the "Ready" state | |
kubectl wait --for=condition=ready pod --all -n tarian-system --timeout=300s | |
continue-on-error: true | |
- name: Run tests | |
id: run-tests | |
if: steps.wait-until-tarian-is-ready.outcome == 'success' | |
run: make k8s-test | |
continue-on-error: true | |
- name: Collect deployment information in case of failure | |
if: steps.wait-until-tarian-is-ready.outcome != 'success' || steps.run-tests.outcome != 'success' | |
run: | | |
set -x | |
# Collect logs and information for debugging in case of failure | |
kubectl get pods -n tarian-system | |
echo "======================================================================================================================" | |
kubectl describe pods -n tarian-system | |
echo "======================================================================================================================" | |
kubectl logs -n tarian-system deploy/tarian-server | |
echo "======================================================================================================================" | |
kubectl logs -n tarian-system deploy/tarian-cluster-agent | |
echo "======================================================================================================================" | |
kubectl logs -n tarian-system deploy/tarian-controller-manager | |
echo "======================================================================================================================" | |
kubectl logs -n tarian-system daemonsets/tarian-node-agent | |
echo "======================================================================================================================" | |
exit 1 | |
# SKIP: Add this part into release workflow | |
# release: | |
# if: startsWith(github.ref, 'refs/heads/main') | |
# needs: charts-test | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: write | |
# env: | |
# GOPATH: ${{ github.workspace }}/../go | |
# HOME: ${{ github.workspace }}/.. | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @3.1.0 | |
# with: | |
# fetch-depth: 0 | |
# - name: Configure Git | |
# run: | | |
# git config user.name "$GITHUB_ACTOR" | |
# git config user.email "[email protected]" | |
# - name: Install Helm | |
# uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5 # @v3.5 | |
# with: | |
# version: '3.11.0' | |
# - name: Run chart-releaser | |
# uses: helm/chart-releaser-action@c25b74a986eb925b398320414b576227f375f946 # @v1.2.1 | |
# with: | |
# config: .cr.yaml | |
# env: | |
# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |