Skip to content

Commit

Permalink
sim: bump ubuntu, ns-3 and Go versions (#128)
Browse files Browse the repository at this point in the history
* chore: Bump various dependency versions

* docker images to ubuntu:24.04
* ns-3 to 3.4.1
* go to 1.22.3

* No need for curl

* Use go from apt. Remove unneeded steps.

* ns-3.42

* SHA

* Fixes

* DOn't touch endpoint
  • Loading branch information
larseggert authored Jul 24, 2024
1 parent 25736a0 commit cba6bba
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
33 changes: 24 additions & 9 deletions sim/CMakeLists.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
--- /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}")
diff --git a/scratch/CMakeLists.txt b/scratch/CMakeLists.txt
index adeeb2cf8..6e23f81b6 100644
--- a/scratch/CMakeLists.txt
+++ b/scratch/CMakeLists.txt
@@ -58,6 +58,11 @@ function(create_scratch source_files)
set(target_prefix scratch${scratch_dirname}_)
endif()

+ # Link our scratches against the helper files
+ get_filename_component(scratch_dirname ${scratch_src} DIRECTORY)
+ file(GLOB helper_files CONFIGURE_DEPENDS ${scratch_dirname}/../helper/*)
+ list(APPEND source_files ${helper_files})
+
# Get source absolute path and transform into relative path
get_filename_component(scratch_src ${scratch_src} ABSOLUTE)
get_filename_component(scratch_absolute_directory ${scratch_src} DIRECTORY)
@@ -88,7 +93,8 @@ file(
)
# Filter out files
foreach(entry ${scratch_subdirectories})
- if(NOT (IS_DIRECTORY ${entry}))
+ # Don't treat our helper directory as a scratch
+ if(NOT (IS_DIRECTORY ${entry}) OR ${entry} MATCHES ".*/helper")
list(REMOVE_ITEM scratch_subdirectories ${entry})
endif()
endforeach()
22 changes: 9 additions & 13 deletions sim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM ubuntu:22.04 AS builder
FROM ubuntu:24.04 AS builder

ARG TARGETARCH
RUN echo "TARGETARCH : $TARGETARCH"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 build-essential cmake wget ninja-build
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3 build-essential cmake ninja-build libboost-dev libgsl-dev libxml2-dev \
libsqlite3-dev golang-go

ENV NS_VERS 3.40
RUN wget -O ns3.tar.bz2 https://www.nsnam.org/release/ns-allinone-$NS_VERS.tar.bz2
ENV NS_VERS 3.42
ADD --checksum=sha256:90600b3fb73b00f477c8b82c04639b1fd79b8a1cfd3c46236e3c9a3c8d3bcb62 \
https://www.nsnam.org/release/ns-allinone-$NS_VERS.tar.bz2 ns3.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/
Expand All @@ -23,8 +22,6 @@ RUN ./ns3 configure --build-profile=release --out=out/
# make including of the QuicNetworkSimulatorHelper class possible
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
Expand All @@ -35,14 +32,13 @@ 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
RUN cd /wait-for-it-quic && go build .

FROM ubuntu:22.04
FROM ubuntu:24.04

RUN apt-get update && \
apt-get install -y net-tools iptables && \
apt-get install -y net-tools iptables libgsl-dev libxml2 libsqlite3-0 && \
apt-get clean

WORKDIR /ns3
Expand Down

0 comments on commit cba6bba

Please sign in to comment.