From 2a2e32081c2bfc46004c11593684774fd3021757 Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Tue, 14 Dec 2021 16:35:09 -0600 Subject: [PATCH 1/5] Add options to override perfclient bandwidth --- .gitlab-ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92a309c..81dc012 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,6 +105,12 @@ variables: PL_SIM_COUNTRY_CODES: value: de hk description: "Which countries we want to plot live network, baseline and sim results for" + PL_PERFCLIENT_BANDWIDTH_UP: + value: + description: "If non-empty, override's onionperf node's bandwidth up. e.g. '1000000 kilobit'" + PL_PERFCLIENT_BANDWIDTH_DOWN: + value: + description: "If non-empty, override's onionperf node's bandwidth down. e.g. '1000000 kilobit'" stages: - build - stage-sim @@ -712,6 +718,20 @@ tornettools-stage: - tornettools --seed $TRIAL_NUM generate jobs/network-data/relayinfo_staging_*.json jobs/network-data/userinfo_staging_*.json jobs/network-data/networkinfo_staging.gml jobs/network-data/tmodel --network_scale $SCALE --prefix $SIMDIR --tor jobs/opt/tor/bin/tor --torgencert jobs/opt/tor/bin/tor-gencert --process_scale $PROCESS_SCALE --load_scale $LOAD_SCALE + # Replace bandwidths + - "python3 << EOM\n + config = open('$SIMDIR/shadow.config.yaml')\n + import yaml\n + config = yaml.load(config, yaml.loader.Loader)\n + for (host, host_config) in config['hosts'].items():\n + if host.startswith('perfclient'):\n + if '$PL_PERFCLIENT_BANDWIDTH_UP'\n + host_config.bandwidth_up = '$PL_PERFCLIENT_BANDWIDTH_UP'\n + if '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n + host_config.bandwidth_up = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n + yaml.dump(config, stream=open('$SIMDIR/shadow.config.yaml', 'w'))\n + EOM" + # Run simulation - apt-get install -y libevent-2.1-7 libssl1.1 zlib1g libglib2.0-0 libigraph0v5 libprocps8 stow sysstat python3 python3-pip - pip3 install -r jobs/src/tornettools/requirements.txt -- GitLab From 2dd873dd8a064e492bf8b3ebfa96da929e2bee38 Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Tue, 14 Dec 2021 16:38:54 -0600 Subject: [PATCH 2/5] fixup! Add options to override perfclient bandwidth --- .gitlab-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 81dc012..0c7541c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -106,10 +106,10 @@ variables: value: de hk description: "Which countries we want to plot live network, baseline and sim results for" PL_PERFCLIENT_BANDWIDTH_UP: - value: + value: '' description: "If non-empty, override's onionperf node's bandwidth up. e.g. '1000000 kilobit'" PL_PERFCLIENT_BANDWIDTH_DOWN: - value: + value: '' description: "If non-empty, override's onionperf node's bandwidth down. e.g. '1000000 kilobit'" stages: - build @@ -725,10 +725,10 @@ tornettools-stage: config = yaml.load(config, yaml.loader.Loader)\n for (host, host_config) in config['hosts'].items():\n if host.startswith('perfclient'):\n - if '$PL_PERFCLIENT_BANDWIDTH_UP'\n - host_config.bandwidth_up = '$PL_PERFCLIENT_BANDWIDTH_UP'\n - if '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n - host_config.bandwidth_up = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n + if '$PL_PERFCLIENT_BANDWIDTH_UP':\n + host_config['bandwidth_up'] = '$PL_PERFCLIENT_BANDWIDTH_UP'\n + if '$PL_PERFCLIENT_BANDWIDTH_DOWN':\n + host_config['bandwidth_down'] = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n yaml.dump(config, stream=open('$SIMDIR/shadow.config.yaml', 'w'))\n EOM" -- GitLab From ed610a8702412525c9a28f2bed855431683dda4e Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Tue, 14 Dec 2021 17:09:23 -0600 Subject: [PATCH 3/5] fixup! fixup! Add options to override perfclient bandwidth --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c7541c..8a0a58a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -730,7 +730,7 @@ tornettools-stage: if '$PL_PERFCLIENT_BANDWIDTH_DOWN':\n host_config['bandwidth_down'] = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n yaml.dump(config, stream=open('$SIMDIR/shadow.config.yaml', 'w'))\n - EOM" + \nEOM\n" # Run simulation - apt-get install -y libevent-2.1-7 libssl1.1 zlib1g libglib2.0-0 libigraph0v5 libprocps8 stow sysstat python3 python3-pip -- GitLab From c0c90ac2659d4fe56181bb91b9158f62565777c1 Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Tue, 14 Dec 2021 18:48:24 -0600 Subject: [PATCH 4/5] fixup! fixup! fixup! Add options to override perfclient bandwidth --- .gitlab-ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a0a58a..b209dd7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -719,18 +719,18 @@ tornettools-stage: - tornettools --seed $TRIAL_NUM generate jobs/network-data/relayinfo_staging_*.json jobs/network-data/userinfo_staging_*.json jobs/network-data/networkinfo_staging.gml jobs/network-data/tmodel --network_scale $SCALE --prefix $SIMDIR --tor jobs/opt/tor/bin/tor --torgencert jobs/opt/tor/bin/tor-gencert --process_scale $PROCESS_SCALE --load_scale $LOAD_SCALE # Replace bandwidths - - "python3 << EOM\n - config = open('$SIMDIR/shadow.config.yaml')\n - import yaml\n - config = yaml.load(config, yaml.loader.Loader)\n - for (host, host_config) in config['hosts'].items():\n - if host.startswith('perfclient'):\n - if '$PL_PERFCLIENT_BANDWIDTH_UP':\n - host_config['bandwidth_up'] = '$PL_PERFCLIENT_BANDWIDTH_UP'\n - if '$PL_PERFCLIENT_BANDWIDTH_DOWN':\n - host_config['bandwidth_down'] = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n - yaml.dump(config, stream=open('$SIMDIR/shadow.config.yaml', 'w'))\n - \nEOM\n" + - "python3 << EOM + config = open('$SIMDIR/shadow.config.yaml')\n\ + import yaml\n\ + config = yaml.load(config, yaml.loader.Loader)\n\ + for (host, host_config) in config['hosts'].items():\n\ + if host.startswith('perfclient'):\n\ + if '$PL_PERFCLIENT_BANDWIDTH_UP':\n\ + host_config['bandwidth_up'] = '$PL_PERFCLIENT_BANDWIDTH_UP'\n\ + if '$PL_PERFCLIENT_BANDWIDTH_DOWN':\n\ + host_config['bandwidth_down'] = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n\ + yaml.dump(config, stream=open('$SIMDIR/shadow.config.yaml', 'w'))\n\ + EOM\n" # Run simulation - apt-get install -y libevent-2.1-7 libssl1.1 zlib1g libglib2.0-0 libigraph0v5 libprocps8 stow sysstat python3 python3-pip -- GitLab From 655b069e48375673eb5093e3884d5a46d25c6158 Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Tue, 14 Dec 2021 18:59:31 -0600 Subject: [PATCH 5/5] fixup! fixup! fixup! fixup! Add options to override perfclient bandwidth --- .gitlab-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b209dd7..0ff37e2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -719,18 +719,18 @@ tornettools-stage: - tornettools --seed $TRIAL_NUM generate jobs/network-data/relayinfo_staging_*.json jobs/network-data/userinfo_staging_*.json jobs/network-data/networkinfo_staging.gml jobs/network-data/tmodel --network_scale $SCALE --prefix $SIMDIR --tor jobs/opt/tor/bin/tor --torgencert jobs/opt/tor/bin/tor-gencert --process_scale $PROCESS_SCALE --load_scale $LOAD_SCALE # Replace bandwidths - - "python3 << EOM - config = open('$SIMDIR/shadow.config.yaml')\n\ + - 'python3 << EOM + config = open("$SIMDIR/shadow.config.yaml")\n\ import yaml\n\ config = yaml.load(config, yaml.loader.Loader)\n\ - for (host, host_config) in config['hosts'].items():\n\ - if host.startswith('perfclient'):\n\ - if '$PL_PERFCLIENT_BANDWIDTH_UP':\n\ - host_config['bandwidth_up'] = '$PL_PERFCLIENT_BANDWIDTH_UP'\n\ - if '$PL_PERFCLIENT_BANDWIDTH_DOWN':\n\ - host_config['bandwidth_down'] = '$PL_PERFCLIENT_BANDWIDTH_DOWN'\n\ - yaml.dump(config, stream=open('$SIMDIR/shadow.config.yaml', 'w'))\n\ - EOM\n" + for (host, host_config) in config["hosts"].items():\n\ + if host.startswith("perfclient"):\n\ + if "$PL_PERFCLIENT_BANDWIDTH_UP":\n\ + host_config["bandwidth_up"] = "$PL_PERFCLIENT_BANDWIDTH_UP"\n\ + if "$PL_PERFCLIENT_BANDWIDTH_DOWN":\n\ + host_config["bandwidth_down"] = "$PL_PERFCLIENT_BANDWIDTH_DOWN"\n\ + yaml.dump(config, stream=open("$SIMDIR/shadow.config.yaml", "w"))\n\ + EOM\n' # Run simulation - apt-get install -y libevent-2.1-7 libssl1.1 zlib1g libglib2.0-0 libigraph0v5 libprocps8 stow sysstat python3 python3-pip -- GitLab