diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2b6b8438608e91d811c12635c04fc74a14f39df..420693ad7f08be63076a435c417f7cdac2ec01a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,7 @@ cache: variables: REPO_DIR: gitlab.com/elixxir REPO_NAME: server - DOCKER_IMAGE: elixxirlabs/cuda-go:go1.13-cuda11.1 + DOCKER_IMAGE: elixxirlabs/cuda-go:go1.16-cuda11.1 # See https://docs.gitlab.com/ee/api/jobs.html#download-a-single-artifact-file-from-specific-tag-or-branch REPOS_API: https://gitlab.com/api/v4/projects/elixxir%2F SERVER_URL: "" diff --git a/basice2e/clients.goldoutput/client20.txt b/basice2e/clients.goldoutput/client20.txt new file mode 100644 index 0000000000000000000000000000000000000000..2b10e4046835de371f6c155d4167bd3efefa75c4 --- /dev/null +++ b/basice2e/clients.goldoutput/client20.txt @@ -0,0 +1,42 @@ +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Received 10 +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Sent: Hello from 20, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Message received: Hello from 21, without E2E Encryption +Received 10 diff --git a/basice2e/clients.goldoutput/client21.txt b/basice2e/clients.goldoutput/client21.txt new file mode 100644 index 0000000000000000000000000000000000000000..12b9325a98938a9ca969f1321a8fb084bb3283ea --- /dev/null +++ b/basice2e/clients.goldoutput/client21.txt @@ -0,0 +1,42 @@ +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Received 10 +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Sent: Hello from 21, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Message received: Hello from 20, without E2E Encryption +Received 10 diff --git a/basice2e/e2eReport.py b/basice2e/e2eReport.py index 86b530ede06fddfcfd9031d466471db1e3508981..2ff019e44abc78c7cde807a0b8fd3ccde8dbecc7 100644 --- a/basice2e/e2eReport.py +++ b/basice2e/e2eReport.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -# This script is used for building reports on dropped E2E integration tests -import logging - +# This script is used for building reports on message sending for E2E integration tests import re import glob import os import logging as log +import datetime +import statistics resultsDir = "./results/clients" @@ -28,19 +28,6 @@ def find_files(): return glob.glob('{}/client*.log'.format(resultsDir)) -def read_file(path, phrases): - """Reads the lines of a file.""" - while 1: - with open(path, 'r') as file: - line = file.readline() - if not line: - break - else: - for phrase in phrases: - if phrase in line: - yield line - - def main(): log.basicConfig(format='[%(levelname)s] %(asctime)s: %(message)s', level=log.INFO, datefmt='%d-%b-%y %H:%M:%S') @@ -65,6 +52,15 @@ def main(): log.debug("Located sent message: {}".format(sent_message)) messages_sent[sent_message] = {"sender": os.path.basename(path)} + # Capture message timestamp + sent_timestamp_str = re.findall('INFO (.{19}\.{0,1}\d{0,6})', line)[0] + try: + sent_timestamp = datetime.datetime.strptime(sent_timestamp_str, '%Y/%m/%d %H:%M:%S.%f') + except ValueError: + sent_timestamp = datetime.datetime.strptime(sent_timestamp_str, '%Y/%m/%d %H:%M:%S') + log.debug("Located sent timestamp: {}".format(sent_timestamp)) + messages_sent[sent_message]["sent"] = sent_timestamp + # Capture rounds messages were sent in sent_round = re.findall('\) in round ([0-9]+)', line)[0] log.debug("Located sent round: {}".format(sent_round)) @@ -72,12 +68,21 @@ def main(): if sent_round not in rounds_sent: rounds_sent[sent_round] = False - elif "Received message of type" in line: + elif "Received message of type" in line or "Received AuthRequest from" in line or "Received AuthConfirm from" in line: # Capture message receiving - received_messages = re.findall(' msgDigest: (.{20})', line) - for received_message in received_messages: - log.debug("Located received message: {}".format(received_message)) - messages_received[received_message] = os.path.basename(path) + received_message = re.findall(' msgDigest: (.{20})', line)[0] + log.debug("Located received message: {}".format(received_message)) + messages_received[received_message] = {"receiver": os.path.basename(path)} + + # Capture message timestamp + received_timestamp_str = re.findall('INFO (.{19}\.{0,1}\d{0,6})', line)[0] + try: + received_timestamp = datetime.datetime.strptime(received_timestamp_str, + '%Y/%m/%d %H:%M:%S.%f') + except ValueError: + received_timestamp = datetime.datetime.strptime(received_timestamp_str, '%Y/%m/%d %H:%M:%S') + log.debug("Located received timestamp: {}".format(received_timestamp)) + messages_received[received_message]["received"] = received_timestamp elif "Round(s)" in line: # Capture round success @@ -87,13 +92,22 @@ def main(): rounds_sent[successful_round] = True # Print results - num_successful = 0 + num_successful = 0 # Keep track of how many messages were received successfully + total_latency = datetime.timedelta() # Keep track of the total message latencies to calculate a mean + latencies = [] # Keep track of each message's latency in order to calculate a median for msgDigest, senderDict in messages_sent.items(): if msgDigest in messages_received: - log.debug("Message {} sent by {} on round {} was received".format(msgDigest, - senderDict["sender"], - senderDict["round"])) num_successful += 1 + time_sent = messages_sent[msgDigest]["sent"] + time_received = messages_received[msgDigest]["received"] + message_latency = time_received - time_sent + latencies.append(message_latency) + total_latency += message_latency + log.info("Message {} sent by {} on round {} was received after {}".format(msgDigest, + senderDict["sender"], + senderDict["round"], + message_latency)) + log.info("\tSent: {}, Received: {}".format(time_sent, time_received)) else: log.error("Message {} sent by {} on round {} was NOT received".format(msgDigest, senderDict["sender"], @@ -105,6 +119,7 @@ def main(): log.warning("Round {} was NOT confirmed successful, messages may have been dropped".format(round_id)) log.info("{}/{} messages received successfully!".format(num_successful, len(messages_sent))) + log.info("\tMean: {}, Median: {}".format(total_latency / num_successful, statistics.median(latencies))) if __name__ == "__main__": diff --git a/basice2e/run.sh b/basice2e/run.sh index 0c23058d6d9d63e118a5986c1e481e8b2d721d7e..455e34209273e6a168c68e0ac71d6da06cdbbfeb 100755 --- a/basice2e/run.sh +++ b/basice2e/run.sh @@ -271,6 +271,19 @@ then wait $PIDVAL wait $PIDVAL2 + echo "FORCING MESSAGE PICKUP RETRY... (NON-E2E, PRECAN)" + CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceMessagePickupRetry --unsafe -l $CLIENTOUT/client20.log -s blob20 --sendid 20 --destid 21 --sendCount 10 --receiveCount 10 -m \"Hello from 20, without E2E Encryption\"" + eval $CLIENTCMD >> $CLIENTOUT/client20.txt || true & + PIDVAL=$! + echo "$CLIENTCMD -- $PIDVAL" + CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceMessagePickupRetry --unsafe -l $CLIENTOUT/client21.log -s blob21 --sendid 21 --destid 20 --sendCount 10 --receiveCount 10 -m \"Hello from 21, without E2E Encryption\"" + eval $CLIENTCMD >> $CLIENTOUT/client21.txt || true & + PIDVAL2=$! + echo "$CLIENTCMD -- $PIDVAL" + wait $PIDVAL + wait $PIDVAL2 + + fi # Non-precanned E2E user messaging @@ -389,6 +402,18 @@ echo "$CLIENTCMD -- $PIDVAL" wait $PIDVAL wait $PIDVAL2 +echo "FORCING MESSAGE PICKUP RETRY... " +CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceMessagePickupRetry -l $CLIENTOUT/client20.log -s blob20 --sendid 20 --destid 21 --sendCount 10 --receiveCount 10 -m \"Hello from 20, without E2E Encryption\"" +eval $CLIENTCMD >> $CLIENTOUT/client20.txt || true & +PIDVAL=$! +echo "$CLIENTCMD -- $PIDVAL" +CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceMessagePickupRetry -l $CLIENTOUT/client21.log -s blob21 --sendid 21 --destid 20 --sendCount 10 --receiveCount 10 -m \"Hello from 21, without E2E Encryption\"" +eval $CLIENTCMD >> $CLIENTOUT/client21.txt || true & +PIDVAL2=$! +echo "$CLIENTCMD -- $PIDVAL" +wait $PIDVAL +wait $PIDVAL2 + # Single-use test: client53 sends message to client52; client52 responds with # the same message in the set number of message parts