Skip to content

Commit

Permalink
fix: Massage the build so the scenarios can run
Browse files Browse the repository at this point in the history
Fixes #121
  • Loading branch information
larseggert authored and KolbyML committed Jan 9, 2024
1 parent 11b87f4 commit 7b3c3ae
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions sim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG TARGETARCH
RUN echo "TARGETARCH : $TARGETARCH"

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

ENV NS_VERS 3.40
RUN wget -O ns3.tar.bz2 https://www.nsnam.org/release/ns-allinone-$NS_VERS.tar.bz2
Expand All @@ -19,7 +19,6 @@ WORKDIR /ns3

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

# make including of the QuicNetworkSimulatorHelper class possible
COPY CMakeLists.patch .
Expand All @@ -29,9 +28,12 @@ RUN rm -r scratch/subdir scratch/scratch-simulator.cc
COPY scenarios scratch/

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

# strip ns3 version prefix from scratches
RUN find out/scratch -name "ns${NS_VERS}-*" | \
sed -e 'p' -E -e "s|ns${NS_VERS}-*||g" | \
xargs -n2 mv

ENV PATH="/go/bin:${PATH}"
COPY wait-for-it-quic /wait-for-it-quic
Expand All @@ -44,15 +46,11 @@ RUN apt-get update && \
apt-get clean

WORKDIR /ns3
COPY --from=builder /ns3/out/src/fd-net-device/* /ns3/src/fd-net-device/
COPY --from=builder /ns3/out/src/fd-net-device/* /ns3/out/src/fd-net-device/
COPY --from=builder /ns3/out/scratch/*/* /ns3/scratch/
COPY --from=builder /ns3/out/lib/ /ns3/lib
COPY --from=builder /ns3/out/lib/ /ns3/out/lib
COPY --from=builder /wait-for-it-quic/wait-for-it-quic /usr/bin

# see https://gitlab.com/nsnam/ns-3-dev/issues/97
ENV PATH="/ns3/src/fd-net-device/:${PATH}"
ENV LD_LIBRARY_PATH="/ns3/lib"

COPY run.sh .
RUN chmod +x run.sh
RUN mkdir /logs
Expand Down

0 comments on commit 7b3c3ae

Please sign in to comment.