Skip to content

Commit

Permalink
update to ns3 v3.40, Ubuntu 22.04 and Go 1.21.5 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert authored Jan 8, 2024
1 parent 837c176 commit 86cb3fa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 45 deletions.
11 changes: 11 additions & 0 deletions sim/CMakeLists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- /Users/lars/Downloads/CMakeLists.txt 2023-12-21 15:49:55
+++ CMakeLists.txt 2023-12-21 16:00:19
@@ -105,7 +105,7 @@
else()
# Otherwise we pick all the files in the subdirectory
# and create a scratch for them automatically
- file(GLOB scratch_sources CONFIGURE_DEPENDS ${subdir}/[^.]*.cc)
+ file(GLOB scratch_sources CONFIGURE_DEPENDS ${subdir}/[^.]*.cc helper/[^.]*.cc)
create_scratch("${scratch_sources}")
endif()
endforeach()
44 changes: 18 additions & 26 deletions sim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
FROM ubuntu:20.04 AS builder
FROM ubuntu:22.04 AS builder

ARG TARGETPLATFORM
RUN echo "TARGETPLATFORM : $TARGETPLATFORM"
ARG TARGETARCH
RUN echo "TARGETARCH : $TARGETARCH"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 build-essential cmake wget

ENV VERS 3.32
RUN wget https://www.nsnam.org/release/ns-allinone-$VERS.tar.bz2
RUN tar xjf ns-allinone-$VERS.tar.bz2 && rm ns-allinone-$VERS.tar.bz2
RUN mv /ns-allinone-$VERS/ns-$VERS /ns3
ENV NS_VERS 3.40
RUN wget -O ns3.tar.bz2 https://www.nsnam.org/release/ns-allinone-$NS_VERS.tar.bz2
RUN tar xjf ns3.tar.bz2 && rm ns3.tar.bz2
RUN mv /ns-allinone-$NS_VERS/ns-$NS_VERS /ns3

ENV GO_VERS 1.21.5
RUN wget -O go.tar.gz https://dl.google.com/go/go$GO_VERS.linux-$TARGETARCH.tar.gz
RUN tar xfz go.tar.gz && rm go.tar.gz

WORKDIR /ns3

RUN mkdir out/
RUN ./waf configure --build-profile=release --out=out/
RUN ./waf build

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then cd / && \
wget https://dl.google.com/go/go1.15.linux-amd64.tar.gz && \
tar xfz go1.15.linux-amd64.tar.gz && \
rm go1.15.linux-amd64.tar.gz; \
fi

RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then cd / && \
wget https://dl.google.com/go/go1.15.linux-arm64.tar.gz && \
tar xfz go1.15.linux-arm64.tar.gz && \
rm go1.15.linux-arm64.tar.gz; \
fi
RUN ./ns3 configure --build-profile=release --out=out/
RUN ./ns3 build

# make including of the QuicNetworkSimulatorHelper class possible
COPY wscript.patch .
RUN patch < wscript.patch
COPY CMakeLists.patch .
RUN patch -d scratch < CMakeLists.patch

RUN rm -r scratch/subdir scratch/scratch-simulator.cc
COPY scenarios scratch/

# compile all the scenarios
RUN ./waf build && \
RUN ./ns3 build && \
cd out/lib && du -sh . && strip -v * && du -sh . && cd ../.. && \
cd out/scratch && rm -r subdir helper scratch-simulator*
cd out/scratch && rm -r subdir ns$NS_VERS-scratch-simulator*

ENV PATH="/go/bin:${PATH}"
COPY wait-for-it-quic /wait-for-it-quic
RUN cd /wait-for-it-quic && go build .

FROM ubuntu:20.04
FROM ubuntu:22.04

RUN apt-get update && \
apt-get install -y net-tools iptables && \
Expand Down
19 changes: 0 additions & 19 deletions sim/wscript.patch

This file was deleted.

0 comments on commit 86cb3fa

Please sign in to comment.