Skip to content
Snippets Groups Projects
Unverified Commit cc0ca5aa authored by Julien Pinsonneau's avatar Julien Pinsonneau Committed by GitHub
Browse files

NETOBSERV-848 eBPF agent multi-arch builds (upstream) (#100)

* multi arch builds

* keep current targets using defined functions

* trap exit

* makefile consistency
parent 42723337
Branches
Tags
No related merge requests found
...@@ -5,11 +5,10 @@ on: ...@@ -5,11 +5,10 @@ on:
env: env:
REGISTRY_USER: netobserv+github_ci REGISTRY_USER: netobserv+github_ci
REGISTRY_PASSWORD: ${{ secrets.QUAY_SECRET }}
REGISTRY: quay.io/netobserv REGISTRY: quay.io/netobserv
IMAGE: netobserv-ebpf-agent IMAGE: netobserv-ebpf-agent
IMAGE_ORG: netobserv ORG: netobserv
TAGS: main VERSION: main
jobs: jobs:
push-image: push-image:
...@@ -27,22 +26,13 @@ jobs: ...@@ -27,22 +26,13 @@ jobs:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: build images - name: docker login to quay.io
run: make ci-images-build uses: docker/login-action@v2
- name: podman login to quay.io
uses: redhat-actions/podman-login@v1
with: with:
username: ${{ env.REGISTRY_USER }} username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }} password: ${{ secrets.QUAY_SECRET }}
registry: quay.io registry: quay.io
- name: get short sha - name: build and push manifest with images
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV run: IMAGE_ORG=${{ env.ORG }} VERSION=${{ env.VERSION }} make ci
- name: push to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE }}
tags: ${{ env.TAGS }} ${{ env.short_sha }}
registry: ${{ env.REGISTRY }}
- name: print image url - name: print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
\ No newline at end of file
...@@ -7,7 +7,8 @@ env: ...@@ -7,7 +7,8 @@ env:
REGISTRY_USER: netobserv+github_ci REGISTRY_USER: netobserv+github_ci
REGISTRY: quay.io/netobserv REGISTRY: quay.io/netobserv
IMAGE: netobserv-ebpf-agent IMAGE: netobserv-ebpf-agent
IMAGE_ORG: netobserv ORG: netobserv
VERSION: temp
jobs: jobs:
push-pr-image: push-pr-image:
...@@ -28,23 +29,18 @@ jobs: ...@@ -28,23 +29,18 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: "refs/pull/${{ github.event.number }}/merge" ref: "refs/pull/${{ github.event.number }}/merge"
- name: build images - name: docker login to quay.io
run: SW_VERSION=temp make ci-images-build uses: docker/login-action@v2
- name: podman login to quay.io
uses: redhat-actions/podman-login@v1
with: with:
username: ${{ env.REGISTRY_USER }} username: ${{ env.REGISTRY_USER }}
password: ${{ secrets.QUAY_SECRET }} password: ${{ secrets.QUAY_SECRET }}
registry: quay.io registry: quay.io
- name: get short sha - name: get short sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: push to quay.io - name: build and push images
id: push-to-quay run: IMAGE_ORG=${{ env.ORG }} IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.short_sha }} make images
uses: redhat-actions/push-to-registry@v2 - name: build and push manifest
with: run: IMAGE_ORG=${{ env.ORG }} VERSION=${{ env.VERSION }} make ci-manifest
image: ${{ env.IMAGE }}
tags: ${{ env.short_sha }}
registry: ${{ env.REGISTRY }}
- uses: actions/github-script@v6 - uses: actions/github-script@v6
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
......
...@@ -37,20 +37,13 @@ jobs: ...@@ -37,20 +37,13 @@ jobs:
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: build images - name: docker login to quay.io
run: SW_VERSION="${{ env.tag }}" make image-build uses: docker/login-action@v2
- name: podman login to quay.io
uses: redhat-actions/podman-login@v1
with: with:
username: ${{ env.REGISTRY_USER }} username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }} password: ${{ env.REGISTRY_PASSWORD }}
registry: quay.io registry: quay.io
- name: push to quay.io - name: build and push images
id: push-to-quay run: VERSION="${{ env.tag }}" make images
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE }}
tags: ${{ env.tag }}
registry: ${{ env.REGISTRY }}
- name: print image url - name: print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
##@ shortcuts helpers
.PHONY: build
build: prereqs fmt lint test vendors compile ## Test and Build ebpf agent
.PHONY: build-image
build-image: image-build ## Build MULTIARCH_TARGETS images
.PHONY: push-image
push-image: image-push ## Push MULTIARCH_TARGETS images
.PHONY: build-manifest
build-manifest: manifest-build ## Build MULTIARCH_TARGETS manifest
.PHONY: push-manifest
push-manifest: manifest-push ## Push MULTIARCH_TARGETS manifest
.PHONY: images
images: image-build image-push manifest-build manifest-push ## Build and push MULTIARCH_TARGETS images and related manifest
.PHONY: build-ci-manifest
build-ci-manifest: ci-manifest-build ## Build CI manifest
.PHONY: push-ci-manifest
push-ci-manifest: ci-manifest-push ## Push CI manifest
.PHONY: ci-manifest
ci-manifest: ci-manifest-build ci-manifest-push ## Build and push CI manifest
.PHONY: ci
ci: images ci-manifest ## Build and push CI images and manifest
\ No newline at end of file
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
ARG TARGETPLATFORM=linux/amd64
ARG BUILDPLATFORM=linux/amd64
# Build the manager binary # Build the manager binary
FROM docker.io/library/golang:1.19 as builder FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.19 as builder
ARG SW_VERSION="unknown" ARG TARGETPLATFORM
ARG TARGETARCH=amd64
ARG VERSION="unknown"
WORKDIR /opt/app-root WORKDIR /opt/app-root
...@@ -14,12 +19,13 @@ COPY vendor/ vendor/ ...@@ -14,12 +19,13 @@ COPY vendor/ vendor/
COPY go.mod go.mod COPY go.mod go.mod
COPY go.sum go.sum COPY go.sum go.sum
COPY Makefile Makefile COPY Makefile Makefile
COPY .mk/ .mk/
# Build # Build
RUN make compile RUN GOARCH=$TARGETARCH make compile
# Create final image from minimal + built binary # Create final image from minimal + built binary
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1 FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.1
WORKDIR / WORKDIR /
COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent . COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent .
USER 65532:65532 USER 65532:65532
......
# SW_VERSION defines the project version for the bundle. # VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project. # Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can: # To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the SW_VERSION as arg of the bundle target (e.g make bundle SW_VERSION=0.0.2) # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export SW_VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
SW_VERSION ?= main VERSION ?= main
BUILD_VERSION := $(shell git describe --long HEAD)
BUILD_DATE := $(shell date +%Y-%m-%d\ %H:%M) BUILD_DATE := $(shell date +%Y-%m-%d\ %H:%M)
TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
BUILD_SHA := $(shell git rev-parse --short HEAD) BUILD_SHA := $(shell git rev-parse --short HEAD)
BUILD_VERSION := $(TAG:v%=%)
ifneq ($(COMMIT), $(TAG_COMMIT))
BUILD_VERSION := $(BUILD_VERSION)-$(BUILD_SHA)
endif
ifneq ($(shell git status --porcelain),)
BUILD_VERSION := $(BUILD_VERSION)-dirty
endif
# Go architecture and targets images to build
GOARCH ?= amd64
MULTIARCH_TARGETS ?= amd64 arm64 ppc64le
# In CI, to be replaced by `netobserv` # In CI, to be replaced by `netobserv`
IMAGE_ORG ?= $(USER) IMAGE_ORG ?= $(USER)
# IMAGE_TAG_BASE defines the namespace and part of the image name for remote images. # IMAGE_TAG_BASE defines the namespace and part of the image name for remote images.
# This variable is used to construct full image tags for bundle and catalog images.
IMAGE_TAG_BASE ?= quay.io/$(IMAGE_ORG)/netobserv-ebpf-agent IMAGE_TAG_BASE ?= quay.io/$(IMAGE_ORG)/netobserv-ebpf-agent
# Image URL to use all building/pushing image targets # Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):$(SW_VERSION) IMAGE ?= $(IMAGE_TAG_BASE):$(VERSION)
IMG_SHA = $(IMAGE_TAG_BASE):$(BUILD_SHA) IMAGE_SHA = $(IMAGE_TAG_BASE):$(BUILD_SHA)
LOCAL_GENERATOR_IMAGE ?= ebpf-generator:latest # Image building tool (docker / podman)
OCI_BIN_PATH := $(shell which podman || which docker)
OCI_BIN ?= $(shell v='$(OCI_BIN_PATH)'; echo "$${v##*/}")
LOCAL_GENERATOR_IMAGE ?= ebpf-generator:latest
CILIUM_EBPF_VERSION := v0.10.0 CILIUM_EBPF_VERSION := v0.10.0
GOLANGCI_LINT_VERSION = v1.50.1 GOLANGCI_LINT_VERSION = v1.50.1
CLANG ?= clang CLANG ?= clang
CFLAGS := -O2 -g -Wall -Werror $(CFLAGS) CFLAGS := -O2 -g -Wall -Werror $(CFLAGS)
GOOS ?= linux GOOS ?= linux
PROTOC_ARTIFACTS := pkg/pbflow PROTOC_ARTIFACTS := pkg/pbflow
# regular expressions for excluded file patterns # regular expressions for excluded file patterns
EXCLUDE_COVERAGE_FILES="(/cmd/)|(bpf_bpfe)|(/examples/)|(/pkg/pbflow/)" EXCLUDE_COVERAGE_FILES="(/cmd/)|(bpf_bpfe)|(/examples/)|(/pkg/pbflow/)"
# Image building tool (docker / podman) .DEFAULT_GOAL := help
ifndef OCI_BIN
ifeq (,$(shell which podman 2>/dev/null)) # build a single arch target provided as argument
OCI_BIN=docker define build_target
else echo 'building image for arch $(1)'; \
OCI_BIN=podman DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETPLATFORM=linux/$(1) --build-arg TARGETARCH=$(1) --build-arg BUILDPLATFORM=linux/amd64 -t ${IMAGE}-$(1) -f Dockerfile .;
endif endef
endif
# push a single arch target image
define push_target
echo 'pushing image ${IMAGE}-$(1)'; \
DOCKER_BUILDKIT=1 $(OCI_BIN) push ${IMAGE}-$(1);
endef
##@ General
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: vendors .PHONY: vendors
vendors: vendors: ## Check go vendors
@echo "### Checking vendors" @echo "### Checking vendors"
go mod tidy && go mod vendor go mod tidy && go mod vendor
.PHONY: prereqs .PHONY: prereqs
prereqs: prereqs: ## Check if prerequisites are met, and install missing dependencies
@echo "### Check if prerequisites are met, and installing missing dependencies" @echo "### Checking if prerequisites are met, and installing missing dependencies"
test -f $(shell go env GOPATH)/bin/golangci-lint || GOFLAGS="" go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} test -f $(shell go env GOPATH)/bin/golangci-lint || GOFLAGS="" go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
test -f $(shell go env GOPATH)/bin/bpf2go || go install github.com/cilium/ebpf/cmd/bpf2go@${CILIUM_EBPF_VERSION} test -f $(shell go env GOPATH)/bin/bpf2go || go install github.com/cilium/ebpf/cmd/bpf2go@${CILIUM_EBPF_VERSION}
test -f $(shell go env GOPATH)/bin/protoc-gen-go || go install google.golang.org/protobuf/cmd/protoc-gen-go@latest test -f $(shell go env GOPATH)/bin/protoc-gen-go || go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
test -f $(shell go env GOPATH)/bin/protoc-gen-go-grpc || go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest test -f $(shell go env GOPATH)/bin/protoc-gen-go-grpc || go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
test -f $(shell go env GOPATH)/bin/kind || go install sigs.k8s.io/kind@latest test -f $(shell go env GOPATH)/bin/kind || go install sigs.k8s.io/kind@latest
##@ Develop
.PHONY: fmt .PHONY: fmt
fmt: ## Run go fmt against code. fmt: ## Run go fmt against code.
@echo "### Formatting code" @echo "### Formatting code"
go fmt ./... go fmt ./...
.PHONY: lint .PHONY: lint
lint: prereqs lint: prereqs ## Lint the code
@echo "### Linting code" @echo "### Linting code"
golangci-lint run ./... --timeout=3m golangci-lint run ./... --timeout=3m
...@@ -72,28 +108,25 @@ lint: prereqs ...@@ -72,28 +108,25 @@ lint: prereqs
.PHONY: generate .PHONY: generate
generate: export BPF_CLANG := $(CLANG) generate: export BPF_CLANG := $(CLANG)
generate: export BPF_CFLAGS := $(CFLAGS) generate: export BPF_CFLAGS := $(CFLAGS)
generate: prereqs generate: prereqs ## Generate artifacts of the code repo (pkg/ebpf and pkg/proto packages)
@echo "### Generating BPF Go bindings" @echo "### Generating BPF Go bindings"
go generate ./pkg/... go generate ./pkg/...
@echo "### Generating gRPC and Protocol Buffers code" @echo "### Generating gRPC and Protocol Buffers code"
protoc --go_out=pkg --go-grpc_out=pkg proto/flow.proto protoc --go_out=pkg --go-grpc_out=pkg proto/flow.proto
.PHONY: docker-generate .PHONY: docker-generate
docker-generate: docker-generate: ## Create the container that generates the eBPF binaries
@echo "### Creating the container that generates the eBPF binaries" @echo "### Creating the container that generates the eBPF binaries"
$(OCI_BIN) build . -f scripts/generators.Dockerfile -t $(LOCAL_GENERATOR_IMAGE) $(OCI_BIN) build . -f scripts/generators.Dockerfile -t $(LOCAL_GENERATOR_IMAGE)
$(OCI_BIN) run --rm -v $(shell pwd):/src $(LOCAL_GENERATOR_IMAGE) $(OCI_BIN) run --rm -v $(shell pwd):/src $(LOCAL_GENERATOR_IMAGE)
.PHONY: build
build: prereqs fmt lint test vendors compile
.PHONY: compile .PHONY: compile
compile: compile: ## Compile ebpf agent project
@echo "### Compiling project" @echo "### Compiling project"
GOOS=$(GOOS) go build -ldflags "-X main.version=${SW_VERSION} -X 'main.buildVersion=${BUILD_VERSION}' -X 'main.buildDate=${BUILD_DATE}'" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go GOARCH=${GOARCH} GOOS=$(GOOS) go build -ldflags "-X main.version=${VERSION} -X 'main.buildVersion=${BUILD_VERSION}' -X 'main.buildDate=${BUILD_DATE}'" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go
.PHONY: test .PHONY: test
test: test: ## Test code using go test
@echo "### Testing code" @echo "### Testing code"
GOOS=$(GOOS) go test -mod vendor -a ./... -coverpkg=./... -coverprofile cover.all.out GOOS=$(GOOS) go test -mod vendor -a ./... -coverpkg=./... -coverprofile cover.all.out
...@@ -102,33 +135,67 @@ cov-exclude-generated: ...@@ -102,33 +135,67 @@ cov-exclude-generated:
grep -vE "(/cmd/)|(bpf_bpfe)|(/examples/)|(/pkg/pbflow/)" cover.all.out > cover.out grep -vE "(/cmd/)|(bpf_bpfe)|(/examples/)|(/pkg/pbflow/)" cover.all.out > cover.out
.PHONY: coverage-report .PHONY: coverage-report
coverage-report: cov-exclude-generated coverage-report: cov-exclude-generated ## Generate coverage report
@echo "### Generating coverage report" @echo "### Generating coverage report"
go tool cover --func=./cover.out go tool cover --func=./cover.out
.PHONY: coverage-report-html .PHONY: coverage-report-html
coverage-report-html: cov-exclude-generated coverage-report-html: cov-exclude-generated ## Generate HTML coverage report
@echo "### Generating HTML coverage report" @echo "### Generating HTML coverage report"
go tool cover --html=./cover.out go tool cover --html=./cover.out
.PHONY: image-build
image-build: ## Build OCI image with the manager.
$(OCI_BIN) build --build-arg SW_VERSION="$(SW_VERSION)" -t ${IMG} .
.PHONY: ci-images-build
ci-images-build: image-build
$(OCI_BIN) build --build-arg BASE_IMAGE=$(IMG) -t $(IMG_SHA) -f scripts/shortlived.Dockerfile .
.PHONY: image-push
image-push: ## Push OCI image with the manager.
$(OCI_BIN) push ${IMG}
.PHONY: tests-e2e .PHONY: tests-e2e
.ONESHELL: .ONESHELL:
tests-e2e: prereqs tests-e2e: prereqs ## Run e2e tests
go clean -testcache go clean -testcache
# making the local agent image available to kind in two ways, so it will work in different # making the local agent image available to kind in two ways, so it will work in different
# environments: (1) as image tagged in the local repository (2) as image archive. # environments: (1) as image tagged in the local repository (2) as image archive.
$(OCI_BIN) build . -t localhost/ebpf-agent:test $(OCI_BIN) build . -t localhost/ebpf-agent:test
$(OCI_BIN) save -o ebpf-agent.tar localhost/ebpf-agent:test $(OCI_BIN) save -o ebpf-agent.tar localhost/ebpf-agent:test
GOOS=$(GOOS) go test -p 1 -timeout 30m -v -mod vendor -tags e2e ./e2e/... GOOS=$(GOOS) go test -p 1 -timeout 30m -v -mod vendor -tags e2e ./e2e/...
##@ Images
# note: to build and push custom image tag use: IMAGE_ORG=myuser VERSION=dev s
.PHONY: image-build
image-build: ## Build MULTIARCH_TARGETS images
trap 'exit' INT; \
$(foreach target,$(MULTIARCH_TARGETS),$(call build_target,$(target)))
.PHONY: image-push
image-push: ## Push MULTIARCH_TARGETS images
trap 'exit' INT; \
$(foreach target,$(MULTIARCH_TARGETS),$(call push_target,$(target)))
.PHONY: manifest-build
manifest-build: ## Build MULTIARCH_TARGETS manifest
@echo 'building manifest $(IMAGE)'
DOCKER_BUILDKIT=1 $(OCI_BIN) manifest create ${IMAGE} $(foreach target,$(MULTIARCH_TARGETS),--amend ${IMAGE}-$(target));
.PHONY: manifest-push
manifest-push: ## Push MULTIARCH_TARGETS manifest
@echo 'publish manifest $(IMAGE)'
ifeq (${OCI_BIN}, docker)
DOCKER_BUILDKIT=1 $(OCI_BIN) manifest push ${IMAGE};
else
DOCKER_BUILDKIT=1 $(OCI_BIN) manifest push ${IMAGE} docker://${IMAGE};
endif
.PHONY: ci-manifest-build
ci-manifest-build: manifest-build ## Build CI manifest
$(OCI_BIN) build --build-arg BASE_IMAGE=$(IMAGE) -t $(IMAGE_SHA) -f scripts/shortlived.Dockerfile .
ifeq ($(VERSION), main)
# Also tag "latest" only for branch "main"
$(OCI_BIN) build -t $(IMAGE) -t $(IMAGE_TAG_BASE):latest -f scripts/shortlived.Dockerfile .
endif
.PHONY: ci-manifest-push
ci-manifest-push: ## Push CI manifest
$(OCI_BIN) push $(IMAGE_SHA)
ifeq ($(VERSION), main)
# Also tag "latest" only for branch "main"
$(OCI_BIN) push ${IMAGE}
$(OCI_BIN) push $(IMAGE_TAG_BASE):latest
endif
include .mk/shortcuts.mk
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
The Network Observability eBPF Agent allows collecting and aggregating all the ingress and The Network Observability eBPF Agent allows collecting and aggregating all the ingress and
egress flows on a Linux host (required a Kernel 4.18+ with eBPF enabled). egress flows on a Linux host (required a Kernel 4.18+ with eBPF enabled).
* [How to compile](#how-to-compile) * [How to build](#how-to-build)
* [How to configure](#how-to-configure) * [How to configure](#how-to-configure)
* [How to run](#how-to-run) * [How to run](#how-to-run)
* [Development receipts](#development-receipts) * [Development receipts](#development-receipts)
...@@ -13,16 +13,24 @@ egress flows on a Linux host (required a Kernel 4.18+ with eBPF enabled). ...@@ -13,16 +13,24 @@ egress flows on a Linux host (required a Kernel 4.18+ with eBPF enabled).
* [Frequently-asked questions](#frequently-asked-questions) * [Frequently-asked questions](#frequently-asked-questions)
* [Troubleshooting](#troubleshooting) * [Troubleshooting](#troubleshooting)
## How to compile ## How to build
``` To build the agent image and push it to your Docker / Quay repository, run:
```bash
# compile project
make build make build
```
To build the agent image and push it to your Docker / Quay repository, run: # build the default image (quay.io/netobserv/netobserv-ebpf-agent:main):
make image-build
```bash # push the default image (quay.io/netobserv/netobserv-ebpf-agent:main):
IMG=quay.io/myaccount/netobserv-ebpf-agent:dev make image-build image-push make image-push
# build and push on your own quay.io account (quay.io/myuser/netobserv-ebpf-agent:dev):
IMAGE_ORG=myuser VERSION=dev make images
# build and push on a different registry
IMAGE=dockerhub.io/myuser/plugin:tag make images
``` ```
## How to configure ## How to configure
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment