diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92a309cdd8c6a3c0437c06d87d8e31a42af9af57..0ff37e283d35f24e6417f902695e941da982c15e 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 + 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 - pip3 install -r jobs/src/tornettools/requirements.txt