@@ -60,56 +60,43 @@ args = ["build", "-f", "${THRESHOLD_FHE_DOCKER_FILE}", "--build-arg", "FEATURES=
6060command = " docker"
6161args = [" build" , " -f" , " ${THRESHOLD_FHE_DOCKER_FILE}" , " --build-arg" , " FEATURES=measure_memory,extension_degree_8" , " -t" , " tfhe-core-degree-8-mem" , " ${THRESHOLD_FHE_DOCKER_ROOT}" ]
6262
63+ # Build all the images for TFHE parties with memory measurement feature
64+ [tasks .tfhe-docker-images-all-degrees-mem ]
65+ run_task = { name = [" tfhe-docker-image-degree-3-mem" , " tfhe-docker-image-degree-4-mem" , " tfhe-docker-image-degree-5-mem" , " tfhe-docker-image-degree-6-mem" , " tfhe-docker-image-degree-7-mem" , " tfhe-docker-image-degree-8-mem" ]}
66+
6367# Build the image for BGV parties (with centralized DKG available)
6468[tasks .bgv-docker-image ]
6569command = " docker"
6670args = [" build" , " -f" , " ${THRESHOLD_FHE_DOCKER_FILE}" , " --build-arg" , " FEATURES=extension_degree_4" , " -t" , " bgv-core" , " ${THRESHOLD_FHE_DOCKER_ROOT}" ]
6771
72+ [tasks .bgv-docker-image-mem ]
73+ command = " docker"
74+ args = [" build" , " -f" , " ${THRESHOLD_FHE_DOCKER_FILE}" , " --build-arg" , " FEATURES=measure_memory,extension_degree_4" , " -t" , " bgv-core-mem" , " ${THRESHOLD_FHE_DOCKER_ROOT}" ]
75+
6876# Generate the certificate for TLS communication of the parties
6977# Note: templating feature isn't required, but allows to compile the code only once since gen-experiment requires the feature
7078[tasks .gen-test-certs ]
7179command = " cargo"
7280args = [" run" , " --bin" , " threshold-gen-tls-certs" ," --release" ," --features" , " templating" , " --" , " --ca-prefix" , " p" , " --ca-count" , " ${NUM_PARTIES}" , " -n" , " 1" , " -o" , " test_certs" ]
7381
74- # Generate the toml config file for the choreographer for a cluster of parties accessible from localhost
75- [tasks .gen-local-choreo ]
76- command = " cargo"
77- args = [" run" , " --bin" , " gen-experiment" , " --release" , " --features" , " templating" , " --" , " -n" , " ${NUM_PARTIES}" , " -t" , " ${THRESHOLD}" , " -f" , " temp" , " -o" , " local-cluster" , " choreographer" ]
78-
79- # Generate the yml config file for the dockerized parties (tfhe)
80- [tasks .tfhe-gen-local-cluster ]
81- command = " cargo"
82- args = [" run" , " --bin" , " gen-experiment" , " --release" , " --features" , " templating" , " --" , " -n" , " ${NUM_PARTIES}" , " -o" , " tfhe-local-cluster" , " -f" , " temp" , " parties" , " --protocol" , " tfhe" ]
83-
84- # Generate the yml config file for the dockerized parties (bgv)
85- [tasks .bgv-gen-local-cluster ]
86- command = " cargo"
87- args = [" run" , " --bin" , " gen-experiment" , " --release" , " --features" , " templating" , " --" , " -n" , " ${NUM_PARTIES}" , " -o" , " bgv-local-cluster" , " -f" , " temp" , " parties" , " --protocol" , " bgv" ]
88-
8982# Generate docker-compose file for the TFHE parties as well as the toml config file for the choreogrpaher for a local deployment (tfhe)
9083[tasks .tfhe-gen-experiment ]
91- command = " cargo"
92- args = [" run" , " --bin" , " gen-experiment" , " --release" , " --features" , " templating" , " --" , " -n" , " ${NUM_PARTIES}" , " -t" , " ${THRESHOLD}" , " -s" , " ${MOBY_STRATEGY}" , " -f" , " temp" , " -o" , " ${EXPERIMENT_NAME}" , " all" , " --protocol" , " tfhe" ]
84+ script = '''
85+ cargo run --bin gen-experiment --release --features templating -- -n ${NUM_PARTIES} -t ${THRESHOLD} -s ${MOBY_STRATEGY} -f temp -o ${EXPERIMENT_NAME} all --protocol tfhe ${MEASURE_MEMORY}
86+ '''
9387
9488# Generate docker-compose file for the BGV parties as well as the toml config file for the choreogrpaher for a local deployment (bgv)
9589[tasks .bgv-gen-experiment ]
96- command = " cargo"
97- args = [" run" , " --bin" , " gen-experiment" , " --release" , " --features" , " templating" , " --" , " -n" , " ${NUM_PARTIES}" , " -t" , " ${THRESHOLD}" , " -s" , " ${MOBY_STRATEGY}" , " -f" , " temp" , " -o" , " ${EXPERIMENT_NAME}" , " all" , " --protocol" , " bgv" ]
98-
99-
100- # Bring parties alive based on provided yml file
101- [tasks .start-parties ]
102- command = " docker"
103- args = [" compose" , " --progress=quiet" , " -f" , " temp/${EXPERIMENT_NAME}.yml" , " up" , " --quiet-pull" ]
104-
105- # Stop all parties
106- [tasks .stop-parties ]
10790script = '''
108- docker compose -f temp/${EXPERIMENT_NAME}.yml logs > temp/${EXPERIMENT_NAME}.log
109- docker compose --progress=quiet -f temp/${EXPERIMENT_NAME}.yml down
91+ cargo run --bin gen-experiment --release --features templating -- -n ${NUM_PARTIES} -t ${THRESHOLD} -f temp -o ${EXPERIMENT_NAME} all --protocol bgv ${MEASURE_MEMORY}
11092'''
11193
11294
95+ # Bring parties alive based on provided yml file, waiting for health check to pass
96+ [tasks .start-parties-healthy ]
97+ command = " docker"
98+ args = [" compose" , " --progress=quiet" , " -f" , " temp/${EXPERIMENT_NAME}.yml" , " up" , " --quiet-pull" , " --wait" ]
99+
113100# ##One liner for benching everything
114101[tasks .experiment-name ]
115102script = '''
@@ -138,82 +125,57 @@ mkdir -p temp/telemetry/archived
138125mv temp/telemetry/export.json temp/telemetry/archived/trace_${EXPERIMENT_NAME}_$(date +%Y_%m_%d-%H:%M:%S).json
139126'''
140127
128+ # Setup the test, creating the necessary directories and files for telemetry and session stats, with appropriate permissions for the parties to write to them. Also adds a header to the session stats files to indicate the start of a new run with the experiment name and timestamp. This task is meant to be run before starting the parties in an experiment.
141129[tasks .setup ]
142130script = '''
143131mkdir -p temp/telemetry
144132echo "" > temp/telemetry/export.json
145133chmod o+w temp/telemetry/export.json
134+ mkdir -p temp/session_stats
135+ RUN_DATE="$(date -u +%Y%m%dT%H%M%SZ)-$$"
136+ for i in $(seq 1 ${NUM_PARTIES}); do
137+ touch temp/session_stats/session_stats_$i.txt
138+ printf "\nNEW_RUN: ${EXPERIMENT_NAME} ${RUN_DATE} ${MEASURE_MEMORY}" >> temp/session_stats/session_stats_$i.txt
139+ chmod o+w temp/session_stats/session_stats_$i.txt
140+ done
146141'''
147142
148- # Bring parties alive based on provided yml file, waiting for health check to pass
149- [tasks .start-parties-healthy ]
150- command = " docker"
151- args = [" compose" , " --progress=quiet" , " -f" , " temp/${EXPERIMENT_NAME}.yml" , " up" , " --quiet-pull" , " --wait" ]
152143
153- # Run the full test suite for tfhe with real dkg
154- [tasks .tfhe-test-small ]
155- command = " sh "
156- args = [ " test_scripts/tfhe_test_small_session.sh " , " temp/${EXPERIMENT_NAME}.toml " ]
144+ # Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
145+ [tasks .tfhe-bench-run-4p ]
146+ env = { "NUM_PARTIES" = " 4 " , THRESHOLD = " 1 " , MOBY_STRATEGY = " secure " , EXPERIMENT_NAME = " tfhe-bench-run-4p " }
147+ run_task = { name = [ " setup " , " gen-test-certs " , " tfhe-gen-experiment " , " experiment-name " , " start-parties-healthy " ], fork = true }
157148
158- # Run the full test suite for tfhe with centralized dkg
159- [tasks .tfhe-test-large ]
160- command = " sh "
161- args = [ " test_scripts/tfhe_test_large_session.sh " , " temp/${EXPERIMENT_NAME}.toml " ]
149+ # Runs a cluster of 5 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
150+ [tasks .tfhe-bench-run-5p ]
151+ env = { "NUM_PARTIES" = " 5 " , THRESHOLD = " 1 " , MOBY_STRATEGY = " secure " , EXPERIMENT_NAME = " tfhe-bench-run-5p " }
152+ run_task = { name = [ " setup " , " gen-test-certs " , " tfhe-gen-experiment " , " experiment-name " , " start-parties-healthy " ], fork = true }
162153
163- # Run the full test suite for tfhe with real dkg
164- [tasks .bgv-test-real-dkg ]
165- command = " sh "
166- args = [ " test_scripts/bgv_test_script_real_dkg.sh " , " temp/${EXPERIMENT_NAME}.toml " ]
154+ # Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "drop_all" strategy (malicious behavior where the malicious party does nothing)
155+ [tasks .tfhe-bench-run-4p-malicious-drop ]
156+ env = { "NUM_PARTIES" = " 4 " , THRESHOLD = " 1 " , MOBY_STRATEGY = " drop_all " , EXPERIMENT_NAME = " tfhe-bench-run-4p-malicious-drop " }
157+ run_task = { name = [ " setup " , " gen-test-certs " , " tfhe-gen-experiment " , " experiment-name " , " start-parties-healthy " ], fork = true }
167158
168- # Run the full test suite for tfhe with centralized dkg
169- [tasks .bgv-test-fake-dkg ]
170- command = " sh "
171- args = [ " test_scripts/bgv_test_script_fake_dkg.sh " , " temp/${EXPERIMENT_NAME}.toml " ]
159+ # Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
160+ [tasks .tfhe-bench-run-4p-mem ]
161+ env = { "NUM_PARTIES" = " 4 " , THRESHOLD = " 1 " , MOBY_STRATEGY = " secure " , EXPERIMENT_NAME = " tfhe-bench-run-4p-mem " , MEASURE_MEMORY = " --measure-memory " }
162+ run_task = { name = [ " setup " , " gen-test-certs " , " tfhe-gen-experiment " , " experiment-name " , " start-parties-healthy " ], fork = true }
172163
173- [tasks .tfhe-bench-make ]
174- env = {MOBY_STRATEGY = " secure" }
164+ # Runs a cluster of 5 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
165+ [tasks .tfhe-bench-run-5p-mem ]
166+ env = {"NUM_PARTIES" = " 5" , THRESHOLD = " 1" , MOBY_STRATEGY =" secure" , EXPERIMENT_NAME =" tfhe-bench-run-5p-mem" , MEASURE_MEMORY =" --measure-memory" }
175167run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" ], fork = true }
176168
177- [tasks .tfhe-bench-run ]
178- env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , MOBY_STRATEGY =" secure" , EXPERIMENT_NAME =" tfhe-bench-run" }
169+ # Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "malicious_broadcast" strategy (MaliciousBroadcastSenderEcho strategy)
170+ [tasks .tfhe-bench-run-4p-malicious-bcast ]
171+ env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , MOBY_STRATEGY =" malicious_broadcast" , EXPERIMENT_NAME =" tfhe-bench-run-4p-malicious-bcast" }
179172run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" ], fork = true }
180173
174+ # Runs a cluster of 4 parties with the bgv protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
181175[tasks .bgv-bench-run ]
182176env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , EXPERIMENT_NAME =" bgv-bench-run" }
183177run_task = { name = [" setup" , " gen-test-certs" , " bgv-gen-experiment" , " experiment-name" , " start-parties-healthy" ], fork = true }
184178
185- # For small session we run with N=4,t=1
186- [tasks .tfhe-run-small-session ]
187- env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , MOBY_STRATEGY =" secure" , EXPERIMENT_NAME =" tfhe-small-session" }
188- run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" , " tfhe-test-small" ], fork = true , cleanup_task = " shutdown" }
189-
190- [tasks .tfhe-run-small-session-drop ]
191- env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , MOBY_STRATEGY =" drop_all" , EXPERIMENT_NAME =" tfhe-small-session-drop" }
192- run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" , " tfhe-test-small" ], fork = true , cleanup_task = " shutdown" }
193-
194- [tasks .tfhe-run-small-session-malicious-bcast ]
195- env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , MOBY_STRATEGY =" malicious_broadcast" , EXPERIMENT_NAME =" tfhe-small-session-malicious-bcast" }
196- run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" , " tfhe-test-small" ], fork = true , cleanup_task = " shutdown" }
197-
198- # For large session we run with N=5,t=1
199- [tasks .tfhe-run-large-session ]
200- env = {"NUM_PARTIES" = " 5" , THRESHOLD = " 1" , MOBY_STRATEGY =" secure" , EXPERIMENT_NAME =" tfhe-large-session" }
201- run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" , " tfhe-test-large" ], fork = true , cleanup_task = " shutdown" }
202-
203- [tasks .tfhe-run-large-session-drop ]
204- env = {"NUM_PARTIES" = " 5" , THRESHOLD = " 1" , MOBY_STRATEGY =" drop_all" , EXPERIMENT_NAME =" tfhe-large-session-drop" }
205- run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" , " tfhe-test-large" ], fork = true , cleanup_task = " shutdown" }
206-
207-
208- [tasks .tfhe-run-large-session-malicious-bcast ]
209- env = {"NUM_PARTIES" = " 5" , THRESHOLD = " 1" , MOBY_STRATEGY =" malicious_broadcast" , EXPERIMENT_NAME =" tfhe-large-session-malicious-bcast" }
210- run_task = { name = [" setup" , " gen-test-certs" , " tfhe-gen-experiment" , " experiment-name" , " start-parties-healthy" , " tfhe-test-large" ], fork = true , cleanup_task = " shutdown" }
211-
212- # #For BGV we set NUM_PARTIES to 4 as we only need small sessions
213- [tasks .bgv-bench-fake-dkg ]
214- env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , EXPERIMENT_NAME =" bgv" }
215- run_task = { name = [" setup" , " gen-test-certs" , " bgv-gen-experiment" , " experiment-name" , " start-parties-healthy" , " bgv-test-fake-dkg" ], fork = true , cleanup_task = " shutdown" }
216-
217- [tasks .bgv-bench-real-dkg ]
218- env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , EXPERIMENT_NAME =" bgv" }
219- run_task = { name = [" setup" , " gen-test-certs" , " bgv-gen-experiment" , " experiment-name" , " start-parties-healthy" , " bgv-test-real-dkg" ], fork = true , cleanup_task = " shutdown" }
179+ [tasks .bgv-bench-run-mem ]
180+ env = {"NUM_PARTIES" = " 4" , THRESHOLD = " 1" , EXPERIMENT_NAME =" bgv-bench-run-mem" , MEASURE_MEMORY =" --measure-memory" }
181+ run_task = { name = [" setup" , " gen-test-certs" , " bgv-gen-experiment" , " experiment-name" , " start-parties-healthy" ], fork = true }
0 commit comments