Skip to content

Commit

Permalink
rwnd -> ratemon
Browse files Browse the repository at this point in the history
  • Loading branch information
ccanel committed Feb 29, 2024
1 parent 6375aa0 commit 35841ff
Show file tree
Hide file tree
Showing 57 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/docker-existing-dockerfile
{
"name": "rwnd",
"image": "ccanel/rwnd:latest",
"name": "ratemon",
"image": "ccanel/ratemon:latest",
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
Expand Down
24 changes: 12 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "(d) runtime",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"program": "${workspaceFolder}/ratemon/runtime/ratemon_runtime.py",
"console": "integratedTerminal",
"args": [
"-h"
Expand All @@ -26,7 +26,7 @@
"name": "(r) runtime",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"program": "${workspaceFolder}/ratemon/runtime/ratemon_runtime.py",
"console": "integratedTerminal",
"args": [
"--model=HistGbdtSklearn",
Expand All @@ -36,7 +36,7 @@
"--cgroup=${workspaceFolder}/test/test_cgroup",
"--inference-interval-ms=100",
"--batch-size=10",
"--log=/tmp/rwnd.log",
"--log=/tmp/ratemon.log",
"--skip-localhost",
"--listen-ports=9999",
"--debug",
Expand All @@ -56,17 +56,17 @@
"name": "(r) runtime, schedule",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"program": "${workspaceFolder}/ratemon/runtime/ratemon_runtime.py",
"console": "integratedTerminal",
"args": [
"--model=HistGbdtSklearn",
"--model-file=${workspaceFolder}/test/HistGbdtSklearn_fewer_features.pickle",
"--interface=ens3",
"--reaction-strategy=file",
"--schedule=${workspaceFolder}/test/rwnd_schedule_step.csv",
"--schedule=${workspaceFolder}/test/ratemon_schedule_step.csv",
"--cgroup=${workspaceFolder}/test/test_cgroup",
"--inference-interval-ms=1000",
"--log=/tmp/rwnd.log",
"--log=/tmp/ratemon.log",
// "--disable-inference"
],
"autoReload": {
Expand All @@ -87,14 +87,14 @@
"args": [
"-o",
"/tmp/tmp.prof",
"${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"${workspaceFolder}/ratemon/runtime/ratemon_runtime.py",
"--model=HistGbdtSklearn",
"--model-file=${workspaceFolder}/test/HistGbdtSklearn_fewer_features.pickle",
"--interface=ens3",
"--reaction-strategy=aimd",
"--cgroup=${workspaceFolder}/test/test_cgroup",
"--inference-interval-ms=1000",
"--log=/tmp/rwnd.log",
"--log=/tmp/ratemon.log",
// "--skip-localhost",
"--constrain-port",
"--debug",
Expand All @@ -113,7 +113,7 @@
"name": "(r) train cubic bbr",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/model/train.py",
"program": "${workspaceFolder}/ratemon/model/train.py",
"console": "integratedTerminal",
"args": [
"--no-rand",
Expand Down Expand Up @@ -147,7 +147,7 @@
"name": "(r) prepare_data",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/model/prepare_data.py",
"program": "${workspaceFolder}/ratemon/model/prepare_data.py",
"console": "integratedTerminal",
"args": [
"--data-dir=/home/ccanel/fawnstore2/out/cloudlab/2021-5-12/cubic-bbr",
Expand All @@ -172,7 +172,7 @@
"name": "(r) gen_features",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/model/gen_features.py",
"program": "${workspaceFolder}/ratemon/model/gen_features.py",
"console": "integratedTerminal",
"args": [
"--exp-dir=/home/ccanel/fawnstore2/out/cloudlab/2022-06-10/cubic-bbr/experiments",
Expand All @@ -195,7 +195,7 @@
"name": "(r) eval",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rwnd/scripts/eval.py",
"program": "${workspaceFolder}/ratemon/scripts/eval.py",
"console": "integratedTerminal",
"args": [
"--exp-dir=/home/ccanel/out/cloudlab/2022-4-21/",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# rwnd
# RateMon
Receiver-side mechanisms for rate control of TCP flows.
2 changes: 1 addition & 1 deletion fstab
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# /etc/fstab configuration for MAAS cluster
192.168.0.11:/volume1/datapository/users/ccanel/rwnd /home/ubuntu/fawnstore2 nfs rw,soft,intr,nofail 2 0
192.168.0.11:/volume1/datapository/users/ccanel/ratemon /home/ubuntu/fawnstore2 nfs rw,soft,intr,nofail 2 0
tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=50G 0 0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/model/cl_args.py → ratemon/model/cl_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from os import path

from rwnd.model import defaults, models
from ratemon.model import defaults, models


def add_out(psr, psr_verify=lambda args: args):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/model/data.py → ratemon/model/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numpy.lib import recfunctions
import torch

from rwnd.model import defaults, features, models, utils
from ratemon.model import defaults, features, models, utils


def get_dataloaders(args, net):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/model/features.py → ratemon/model/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import itertools

from rwnd.model import defaults
from ratemon.model import defaults


def make_ewma_metric(metric, alpha):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json
import numpy as np

from rwnd.model import cl_args, defaults, features, loss_event_rate, utils
from ratemon.model import cl_args, defaults, features, loss_event_rate, utils


def get_time_bounds(pkts, direction="data"):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import collections
import logging

from rwnd.model import features
from ratemon.model import features


class LossTracker:
Expand Down
2 changes: 1 addition & 1 deletion rwnd/model/models.py → ratemon/model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sklearn import svm
import torch

from rwnd.model import defaults, features, utils
from ratemon.model import defaults, features, utils


SMOOTHING_THRESHOLD = 0.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# validate the CloudLab parallel testbed.
#
# Usage: ./parse_validation_exps.sh \
# <cmu-snap:rwnd repo dir> <iterations dir> <scratch (untar) dir> \
# <cmu-snap:ratemon repo dir> <iterations dir> <scratch (untar) dir> \
# <direction to parse (forward or reverse)>

set -o errexit
set -o nounset

RWND_DIR=$1
RATEMON_DIR=$1
ITERS_DIR=$2
UNTAR_DIR=$3
DIRECTION=$4
Expand All @@ -23,7 +23,7 @@ parse_iter_batchsize () {
ITER=$1
BATCH_SIZE=$2
EXP_DIR="$ITERS_DIR/iter_$ITER/batchsize_$BATCH_SIZE"
python "$RWND_DIR/model/parse_cloudlab.py" --exp-dir "$EXP_DIR" \
python "$RATEMON_DIR/model/parse_cloudlab.py" --exp-dir "$EXP_DIR" \
--untar-dir "$UNTAR_DIR" --out-dir "$EXP_DIR" \
--skip-smoothed-features
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import numpy as np

from rwnd.model import cl_args, defaults, features, models, utils
from ratemon.model import cl_args, defaults, features, models, utils


SPLIT_NAMES = ["train", "val", "test"]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/model/sim.py → ratemon/model/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


# Path to the ns-3 top-level directory.
# Warning: If you move this file from the directory "rwnd/model", then you
# Warning: If you move this file from the directory "ratemon/model", then you
# must update this variable.
NS3_DIR = path.join(path.dirname(path.realpath(__file__)), "..", "ns-3-unfair")
# The name of the ns-3 application to run.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/model/train.py → ratemon/model/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import torch

from rwnd.model import cl_args, data, defaults, models, utils
from ratemon.model import cl_args, data, defaults, models, utils


# The threshold of the new throughout to the old throughput above which a
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/model/utils.py → ratemon/model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from sklearn import inspection
import torch

from rwnd.model import defaults, features
from ratemon.model import defaults, features


# Values considered unsafe for division and min().
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import threading
import time

from rwnd.model import defaults, loss_event_rate, utils
from ratemon.model import defaults, loss_event_rate, utils


class FlowKey(ctypes.Structure):
Expand Down
8 changes: 4 additions & 4 deletions rwnd/runtime/inference.py → ratemon/runtime/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from pyroute2 import IPRoute, protocols
from pyroute2.netlink.exceptions import NetlinkError

from rwnd.model import data, defaults, features, gen_features, models, utils
from rwnd.runtime import flow_utils, reaction_strategy
from rwnd.runtime.reaction_strategy import ReactionStrategy
from ratemon.model import data, defaults, features, gen_features, models, utils
from ratemon.runtime import flow_utils, reaction_strategy
from ratemon.runtime.reaction_strategy import ReactionStrategy


def predict(net, in_fets, debug=False):
Expand Down Expand Up @@ -417,7 +417,7 @@ def load_bpf():
# Load BPF text.
bpf_flp = path.join(
path.abspath(path.dirname(__file__)),
"rwnd_runtime.c",
"ratemon_runtime.c",
)
if not path.isfile(bpf_flp):
logging.error("Could not find BPF program: %s", bpf_flp)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import netifaces as ni
import pcapy

from rwnd.model import features, models, utils
from rwnd.runtime import flow_utils, inference, mitigation_strategy, reaction_strategy
from rwnd.runtime.mitigation_strategy import MitigationStrategy
from rwnd.runtime.reaction_strategy import ReactionStrategy
from ratemon.model import features, models, utils
from ratemon.runtime import flow_utils, inference, mitigation_strategy, reaction_strategy
from ratemon.runtime.mitigation_strategy import MitigationStrategy
from ratemon.runtime.reaction_strategy import ReactionStrategy


LOCALHOST = utils.ip_str_to_int("127.0.0.1")
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rwnd/scripts/eval.py → ratemon/scripts/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import matplotlib.pyplot as plt
import numpy as np

from rwnd.model import defaults, features, gen_features, utils
from ratemon.model import defaults, features, gen_features, utils

FIGSIZE = (5, 2.2)
FIGSIZE_BOX = (5, 3.5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import numpy as np

from rwnd.scripts import eval as evl
from rwnd.model import utils
from ratemon.scripts import eval as evl
from ratemon.model import utils


def load_results(args):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eou pipefail

base_dir="$HOME/fawnstore2/out/cloudlab/2021-5-12"

source "$HOME/src/rwnd/.venv/bin/activate"
source "$HOME/src/ratemon/.venv/bin/activate"

for dir in "$base_dir"/*; do
pair="$(echo "$dir" | cut -d'/' -f 8)"
Expand All @@ -13,7 +13,7 @@ for dir in "$base_dir"/*; do
fi
out_dir="$dir/new_splits"
echo "Preparing data for: $dir -> $out_dir"
PYTHONPATH="$HOME/src/rwnd" python "$HOME/src/rwnd/rwnd/model/prepare_data.py" \
PYTHONPATH="$HOME/src/ratemon" python "$HOME/src/ratemon/ratemon/model/prepare_data.py" \
--data-dir="$dir" \
--train-split=70 \
--val-split=0 \
Expand Down
6 changes: 3 additions & 3 deletions rwnd/scripts/train.sh → ratemon/scripts/train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ set +u
source "$venv_dir/bin/activate"
set -u

rwnd_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../.."
ratemon_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../.."
pushd /tmp

# Step 4: Select features from initial model
echo "Training model with all features. Progress: tail -f /tmp/train.log"
bash -x -c "PYTHONPATH='$rwnd_dir' python '$rwnd_dir/rwnd/model/train.py' \
bash -x -c "PYTHONPATH='$ratemon_dir' python '$ratemon_dir/ratemon/model/train.py' \
--no-rand \
--tag='$model_tag' \
--data-dir='$train_data_dir' \
Expand Down Expand Up @@ -88,7 +88,7 @@ mv -fv "/tmp/train.log" "$full_models_dir/${model_tag}_train.log"

# Step 5: Train model with selected features
echo "Training model with selected features. Progress: tail -f /tmp/train.log"
bash -x -c "PYTHONPATH='$rwnd_dir' python '$rwnd_dir/rwnd/model/train.py' \
bash -x -c "PYTHONPATH='$ratemon_dir' python '$ratemon_dir/ratemon/model/train.py' \
--no-rand \
--tag='${model_tag}_selected-features' \
--data-dir='$train_data_dir' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ set -o errexit
exp_dir="$1"
out_dir="$2"
tag="$3"
rwnd_dir="$(cd "$(dirname "$0")"/.. && pwd)"
workspace_dir="$(dirname "$rwnd_dir")"
ratemon_dir="$(cd "$(dirname "$0")"/.. && pwd)"
workspace_dir="$(dirname "$ratemon_dir")"
export PYTHONPATH="$workspace_dir:$PYTHONPATH"

# python "$rwnd_dir/model/gen_features.py" \
# python "$ratemon_dir/model/gen_features.py" \
# --exp-dir="$exp_dir" \
# --untar-dir="$exp_dir" \
# --out-dir="$exp_dir" \
Expand All @@ -30,7 +30,7 @@ prepare() {
cur_exp_dir="$exp_dir/cubic-$1"
tmp_dir="/tmp/prepare_data/cubic-$1"
mkdir -p "$tmp_dir"
python "$rwnd_dir/model/prepare_data.py" \
python "$ratemon_dir/model/prepare_data.py" \
--data-dir="$cur_exp_dir" \
--out-dir="$tmp_dir" \
--model=HistGbdtSklearn \
Expand All @@ -48,7 +48,7 @@ for cca in "highspeed" "illinois" "vivace"; do
prepare "$cca"
done

# python "$rwnd_dir/model/train.py" \
# python "$ratemon_dir/model/train.py" \
# --out-dir="$out_dir" \
# --data-dir="$out_dir"\
# --model=HistGbdtSklearn \
Expand Down
Loading

0 comments on commit 35841ff

Please sign in to comment.