Coder Social home page Coder Social logo

marshallasch / ns3-container Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 17 KB

Docker base container for the ns-3 network simulator

Home Page: https://hub.docker.com/r/marshallasch/ns3

License: ISC License

Dockerfile 90.88% Shell 9.12%
ns3 reproducibility simulations docker-image base-image

ns3-container's Introduction

Create Docker ContainerGitHub Lines of code NS3 version NS3 version NS3 version NS3 version Docker Pulls

NS-3 Container

This will create a docker container for the ns-3 network simulator. This repository is designed to be used as a base container for simulation models, experiments and CI pipelines for ns3.

This action can be used to check your code for multiple versions of ns-3, currently this will support ns-3.32, ns-3.33, ns-3.34, and ns-3.35. If you wish to see a different version of ns-3 supported by this action open an issue and Id be happy to add support for it.

Motivation

The ns-3 network simulation platform is an interesting codebase that is different from most other library projects, where instead of including the simulator as a project dependency the simulation code needs to be written inside of the simulator code.

We developed Docker containers for our simulation studies so that a permanent stable artifact can be provided. This base container has been developed to help provide some standardization across each of the simulations.

Building

The only dependency needed to build this is docker, and more than 2 GB of ram, I think 4GB might be needed or it will crash part way through.

$ docker build \
      --build-arg VCS_REF=$(git rev-parse -q --verify HEAD) \
      --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
      --build-arg BUILD_PROFILE=debug \
      -t marshallasch/ns3 .

That is all that is needed to build the docker container, you do not need to have the ns-3 codebase installed because it will download a fresh copy of the ns3-allinone version when building the container.

By default it will build NS3 version 3.32, as that is the version of the simulator that I am using for my research. But a different version can be specified:

$ docker build --build-arg NS3_VERSION=3.33 marshallasch/ns3 .

The build variant can be configured using the BUILD_PROFILE build-arg, it can be set to either debug, release, or optimized. It is set to debug by default.

The only potential shortcoming of that is if there are different system dependencies needed for different versions of ns3, although it should be fine.

One thing to note about this container is that it does not support any visualization.

Usage

This Docker image can be used in one of three ways:

  1. as a base image for other ns-3 projects
  2. to run ns-3 simulations directly
  3. to get a bash shell in a ns-3 installation

As a base image

The main purpose of this image is to be used as a base image for other containers. This image will provide the base ns-3 installation and all of its dependencies. Below is an example docker file showing how this base could be used:

FROM marshallasch/ns3:3.32-debug

COPY . contrib/
RUN ./waf configure --enable-examples --enable-tests --build-profile=${BUILD_PROFILE} && ./waf build

Interactive bash terminal

The interactive shell will put you in the ns-3 root directory. Depending on which docker image tag is used ns-3 can either be built in debug mode or optimized mode.

docker run --rm -it marshallasch/ns3:3.32-optimized bash

To run ns-3 simulations

If anything other than bash is given as the command to the Docker container then the command will be passed to ./waf --run "<command>" to run a simulation.

docker run --rm marshallasch/ns3:3.32-optimized first

Special Thanks

I would like to acknowledge Dr. Jason Ernst (@compscidr) who gave me the idea to implement this pipeline stage to help validate that my simulation code actually builds.

ns3-container's People

Contributors

marshallasch avatar renovate-bot avatar

Stargazers

Jan Zajic avatar

Watchers

James Cloos avatar  avatar

ns3-container's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • ubuntu focal
github-actions
.github/workflows/deploy.yaml
  • docker/metadata-action v3
  • docker/setup-qemu-action v1
  • docker/setup-buildx-action v1
  • docker/login-action v1
  • docker/build-push-action v2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.