-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from msherif1234/bpfman_intg
SDN-5393: eBPF agent intg with bpfman for ebpf progs life cycle mgmts
- Loading branch information
Showing
16 changed files
with
421 additions
and
166 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
## see https://go.dev/doc/install/source#environment for valid | ||
## GOARCHes when GOOS=linux. | ||
FROM scratch | ||
ARG TARGETARCH | ||
ARG TARGETOS | ||
|
||
FROM scratch AS linux386 | ||
ARG BC_386_EL | ||
COPY $BC_386_EL / | ||
|
||
FROM scratch AS linuxamd64 | ||
ARG BC_AMD64_EL | ||
COPY $BC_AMD64_EL / | ||
|
||
FROM scratch AS linuxarm | ||
ARG BC_ARM_EL | ||
COPY $BC_ARM_EL / | ||
|
||
FROM scratch AS linuxarm64 | ||
ARG BC_ARM64_EL | ||
COPY $BC_ARM64_EL / | ||
|
||
FROM scratch AS linuxloong64 | ||
ARG BC_LOONG64_EL | ||
COPY $BC_LOONG64_EL / | ||
|
||
FROM scratch AS linuxmips | ||
ARG BC_MIPS_EB | ||
COPY $BC_MIPS_EB / | ||
|
||
FROM scratch AS linuxmipsle | ||
ARG BC_MIPSLE_EL | ||
COPY $BC_MIPSLE_EL / | ||
|
||
FROM scratch AS linuxmips64 | ||
ARG BC_MIPS64_EB | ||
COPY $BC_MIPS64_EB / | ||
|
||
FROM scratch AS linuxmips64le | ||
ARG BC_MIPS64LE_EL | ||
COPY $BC_MIPS64LE_EL / | ||
|
||
FROM scratch AS linuxppc64 | ||
ARG BC_PPC64_EB | ||
COPY $BC_PPC64_EL / | ||
|
||
FROM scratch AS linuxppc64le | ||
ARG BC_PPC64LE_EL | ||
COPY $BC_PPC64LE_EL / | ||
|
||
FROM scratch AS linuxriscv64 | ||
ARG BC_RISCV64_EL | ||
COPY $BC_RISCV64_EL / | ||
|
||
FROM scratch AS linuxs390x | ||
ARG BC_S390X_EB | ||
COPY $BC_S390X_EB / | ||
|
||
ARG TARGETARCH | ||
ARG TARGETOS | ||
|
||
# Use the build argument to select the correct base image | ||
FROM ${TARGETOS}${TARGETARCH} | ||
ARG PROGRAMS | ||
ARG MAPS | ||
LABEL "io.ebpf.programs"=$PROGRAMS | ||
LABEL "io.ebpf.maps"=$MAPS |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
# Set default value for IMAGE_NOO_BC tag if not already set | ||
IMAGE_NOO_BC=${IMAGE_NOO_BC:-quay.io/${USER}/ebpf-bytecode} | ||
OCI_BIN=${OCI_BIN:-docker} | ||
|
||
# PROGRAMS is a list of <program name>:<program type> tuples | ||
PROGRAMS='{ | ||
"tcx_ingress_flow_parse":"tcx", | ||
"tcx_egress_flow_parse":"tcx", | ||
"tc_ingress_flow_parse":"tc", | ||
"tc_egress_flow_parse":"tc", | ||
"tcx_ingress_pca_parse":"tcx", | ||
"tcx_egress_pca_parse":"tcx", | ||
"tc_ingress_pca_parse":"tc", | ||
"tc_egress_pca_parse":"tc", | ||
"tcp_rcv_fentry":"fentry", | ||
"tcp_rcv_kprobe":"kprobe", | ||
"kfree_skb":"tracepoint", | ||
"rh_network_events_monitoring":"kprobe", | ||
"nf_nat_manip_pkt":"kprobe" | ||
}' | ||
|
||
# MAPS is a list of <map name>:<map type> tuples | ||
MAPS='{ | ||
"direct_flows":"ringbuf", | ||
"aggregated_flows":"hash", | ||
"additional_flow_metrics":"per_cpu_hash" | ||
"packets_record":"perf_event_array", | ||
"dns_flows":"hash", | ||
"global_counters":"per_cpu_array", | ||
"filter_map":"lpm_trie" | ||
}' | ||
|
||
if [[ ${OCI_BIN} == "docker" ]]; then | ||
docker buildx create --name bytecode-builder --use | ||
docker buildx inspect --bootstrap | ||
|
||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le \ | ||
--build-arg PROGRAMS="$PROGRAMS" \ | ||
--build-arg MAPS="$MAPS" \ | ||
--build-arg BC_AMD64_EL=bpf_x86_bpfel.o \ | ||
--build-arg BC_ARM64_EL=bpf_arm64_bpfel.o \ | ||
--build-arg BC_S390X_EB=bpf_s390_bpfeb.o \ | ||
--build-arg BC_PPC64LE_EL=bpf_powerpc_bpfel.o \ | ||
${OCI_BUILD_OPTS} \ | ||
-f ./Containerfile.bytecode.multi.arch \ | ||
--push \ | ||
./pkg/ebpf -t $IMAGE_NOO_BC | ||
|
||
docker buildx rm bytecode-builder | ||
else | ||
${OCI_BIN} buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le \ | ||
--build-arg PROGRAMS="$PROGRAMS" \ | ||
--build-arg MAPS="$MAPS" \ | ||
--build-arg BC_AMD64_EL=bpf_x86_bpfel.o \ | ||
--build-arg BC_ARM64_EL=bpf_arm64_bpfel.o \ | ||
--build-arg BC_S390X_EB=bpf_s390_bpfeb.o \ | ||
--build-arg BC_PPC64LE_EL=bpf_powerpc_bpfel.o \ | ||
${OCI_BUILD_OPTS} \ | ||
-f ./Containerfile.bytecode.multi.arch \ | ||
./pkg/ebpf -t $IMAGE_NOO_BC | ||
|
||
${OCI_BIN} push $IMAGE_NOO_BC | ||
fi |
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.