From fee3beac4fe63a8353c2d4d2a68f0f690a2e1d68 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 29 Apr 2024 13:51:33 -0700 Subject: [PATCH 01/14] Removed Docker requirement for building SIF file --- .gitignore | 3 -- Dockerfile | 97 ----------------------------------------------- Makefile | 36 ++++-------------- mobileinsight.def | 90 ++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 95 insertions(+), 131 deletions(-) delete mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index 730dfce..b071de0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -*.tar.gz *.sif -.docker_build overlay/ -shared/ diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b79eefd..0000000 --- a/Dockerfile +++ /dev/null @@ -1,97 +0,0 @@ -FROM ubuntu:22.04 - -ARG MAX_THREADS=1 -ARG WS_VER=3.4.0 -ARG MI_BRANCH=ubuntu22-py310 -ARG WIRESHARK_URL=http://www.mobileinsight.net/wireshark-${WS_VER}-rbc-dissector.tar.xz -ADD 00-cpp_compat.patch /build/00-cpp_compat.patch - -# Run apt update -RUN set -ex; \ - export DEBIAN_FRONTEND=noninteractive; \ - apt-get update; \ - apt-get upgrade -y; \ - apt-get install -y \ - git \ - python3 \ - python3-pip \ - python3-wxgtk4.0 \ - python3-matplotlib \ - cmake \ - pkg-config \ - wget \ - libglib2.0-dev \ - bison \ - flex \ - libpcap-dev \ - libgcrypt-dev \ - qtbase5-dev \ - qtchooser \ - qt5-qmake \ - qtbase5-dev-tools \ - qttools5-dev \ - qtmultimedia5-dev \ - libqt5svg5-dev \ - libc-ares-dev \ - libsdl2-mixer-2.0-0 \ - libsdl2-image-2.0-0 \ - libsdl2-2.0-0; - -# Download resources -RUN set -ex; \ - mkdir -p /build; \ - cd /build; \ - wget "$WIRESHARK_URL" -nv -O "wireshark-$WS_VER.tar.xz"; \ - tar -xf "wireshark-$WS_VER.tar.xz"; \ - git clone "https://github.com/mobile-insight/mobileinsight-core.git"; \ - git -C mobileinsight-core checkout "$MI_BRANCH"; - -# Compile and install wireshark -RUN set -ex; \ - cd "/build/wireshark-$WS_VER"; \ - patch epan/epan.h < /build/00-cpp_compat.patch; \ - cmake -DBUILD_wireshark=OFF .; \ - make -j "$MAX_THREADS"; \ - make install; \ - ldconfig; - -# Compile and install Wireshark dissector -Run set -ex; \ - cd /build/mobileinsight-core/ws_dissector; \ - g++ ws_dissector.cpp packet-aww.cpp -o ws_dissector \ - $(pkg-config --libs --cflags glib-2.0) \ - -I"/build/wireshark-$WS_VER" \ - -L"/usr/local/lib" \ - -lwireshark \ - -lwsutil \ - -lwiretap; \ - strip ws_dissector; \ - install -Dm 755 ws_dissector /usr/local/bin/ws_dissector; - -# Compile and install MobileInsight -Run set -ex; \ - cd /build/mobileinsight-core; \ - pip3 install pyserial; \ - python3 setup.py install; - -# Install MobileInsight GUI -Run set -ex; \ - cd /build/mobileinsight-core; \ - mkdir -p /usr/local/share/mobileinsight; \ - cp -r gui/* /usr/local/share/mobileinsight;\ - ln -s /usr/local/share/mobileinsight/mi-gui /usr/local/bin/mi-gui; - -# Install examples -Run set -ex; \ - cd /build/mobileinsight-core; \ - cp -r examples /opt/mobileinsight-examples; - -# Link python3 to python -Run set -ex; \ - cd /usr/bin; \ - ln -s python3 python; - -# Cleanup -Run set -ex; \ - apt-get autoclean -y; \ - rm -rf /build; diff --git a/Makefile b/Makefile index 05ed3ba..d13cf14 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,22 @@ -DOCKER ?= docker APPTAINER ?= apptainer OVERLAY_DIR ?= ./overlay -SHARED_DIR ?= ./shared -MAX_THREADS ?= $(shell grep -c processor /proc/cpuinfo) +NUM_THREADS ?= $(shell grep -c processor /proc/cpuinfo) UID := $(shell id -u) GID := $(shell id -g) -.DEFAULT_GOAL := .docker_build +.DEFAULT_GOAL := mobileinsight.sif -.docker_build: Dockerfile - "$(DOCKER)" build --build-arg "MAX_THREADS=$(MAX_THREADS)" -t mobileinsight . - touch "$@" +mobileinsight.sif: mobileinsight.def + "$(APPTAINER)" build --build-arg="NUM_THREADS=$(NUM_THREADS)" "$@" "$<" -mobileinsight.tar.gz: .docker_build - "$(DOCKER)" save mobileinsight:latest | gzip > "$@" - -mobileinsight.sif: mobileinsight.def .docker_build - "$(APPTAINER)" build "$@" "$<" - -run: .docker_build - @mkdir -p "$(SHARED_DIR)" - @test -n "$(shell docker image ls -q mobileinsight)" \ - || (echo Cannot find image mobileinsight:latest, has it been built yet? 1>&2 \ - && false) - @"$(DOCKER)" run --rm -it --privileged -v "$(SHARED_DIR):/mnt" \ - -e TERM -u root --entrypoint bash mobileinsight:latest - -app-run: mobileinsight.sif +run: mobileinsight.sif @mkdir -p "$(OVERLAY_DIR)" @lsmod | grep overlay > /dev/null || sudo modprobe overlay @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ -B "/run/user/$(UID)" mobileinsight.sif clean: - "$(DOCKER)" container prune - "$(DOCKER)" image prune -a - rm -f .docker_build mobileinsight.tar.gz mobileinsight.sif + rm -f mobileinsight.sif $(OVERLAY_DIR) -clean-data: - rm -rf $(OVERLAY_DIR) $(SHARED_DIR) - -.PHONY: sc-run run clean clean-data +.PHONY: run clean diff --git a/mobileinsight.def b/mobileinsight.def index 7918624..4b0d801 100644 --- a/mobileinsight.def +++ b/mobileinsight.def @@ -1,5 +1,90 @@ -BootStrap: docker-daemon -From: mobileinsight:latest +BootStrap: docker +From: ubuntu:22.04 + +%arguments + NUM_THREADS=1 + WS_VER=3.4.0 + MI_COMMIT=4b204e0 + +%files + 00-cpp_compat.patch /build/00-cpp_compat.patch + +%post + # Update and install dependencies + mkdir -p /build + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get upgrade -y + apt-get install -y \ + git \ + python3 \ + python3-pip \ + python3-wxgtk4.0 \ + python3-matplotlib \ + cmake \ + pkg-config \ + wget \ + libglib2.0-dev \ + bison \ + flex \ + libpcap-dev \ + libgcrypt-dev \ + qtbase5-dev \ + qtchooser \ + qt5-qmake \ + qtbase5-dev-tools \ + qttools5-dev \ + qtmultimedia5-dev \ + libqt5svg5-dev \ + libc-ares-dev \ + libsdl2-mixer-2.0-0 \ + libsdl2-image-2.0-0 \ + libsdl2-2.0-0 + pip3 install pyserial + + # Download resources + cd /build + wget "http://www.mobileinsight.net/wireshark-{{ WS_VER }}-rbc-dissector.tar.xz" -nv \ + -O "wireshark-{{ WS_VER }}.tar.xz" + tar -xf "wireshark-{{ WS_VER }}.tar.xz" + git clone "https://github.com/mobile-insight/mobileinsight-core.git" + git -C mobileinsight-core checkout "{{ MI_COMMIT }}" + + # Compile and install wireshark + cd "/build/wireshark-{{ WS_VER }}" + patch epan/epan.h < /build/00-cpp_compat.patch + cmake -DBUILD_wireshark=OFF . + make -j "{{ NUM_THREADS }}" + make install + ldconfig + + # Compile and install Wireshark dissector + cd /build/mobileinsight-core/ws_dissector + g++ ws_dissector.cpp packet-aww.cpp -o ws_dissector \ + $(pkg-config --libs --cflags glib-2.0) \ + -I"/build/wireshark-{{ WS_VER }}" \ + -L"/usr/local/lib" \ + -lwireshark \ + -lwsutil \ + -lwiretap + strip ws_dissector + install -Dm 755 ws_dissector /usr/local/bin/ws_dissector + + # Compile and install MobileInsight + cd /build/mobileinsight-core + python3 setup.py install + mkdir -p /usr/local/share/mobileinsight + cp -r gui/* /usr/local/share/mobileinsight + ln -s /usr/local/share/mobileinsight/mi-gui /usr/local/bin/mi-gui + cp -r examples /opt/mobileinsight-examples + + # Link python3 to python + cd /usr/bin + ln -s python3 python + + # Cleanup + apt-get autoclean -y + rm -rf /build %runscript set -e @@ -9,3 +94,4 @@ From: mobileinsight:latest else "$@" fi + From d10e3c1b730eb7cc0ea0d14f1b76db000c8ca77d Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 29 Apr 2024 14:00:58 -0700 Subject: [PATCH 02/14] Updated readme, added compatability for Singularity build process --- Makefile | 3 +-- README.md | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index d13cf14..c833f9f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ -APPTAINER ?= apptainer +APPTAINER ?= singularity OVERLAY_DIR ?= ./overlay NUM_THREADS ?= $(shell grep -c processor /proc/cpuinfo) UID := $(shell id -u) -GID := $(shell id -g) .DEFAULT_GOAL := mobileinsight.sif diff --git a/README.md b/README.md index 7de1e77..927d7b7 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ MobileInsight Apptainer ======================= -Single launch binary for MobileInsight in a Ubuntu 22.04 portable container. +Single launch binary for [MobileInsight](https://github.com/mobile-insight) in +a Ubuntu 22.04 SIF portable container. Dependencies ------------ -The host side only needs `apptainer` or `singularity` to function. A gui is -needed to launch the log viewer. +Either one of the following dependencies is needed to run or build SIF images: + +- [Apptainer](https://apptainer.org/) +- [Singularity](https://sylabs.io/singularity/) + +To use the `make run` command, the overlay Linux kernel module must also be +available on the system. This allows you to make changes to the SIF file using +an overlay filesystem. Usage ----- @@ -25,13 +32,7 @@ $ ./mobileinsight.sif bash Examples are stored in /opt/mobileinsight-examples. -Building --------- - -To build the apptainer, the following dependencies are needed on the host -machine: - -1. Apptainer or Singularity -2. Docker +Build +----- Run `make mobileinsight.sif` to build the apptainer image. From 424d294997d99ec01fa1b929d695216b1194e423 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 29 Apr 2024 14:04:54 -0700 Subject: [PATCH 03/14] Fix url to MobileInsight to point to correct GitHub repo --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 927d7b7..992b247 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ MobileInsight Apptainer ======================= -Single launch binary for [MobileInsight](https://github.com/mobile-insight) in -a Ubuntu 22.04 SIF portable container. +Single launch binary for +[MobileInsight](https://github.com/mobile-insight/mobileinsight-core) in an +Ubuntu 22.04 SIF portable container. Dependencies ------------ From 27b7683be908ab4d452ba66cf50d9d9bbfce576c Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 29 Apr 2024 17:52:17 -0700 Subject: [PATCH 04/14] Added pyspark version --- Makefile | 17 +++++++++++++---- README.md | 9 ++++++++- with-spark.def | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 with-spark.def diff --git a/Makefile b/Makefile index c833f9f..b941ad1 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,22 @@ UID := $(shell id -u) mobileinsight.sif: mobileinsight.def "$(APPTAINER)" build --build-arg="NUM_THREADS=$(NUM_THREADS)" "$@" "$<" -run: mobileinsight.sif +mobileinsight-spark.sif: with-spark.def mobileinsight.sif + "$(APPTAINER)" build "$@" "$<" + +prepare: @mkdir -p "$(OVERLAY_DIR)" @lsmod | grep overlay > /dev/null || sudo modprobe overlay + +run: mobileinsight.sif prepare @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ -B "/run/user/$(UID)" mobileinsight.sif -clean: - rm -f mobileinsight.sif $(OVERLAY_DIR) +run-spark: mobileinsight-spark.sif prepare + @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ + -B "/run/user/$(UID)" mobileinsight-spark.sif -.PHONY: run clean +clean: + rm -rf *.sif $(OVERLAY_DIR) + +.PHONY: prepare run run-spark clean diff --git a/README.md b/README.md index 992b247..8baca2a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,11 @@ $ ./mobileinsight.sif python3 "$PYTHON_ARGS" # Start a bash shell inside the container $ ./mobileinsight.sif bash + +# Only available in spark version +# +# Start a pyspark interpreter +$ ./mobileinsight-spark.sif pyspark ``` Examples are stored in /opt/mobileinsight-examples. @@ -36,4 +41,6 @@ Examples are stored in /opt/mobileinsight-examples. Build ----- -Run `make mobileinsight.sif` to build the apptainer image. +Run `make mobileinsight.sif` or `make mobileinsight-spark.sif` to build the +apptainer image. The spark version includes both `mobileinsight` along with +`pyspark`. diff --git a/with-spark.def b/with-spark.def new file mode 100644 index 0000000..101bed4 --- /dev/null +++ b/with-spark.def @@ -0,0 +1,32 @@ +Bootstrap: localimage +From: mobileinsight.sif + +%arguments + SPARK_URL="https://dlcdn.apache.org/spark/spark-3.5.1/spark-3.5.1-bin-hadoop3.tgz" + +%environment + export SPARK_HOME="/opt/spark" + export PATH="/opt/spark/sbin:/opt/spark/bin:$PATH" + export PYSPARK_PYTHON="/usr/bin/python3" + export SPARK_LOCAL_IP="127.0.0.1" + +%post + # Update and install dependencies + mkdir -p /build + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get upgrade -y + apt-get install -y \ + openjdk-8-jre-headless \ + scala + + # Download Spark + SPARK_TGZ="/build/$(basename "{{ SPARK_URL }}")" + cd /build + wget "{{ SPARK_URL }}" -nv -O "$SPARK_TGZ" + tar -xf "$SPARK_TGZ" + mv "$(echo $SPARK_TGZ | sed 's/\.tgz$//')" /opt/spark + + # Cleanup + apt-get autoclean -y + rm -rf /build From 8b4c305300c16fa057646f18dca886a65c9de055 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Tue, 30 Apr 2024 11:32:28 -0700 Subject: [PATCH 05/14] Added venv support --- mobileinsight.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mobileinsight.def b/mobileinsight.def index 4b0d801..84b3263 100644 --- a/mobileinsight.def +++ b/mobileinsight.def @@ -19,6 +19,7 @@ From: ubuntu:22.04 git \ python3 \ python3-pip \ + python3-venv \ python3-wxgtk4.0 \ python3-matplotlib \ cmake \ From cdd99b3280d8533eeea358a5e56d45811bf3fa68 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Tue, 30 Apr 2024 11:33:03 -0700 Subject: [PATCH 06/14] Updated README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8baca2a..a444d97 100644 --- a/README.md +++ b/README.md @@ -42,5 +42,5 @@ Build ----- Run `make mobileinsight.sif` or `make mobileinsight-spark.sif` to build the -apptainer image. The spark version includes both `mobileinsight` along with -`pyspark`. +corresponding apptainer image. The spark version includes both `mobileinsight` +along with `pyspark` for distributed log processing. From 8943eceb93f7063b0af0d72924779699522f36d6 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 2 May 2024 12:29:44 -0700 Subject: [PATCH 07/14] Removed spark implementation, use a docker-compose cluster for testing spark --- Makefile | 7 ------- with-spark.def | 32 -------------------------------- 2 files changed, 39 deletions(-) delete mode 100644 with-spark.def diff --git a/Makefile b/Makefile index b941ad1..7c658f3 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,6 @@ UID := $(shell id -u) mobileinsight.sif: mobileinsight.def "$(APPTAINER)" build --build-arg="NUM_THREADS=$(NUM_THREADS)" "$@" "$<" -mobileinsight-spark.sif: with-spark.def mobileinsight.sif - "$(APPTAINER)" build "$@" "$<" - prepare: @mkdir -p "$(OVERLAY_DIR)" @lsmod | grep overlay > /dev/null || sudo modprobe overlay @@ -20,10 +17,6 @@ run: mobileinsight.sif prepare @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ -B "/run/user/$(UID)" mobileinsight.sif -run-spark: mobileinsight-spark.sif prepare - @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ - -B "/run/user/$(UID)" mobileinsight-spark.sif - clean: rm -rf *.sif $(OVERLAY_DIR) diff --git a/with-spark.def b/with-spark.def deleted file mode 100644 index 101bed4..0000000 --- a/with-spark.def +++ /dev/null @@ -1,32 +0,0 @@ -Bootstrap: localimage -From: mobileinsight.sif - -%arguments - SPARK_URL="https://dlcdn.apache.org/spark/spark-3.5.1/spark-3.5.1-bin-hadoop3.tgz" - -%environment - export SPARK_HOME="/opt/spark" - export PATH="/opt/spark/sbin:/opt/spark/bin:$PATH" - export PYSPARK_PYTHON="/usr/bin/python3" - export SPARK_LOCAL_IP="127.0.0.1" - -%post - # Update and install dependencies - mkdir -p /build - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get upgrade -y - apt-get install -y \ - openjdk-8-jre-headless \ - scala - - # Download Spark - SPARK_TGZ="/build/$(basename "{{ SPARK_URL }}")" - cd /build - wget "{{ SPARK_URL }}" -nv -O "$SPARK_TGZ" - tar -xf "$SPARK_TGZ" - mv "$(echo $SPARK_TGZ | sed 's/\.tgz$//')" /opt/spark - - # Cleanup - apt-get autoclean -y - rm -rf /build From 73002367914e59207110443ae14b4841a6da05db Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 2 May 2024 19:04:38 -0700 Subject: [PATCH 08/14] Revert "Removed spark implementation, use a docker-compose cluster for testing" This reverts commit 8943eceb93f7063b0af0d72924779699522f36d6. --- Makefile | 7 +++++++ with-spark.def | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 with-spark.def diff --git a/Makefile b/Makefile index 7c658f3..b941ad1 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ UID := $(shell id -u) mobileinsight.sif: mobileinsight.def "$(APPTAINER)" build --build-arg="NUM_THREADS=$(NUM_THREADS)" "$@" "$<" +mobileinsight-spark.sif: with-spark.def mobileinsight.sif + "$(APPTAINER)" build "$@" "$<" + prepare: @mkdir -p "$(OVERLAY_DIR)" @lsmod | grep overlay > /dev/null || sudo modprobe overlay @@ -17,6 +20,10 @@ run: mobileinsight.sif prepare @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ -B "/run/user/$(UID)" mobileinsight.sif +run-spark: mobileinsight-spark.sif prepare + @$(APPTAINER) run --overlay "$(OVERLAY_DIR)" \ + -B "/run/user/$(UID)" mobileinsight-spark.sif + clean: rm -rf *.sif $(OVERLAY_DIR) diff --git a/with-spark.def b/with-spark.def new file mode 100644 index 0000000..101bed4 --- /dev/null +++ b/with-spark.def @@ -0,0 +1,32 @@ +Bootstrap: localimage +From: mobileinsight.sif + +%arguments + SPARK_URL="https://dlcdn.apache.org/spark/spark-3.5.1/spark-3.5.1-bin-hadoop3.tgz" + +%environment + export SPARK_HOME="/opt/spark" + export PATH="/opt/spark/sbin:/opt/spark/bin:$PATH" + export PYSPARK_PYTHON="/usr/bin/python3" + export SPARK_LOCAL_IP="127.0.0.1" + +%post + # Update and install dependencies + mkdir -p /build + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get upgrade -y + apt-get install -y \ + openjdk-8-jre-headless \ + scala + + # Download Spark + SPARK_TGZ="/build/$(basename "{{ SPARK_URL }}")" + cd /build + wget "{{ SPARK_URL }}" -nv -O "$SPARK_TGZ" + tar -xf "$SPARK_TGZ" + mv "$(echo $SPARK_TGZ | sed 's/\.tgz$//')" /opt/spark + + # Cleanup + apt-get autoclean -y + rm -rf /build From 37c4bad792f9ed8c09e8b5d93417ae6dc27f76c0 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 2 May 2024 19:27:04 -0700 Subject: [PATCH 09/14] Simplified spark version so pyspark can work --- with-spark.def | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/with-spark.def b/with-spark.def index 101bed4..21aea93 100644 --- a/with-spark.def +++ b/with-spark.def @@ -5,9 +5,6 @@ From: mobileinsight.sif SPARK_URL="https://dlcdn.apache.org/spark/spark-3.5.1/spark-3.5.1-bin-hadoop3.tgz" %environment - export SPARK_HOME="/opt/spark" - export PATH="/opt/spark/sbin:/opt/spark/bin:$PATH" - export PYSPARK_PYTHON="/usr/bin/python3" export SPARK_LOCAL_IP="127.0.0.1" %post @@ -19,14 +16,7 @@ From: mobileinsight.sif apt-get install -y \ openjdk-8-jre-headless \ scala - - # Download Spark - SPARK_TGZ="/build/$(basename "{{ SPARK_URL }}")" - cd /build - wget "{{ SPARK_URL }}" -nv -O "$SPARK_TGZ" - tar -xf "$SPARK_TGZ" - mv "$(echo $SPARK_TGZ | sed 's/\.tgz$//')" /opt/spark + pip3 install pyspark==3.5.1 # Cleanup apt-get autoclean -y - rm -rf /build From 8f1a608c66b2a0bddd484c6c794c74436b9f5818 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 2 May 2024 19:43:20 -0700 Subject: [PATCH 10/14] Remove unused /build dir --- with-spark.def | 7 ------- 1 file changed, 7 deletions(-) diff --git a/with-spark.def b/with-spark.def index 21aea93..69f0afc 100644 --- a/with-spark.def +++ b/with-spark.def @@ -1,15 +1,8 @@ Bootstrap: localimage From: mobileinsight.sif -%arguments - SPARK_URL="https://dlcdn.apache.org/spark/spark-3.5.1/spark-3.5.1-bin-hadoop3.tgz" - -%environment - export SPARK_LOCAL_IP="127.0.0.1" - %post # Update and install dependencies - mkdir -p /build export DEBIAN_FRONTEND=noninteractive apt-get update apt-get upgrade -y From c1b65d744e339f74566f6d8b882cf43db87ca9b1 Mon Sep 17 00:00:00 2001 From: Yiyao Yu Date: Fri, 17 May 2024 22:27:18 -0700 Subject: [PATCH 11/14] Use upstream wireshark to overcome MobileInsight website availability --- mobileinsight.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobileinsight.def b/mobileinsight.def index 84b3263..a1eaa28 100644 --- a/mobileinsight.def +++ b/mobileinsight.def @@ -45,8 +45,8 @@ From: ubuntu:22.04 # Download resources cd /build - wget "http://www.mobileinsight.net/wireshark-{{ WS_VER }}-rbc-dissector.tar.xz" -nv \ - -O "wireshark-{{ WS_VER }}.tar.xz" + wget "https://github.com/wireshark/wireshark/archive/refs/tags/v{{ WS_VER }}.tar.gz" \ + -nv -O "wireshark-{{ WS_VER }}.tar.xz" tar -xf "wireshark-{{ WS_VER }}.tar.xz" git clone "https://github.com/mobile-insight/mobileinsight-core.git" git -C mobileinsight-core checkout "{{ MI_COMMIT }}" From 86a52a6f52a198285a28b33925ae75caf1abaa14 Mon Sep 17 00:00:00 2001 From: Yiyao Yu Date: Fri, 17 May 2024 22:27:52 -0700 Subject: [PATCH 12/14] Add pandas to Spark dependency --- with-spark.def | 1 + 1 file changed, 1 insertion(+) diff --git a/with-spark.def b/with-spark.def index 69f0afc..512fbcd 100644 --- a/with-spark.def +++ b/with-spark.def @@ -7,6 +7,7 @@ From: mobileinsight.sif apt-get update apt-get upgrade -y apt-get install -y \ + python3-pandas \ openjdk-8-jre-headless \ scala pip3 install pyspark==3.5.1 From 24096b896dc52561d109845d352437409129de2d Mon Sep 17 00:00:00 2001 From: Yiyao Yu Date: Sat, 18 May 2024 18:38:25 -0700 Subject: [PATCH 13/14] Added python dill to spark variant --- with-spark.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/with-spark.def b/with-spark.def index 512fbcd..16cdf96 100644 --- a/with-spark.def +++ b/with-spark.def @@ -10,7 +10,7 @@ From: mobileinsight.sif python3-pandas \ openjdk-8-jre-headless \ scala - pip3 install pyspark==3.5.1 + pip3 install pyspark[sql]==3.5.1 dill==0.3.8 # Cleanup apt-get autoclean -y From 4e3942eb31db5a02f967de0b72408dc07bbb8075 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Tue, 21 May 2024 15:14:56 -0700 Subject: [PATCH 14/14] Apply patch to fix aww.proto registration in WS dissector --- 00-cpp_compat.patch | 4 ++-- 01-radio_bearer_config.patch | 25 +++++++++++++++++++++++++ mobileinsight.def | 5 ++++- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 01-radio_bearer_config.patch diff --git a/00-cpp_compat.patch b/00-cpp_compat.patch index 52818c4..1060f11 100644 --- a/00-cpp_compat.patch +++ b/00-cpp_compat.patch @@ -1,5 +1,5 @@ ---- epan.h.old 2024-04-20 00:34:15.534364916 -0700 -+++ epan.h 2024-04-20 00:34:25.094467480 -0700 +--- a/epan/epan.h 2024-04-20 00:34:15.534364916 -0700 ++++ b/epan/epan.h 2024-04-20 00:34:25.094467480 -0700 @@ -10,9 +10,6 @@ #ifndef __EPAN_H__ #define __EPAN_H__ diff --git a/01-radio_bearer_config.patch b/01-radio_bearer_config.patch new file mode 100644 index 0000000..b3444a4 --- /dev/null +++ b/01-radio_bearer_config.patch @@ -0,0 +1,25 @@ +diff --git a/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf b/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf +index fd478d8969..b3b89250e0 100644 +--- a/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf ++++ b/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf +@@ -145,7 +145,7 @@ PH-TypeListMCG + PH-TypeListSCG + RA-ReportList-r16 + RACH-ConfigCommon +-RadioBearerConfig ++RadioBearerConfig @radio_bearer_conf + ReferenceTime-r16 + RRCReconfiguration @rrc_reconf + RRCReconfigurationComplete +diff --git a/epan/dissectors/packet-nr-rrc.c b/epan/dissectors/packet-nr-rrc.c +index 75977474c0..cfa8602711 100644 +--- a/epan/dissectors/packet-nr-rrc.c ++++ b/epan/dissectors/packet-nr-rrc.c +@@ -112214,6 +112214,7 @@ proto_register_nr_rrc(void) { + register_dissector("nr-rrc.ue_nr_cap", dissect_nr_rrc_UE_NR_Capability_PDU, proto_nr_rrc); + register_dissector("nr-rrc.sbcch.sl.bch", dissect_SBCCH_SL_BCH_Message_PDU, proto_nr_rrc); + register_dissector("nr-rrc.scch", dissect_SCCH_Message_PDU, proto_nr_rrc); ++ register_dissector("nr-rrc.radio_bearer_conf", dissect_nr_rrc_RadioBearerConfig_PDU, proto_nr_rrc); + + + /*--- End of included file: packet-nr-rrc-dis-reg.c ---*/ diff --git a/mobileinsight.def b/mobileinsight.def index a1eaa28..810c4ab 100644 --- a/mobileinsight.def +++ b/mobileinsight.def @@ -8,6 +8,7 @@ From: ubuntu:22.04 %files 00-cpp_compat.patch /build/00-cpp_compat.patch + 01-radio_bearer_config.patch /build/01-radio_bearer_config.patch %post # Update and install dependencies @@ -53,7 +54,9 @@ From: ubuntu:22.04 # Compile and install wireshark cd "/build/wireshark-{{ WS_VER }}" - patch epan/epan.h < /build/00-cpp_compat.patch + for patch in /build/*.patch; do + patch -p1 < "$patch" + done cmake -DBUILD_wireshark=OFF . make -j "{{ NUM_THREADS }}" make install