-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Welcome to the Sequre wiki!
Sequre is an end-to-end, statically compiled and performance-engineered, Pythonic framework for building efficient secure multiparty computation (MPC) pipelines in bioinformatics.
Sequre can only be built from source at the moment. To install Sequre, first clone the repository:
git clone git@github.com:0xTCG/sequre.git && cd sequreAnd then run the install script:
scripts/install.shThis will:
- Clone and install a version of Seq that contains Sequre-related intermediate representation (IR) transformations.
- Build the source for both Seq and Sequre.
Execute
scripts/run.sh playground --localto run the sample code from playground.codon that contains the benchmarks from Hastings et al..
This run will execute the code in a local, single machine, environment over inter-process communication channels (AF_UNIX). For running the codebase in a different environment, see run instructions.
Use ./sequre script to execute Sequre both on server and client end.
Server run command: (<pid> denotes the ID of the computing party: 0, 1, 2, 3, ...)
./sequre foo.codon <pid>Client run command:
./sequre bar.codonSee the example for a sample run at the localhost.
The example folder contains the running example of a typical multiparty computation use-case in Sequre. It implements a secure variant of PlassClass---a binary classification tool for distinguishing whether a genomic sequence originates from a plasmid sequence or a chromosomal segment.
Folder contains:
-
client.codon- Local source code executed by each client (data owner) locally. It contains a data processing step, followed by a secret sharing routine that initiates secure computing on the servers. -
server.codon- Online source code executed by each untrusted computing party. It contains a data pooling routine that gathers the secret-shared data from the clients and conducts secure training of a linear support vector machine on top of it.
To run the example locally, execute example/server.codon in a separate terminal for each computing party <pid>:
./sequre example/server.codon <pid>Finally, initiate the secret sharing of the data and, consequentially, secure training on top of it by running the client's code:
./sequre example/client.codonExample (condensed into a single terminal for simplicity):
./sequre example/server.codon 0 & \
./sequre example/server.codon 1 & \
./sequre example/server.codon 2 & \
./sequre example/client.codonNote: Expect obfuscated output (and possibly some minor warning messages) if running in a single terminal. Each party will output the results into the same terminal.
To run the same procedure on multiple machines, install Sequre and reconfigure the network within Sequre's settings file at each machine separately.
Example network configuration (dsl/settings.codon --- the IP addresses are fictional):
# IPs
TRUSTED_DEALER = '8.8.8.8' # Trusted dealer
COMPUTING_PARTIES = [
'9.9.9.9', # First computing party (CP1)
'10.10.10.10' # Second computing party (CP2)
]Then at 8.8.8.8 run
./sequre example/server.codon 0At 9.9.9.9 run:
./sequre example/server.codon 1At 10.10.10.10 run:
./sequre example/server.codon 2And finally, at your client's machine, run:
./sequre example/client.codonNote: Make sure to set the same network settings (IP addresses) at each computing party, including the client.
Sequre can operate in two network modes:
- Local: using the inter-process communication (AF_UNIX) sockets.
- Online: using the TCP (AF_INET) sockets.
If using the online mode, make sure to configure the network within Sequre's settings file at each machine separately.
Example network configuration (dsl/settings.codon --- the IP addresses are fictional):
# IPs
TRUSTED_DEALER = '8.8.8.8' # Trusted dealer
COMPUTING_PARTIES = [
'9.9.9.9', # First computing party (CP1)
'10.10.10.10' # Second computing party (CP2)
]Note: ./sequre command operates only in an online setup at the moment.
For running tests, benchmarks, and playground, we recommend using the scripts/run.sh script:
srcipts/run.sh <program> [<pid>] [--local] [--use-ring] [--unit]where:
-
<program>is eithertests,benchmarks, orplayground. -
<pid>is optional ID of computing party if the run is online. -
--localflag triggers the local run, intead of online, using the inter-process communication instead of TCP. Note:<pid>is ignored if the--localflag is present. -
--use-ringflag coerces usage of$2^k$ rings for MPC subroutines that are generally faster but introduce a slight inaccuracy ($\pm 1/2^{20}$ ) to the fixed-point arithmetic. Without the flag, Sequre defaults to a finite field instead. Note:--use-ringis ignored while running tests. Tests are executed on both rings and fields. -
--unitflag restricts the tests to unit test only. By default, both unit and end-to-end tests of applications (GWAS, DTI, Opal, and Ganon) are executed.
Example invocation of unit tests in a localhost in an online network environment: (use multiple terminals for clear output)
srcipts/run.sh tests --unit 0 & \
srcipts/run.sh tests --unit 1 & \
srcipts/run.sh tests --unit 2Note: Each run bellow is executed in a local setup. Online run is also possible. See example above for a step-by-step guide and/or Sequre's network config for details.
Playground contains the three MPC benchmarks from Hastings et al.. Use it to quickly explore Sequre and its features.
Example invocation:
scripts/run.sh playground --local --use-ringTo run all unit tests execute:
scripts/run.sh tests --unit --localThis will execute all unit tests locally, on a single machine.
Drop the --unit flag to include the end-to-end tests for genome-wide association study, drug-target interaction inference, and metagenomic classifiers as well:
scripts/run.sh tests --localTo benchmark all applications run:
scripts/run.sh benchmarks --localInclude --use-ring flag to re-run all benchmarks on rings instead of fields:
scripts/run.sh benchmarks --local --use-ringThis will benchmark the following applications in Sequre:
- Sequre's linear algebra subroutines
- Genome-wide association study on top of a toy dataset from Cho et al..
- Drug-target inference on top of a reduced STITCH dataset from Hie et al..
- Opal (metagenomic binning) with 0.1x and 15x coverage of the complete Opal dataset from Yu et al.
- Ganon (metagenomic binning) on top of a single read from the complete Opal dataset from Yu et al.
Benchmark results are stored in the results folder.
Sequre v0.0.1-alpha