Skip to content

Commit

Permalink
manage: add Dockerfile and run guide
Browse files Browse the repository at this point in the history
Signed-off-by: Ric Li <[email protected]>
  • Loading branch information
ricmli committed Nov 28, 2023
1 parent b7f8e61 commit eade3c4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
21 changes: 21 additions & 0 deletions manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ubuntu:22.04

LABEL maintainer="[email protected]"

ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig

WORKDIR /root

RUN apt-get update -y && \
apt-get install -y git gcc pkg-config make m4 clang llvm zlib1g-dev libelf-dev libpcap-dev libcap-ng-dev meson ethtool && \
git clone --recurse-submodules https://github.com/xdp-project/xdp-tools.git && \
# Build and install libbpf, libxdp and xdp-tools
cd xdp-tools && ./configure && make && make install && cd lib/libbpf/src && make install && \
cd /root && git clone https://github.com/OpenVisualCloud/Media-Transport-Library.git && \
cd Media-Transport-Library/manager && meson setup build && meson compile -C build && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /root/Media-Transport-Library/manager/build

ENTRYPOINT ["./MtlManager"]
36 changes: 35 additions & 1 deletion manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,44 @@ This command will start the MTL Manager with root privileges, which are necessar

## Run with our XDP program

We have an edited version of the original AF_XDP eBPF program which allows user to add or remove udp dest port in the eBPF program to act as a packet filter, please see [ebpf tool](../tools/ebpf) for how to build it.
We have an modified version of the original AF_XDP eBPF program which allows user to add or remove udp dest port in the eBPF program to act as a packet filter, please see [ebpf tool](../tools/ebpf) for how to build it.

To run the MTL Manager with our XDP program, execute:

```bash
sudo MTL_XDP_PROG_PATH=/path/to/Media-Transport-Library/tools/ebpf/xsk.xdp.o ./build/MtlManager
```

## Run in a Docker container

Build the Docker image:

```bash
docker build -t mtl-manager:latest .
# docker build -t mtl-manager:latest --build-arg HTTP_PROXY=$http_proxy --build-arg HTTPS_PROXY=$https_proxy .
```

Run the Docker container as a daemon:

```bash
docker run -d \
--name mtl-manager \
--privileged --net=host \
-v /var/run/imtl:/var/run/imtl \
-v /sys/fs/bpf:/sys/fs/bpf \
-v "$(pwd)"/../tools/ebpf/xsk.xdp.o:/tmp/imtl/xdp_prog.o \
mtl-manager:latest
```

Print the MTL Manager logs:

```bash
docker logs -f mtl-manager
```

Shutdown the Docker container with SIGINT:

```bash
docker kill -s SIGINT mtl-manager
# docker rm mtl-manager
```

0 comments on commit eade3c4

Please sign in to comment.