Skip to content

Commit

Permalink
Comorb obliv-c
Browse files Browse the repository at this point in the history
  • Loading branch information
n1v0lg committed Feb 27, 2019
1 parent b080303 commit ddba287
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 191 deletions.
16 changes: 0 additions & 16 deletions benchmarks/comorb/obliv-c/conclave_gen.sh

This file was deleted.

93 changes: 0 additions & 93 deletions benchmarks/comorb/obliv-c/data_gen.py

This file was deleted.

14 changes: 0 additions & 14 deletions benchmarks/comorb/obliv-c/run.sh

This file was deleted.

52 changes: 0 additions & 52 deletions benchmarks/comorb/obliv-c/workload.py

This file was deleted.

8 changes: 7 additions & 1 deletion benchmarks/comorb/run.sh
Expand Up @@ -2,13 +2,19 @@

PARTY_ID=$1
SIZE=$2
BACKEND=$3
DATA_ROOT_DIR=comorb_data/conclave/${SIZE}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -z ${BACKEND} ]
then
BACKEND=sharemind
fi

# clean up data first
find /mnt/shared/${DATA_ROOT_DIR} \
-type f -not -name left_diagnosis.csv -not -name right_diagnosis.csv \
-print0 | xargs -0 rm --;

# run query
time python ${DIR}/workload.py ${PARTY_ID} ${DATA_ROOT_DIR}
time python ${DIR}/workload.py ${PARTY_ID} ${DATA_ROOT_DIR} ${BACKEND}
41 changes: 26 additions & 15 deletions benchmarks/comorb/workload.py
Expand Up @@ -3,7 +3,7 @@

import conclave.lang as cc
from conclave import generate_code, dispatch_jobs
from conclave.config import CodeGenConfig, SharemindCodeGenConfig
from conclave.config import CodeGenConfig, SharemindCodeGenConfig, OblivcConfig, NetworkConfig
from conclave.utils import defCol


Expand All @@ -24,28 +24,39 @@ def protocol():
return {left_diagnosis, right_diagnosis}


if __name__ == "__main__":
def main():
pid = sys.argv[1]
data_root = sys.argv[2]
print(data_root)
mpc_backend = sys.argv[3]

# define name for the workflow
workflow_name = "aspirin-large-join-" + pid + "-" + data_root
# configure conclave
conclave_config = CodeGenConfig(workflow_name, int(pid))
conclave_config.network_config = {
"pid": int(pid),
"parties": {
1: {"host": "ca-spark-node-0", "port": 9001},
2: {"host": "cb-spark-node-0", "port": 9002},
3: {"host": "cc-spark-node-0", "port": 9003}
}
}
conclave_config.use_leaky_ops = False
sharemind_conf = SharemindCodeGenConfig("/mnt/shared", use_docker=True, use_hdfs=False)
conclave_config.with_sharemind_config(sharemind_conf)
if mpc_backend == "sharemind":
sharemind_conf = SharemindCodeGenConfig("/mnt/shared", use_docker=True, use_hdfs=False)
conclave_config.with_sharemind_config(sharemind_conf)
elif mpc_backend == "obliv-c":
conclave_config.all_pids = [1, 2]
net_conf = [
{"host": "ca-spark-node-0", "port": 8001},
{"host": "cb-spark-node-0", "port": 8002}
]
net = NetworkConfig(net_conf, int(pid))
conclave_config.with_network_config(net)

oc_conf = OblivcConfig("/obliv-c/bin/oblivcc", "ca-spark-node-0:9000")
conclave_config.with_oc_config(oc_conf)
else:
raise Exception("Unknown MPC backend {}".format(mpc_backend))

conclave_config.code_path = os.path.join("/mnt/shared", workflow_name)
conclave_config.input_path = os.path.join("/mnt/shared", data_root)
conclave_config.output_path = os.path.join("/mnt/shared", data_root)

job_queue = generate_code(protocol, conclave_config, ["sharemind"], ["python"], apply_optimizations=True)
job_queue = generate_code(protocol, conclave_config, [mpc_backend], ["python"], apply_optimizations=True)
dispatch_jobs(job_queue, conclave_config)


if __name__ == "__main__":
main()

0 comments on commit ddba287

Please sign in to comment.