Skip to content

Commit 7799aff

Browse files
author
Andrey Golovanov
committed
refactoring with reduction of scope
1 parent 9a28041 commit 7799aff

76 files changed

Lines changed: 20141 additions & 4222 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,9 @@
66

77
## Introduction
88

9-
NetSim is planned to become a toolkit that could help network engineers (my friends and myself included) to better reason about the network designs.
9+
NetSim is a discrete event simulator toolkit adapted for network simulation use-cases.
1010

11-
Types of problems we want this toolkit to help solving (eventually):
11+
Types of problems this toolkit can help solving:
1212

13-
* Flow analysis of a network graph with simulated failures
13+
* Simulation of failures in a network graph
1414
* Simulation of routing protocol behavior in stochastic environment
15-
16-
From a high level standpoint the system consists of few components:
17-
18-
* Workflow instructions
19-
* Simple graph library
20-
* Tool to build network graphs from their definitions
21-
* Discrete event simulator
22-
23-
## How to use
24-
25-
1. Clone this repo (or download as ZIP archive)
26-
1. Build docker image:
27-
28-
```text
29-
docker build -t netsim .
30-
```
31-
32-
1. Run a container:
33-
34-
```text
35-
docker run -it --rm --hostname netsim --name netsim-running -p 8888:8888 netsim
36-
```
37-
38-
1. Upon startup your container started a Jupyter Notebook Server that printed a bunch of text. There should be a URL looking similar to:
39-
40-
```text
41-
http://127.0.0.1:8888/?token=553ef7c73f079ac51936b542f64cf58b7ea8da6561499350
42-
```
43-
44-
1. Copy/paste the URL into your browser. It should open Jupyter Notebook App window.
45-
1. Pick any example and run it.

dev/build.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

dev/buildenv.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ IMAGE_ID=$(docker images --format "{{.ID}}" $IMAGE_TAG)
77

88
USAGE="Usage: $0 COMMAND IMAGE_TAG\n"
99
USAGE+=" COMMAND is what you expect script to do:\n"
10-
USAGE+=" run - Runs a ubuildenv container.\n"
11-
USAGE+=" killall - Stops and removes all running ubuildenv containers.\n"
10+
USAGE+=" build - Builds an image from a Dockerfile.\n"
11+
USAGE+=" run - Runs a container.\n"
12+
USAGE+=" killall - Stops and removes all running containers.\n"
1213
USAGE+=" forcecleanall - Clean-up Docker.\n"
1314

1415
if [[ $# -lt 1 ]]; then
@@ -19,6 +20,15 @@ fi
1920

2021
[[ $(uname) -eq "Darwin" ]] && MODHACK="-v /lib/modules:/lib/modules:ro" || MODHACK=""
2122

23+
function build {
24+
echo "Building docker container"
25+
docker build ./dev -t $IMAGE_TAG
26+
27+
IMAGE_ID=$(docker images --format "{{.ID}}" $IMAGE_TAG)
28+
echo "Container image id: $IMAGE_ID"
29+
return 0
30+
}
31+
2232
function run {
2333
name=$(basename "`pwd`")
2434
echo "Starting a container with the name $name using $IMAGE_TAG image..."
@@ -48,6 +58,11 @@ function forcecleanall {
4858
}
4959

5060
case $1 in
61+
build)
62+
echo "Executing BUILD command..."
63+
build "$@"
64+
;;
65+
5166
run)
5267
echo "Executing RUN command..."
5368
run "$@"

dev/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ngraph
12
pyyaml
23
schema
34
jq

examples/base.ipynb

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)