Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Massage the build so the scenarios can run #123

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading