Skip to content

Commit

Permalink
Add docker-compose examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jimouris committed Nov 2, 2023
1 parent 592fafe commit 4998e81
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ Each protocol involves two (or more) parties and they have to be run in their ow

Run the script at etc/example/generate_cert.sh to generate dummy_certs directory if you want to test protocol with TLS on local.

### Build With Docker
### Build & Run With Docker Compose
The following, run each party in a different container:
* Private-ID: `docker compose --profile private-id up`
* Delegated Private Matching for Compute (DPMC): `docker compose --profile dpmc up`
* Delegated Private Matching for Compute with Secure Shuffling (DSPMC): `docker compose --profile dspmc up`

Build the Docker image:
```bash
docker build -t private-id .
```
By default, this will create datasets of 10 items each. To run with bigger datasets set the `ENV_VARIABLE_FOR_SIZE` environment variable. For example: `ENV_VARIABLE_FOR_SIZE=100 docker compose --profile dpmc up` will run DPMC with datasets of 100 items each.

## Private-ID

Expand Down
231 changes: 231 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
version: '3.0'

services:

# Datagen

datagen:
container_name: 'datagen'
profiles: ['private-id', 'dpmc', 'dspmc']
build:
context: .
entrypoint:
- '/opt/private-id/bin/datagen'
command: '--size ${ENV_VARIABLE_FOR_SIZE:-10} --cols 1 --features -d /etc/example/'
volumes:
- './common/datagen:/etc/example/'

# Private-ID

private-id-server:
container_name: 'private-id-server'
profiles: ['private-id']
depends_on:
datagen:
condition: service_completed_successfully
build:
context: .
entrypoint: '/opt/private-id/bin/private-id-server'
command: >-
--host 0.0.0.0:10009
--input /etc/example/private-id/company.csv
--stdout
--no-tls
environment:
- 'RUST_LOG=info'
volumes:
- './common/datagen/input_a_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1.csv:/etc/example/private-id/company.csv'

private-id-client:
container_name: 'private-id-client'
profiles: ['private-id']
depends_on:
datagen:
condition: service_completed_successfully
private-id-server:
condition: service_started
build:
context: .
entrypoint: '/opt/private-id/bin/private-id-client'
command: >-
--company company-host:10009
--input /etc/example/private-id/partner.csv
--stdout
--no-tls
environment:
- 'RUST_LOG=info'
links:
- 'private-id-server:company-host'
volumes:
- './common/datagen/input_b_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1.csv:/etc/example/private-id/partner.csv'

# DPMC

dpmc-company-server:
container_name: 'dpmc-company-server'
profiles: ['dpmc']
depends_on:
datagen:
condition: service_completed_successfully
build:
context: .
entrypoint: '/opt/private-id/bin/dpmc-company-server'
command: >-
--host 0.0.0.0:10010
--input /etc/example/dpmc/company.csv
--stdout
--output-shares-path /etc/example/dpmc/output_company
--no-tls
environment:
- 'RUST_LOG=info'
volumes:
- './common/datagen/input_a_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1.csv:/etc/example/dpmc/company.csv'

dpmc-partner-server:
container_name: 'dpmc-partner-server'
profiles: ['dpmc']
depends_on:
datagen:
condition: service_completed_successfully
dpmc-company-server:
condition: service_started
build:
context: .
entrypoint: '/opt/private-id/bin/dpmc-partner-server'
command: >-
--host 0.0.0.0:10020
--company company-host:10010
--input-keys /etc/example/dpmc/partner_1.csv
--input-features /etc/example/dpmc/partner_1_features.csv
--no-tls
environment:
- 'RUST_LOG=info'
links:
- 'dpmc-company-server:company-host'
volumes:
- './common/datagen/input_b_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1.csv:/etc/example/dpmc/partner_1.csv'
- './common/datagen/input_b_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1_features.csv:/etc/example/dpmc/partner_1_features.csv'

dpmc-helper:
container_name: 'dpmc-helper'
profiles: ['dpmc']
depends_on:
datagen:
condition: service_completed_successfully
dpmc-company-server:
condition: service_started
dpmc-partner-server:
condition: service_started
build:
context: .
entrypoint: '/opt/private-id/bin/dpmc-helper'
command: >-
--company company-host:10010
--partners partner-host:10020
--stdout --output-shares-path /etc/example/dpmc/output_partner
--no-tls
environment:
- 'RUST_LOG=info'
links:
- 'dpmc-company-server:company-host'
- 'dpmc-partner-server:partner-host'
volumes:
- './etc/example/dpmc/:/etc/example/dpmc/'

# DsPMC

dspmc-helper-server:
container_name: 'dspmc-helper-server'
profiles: ['dspmc']
depends_on:
datagen:
condition: service_completed_successfully
build:
context: .
entrypoint: '/opt/private-id/bin/dspmc-helper-server'
command: >-
--host 0.0.0.0:10030
--stdout
--output-shares-path /etc/example/dspmc/output_helper
--no-tls
environment:
- 'RUST_LOG=info'
volumes:
- './etc/example/dspmc/:/etc/example/dspmc/'

dspmc-company-server:
container_name: 'dspmc-company-server'
profiles: ['dspmc']
depends_on:
datagen:
condition: service_completed_successfully
dspmc-helper-server:
condition: service_started
build:
context: .
entrypoint: '/opt/private-id/bin/dspmc-company-server'
command: >-
--host 0.0.0.0:10010
--helper helper-host:10030
--input /etc/example/dspmc/company.csv
--stdout
--output-shares-path /etc/example/dspmc/output_company --no-tls
environment:
- 'RUST_LOG=info'
links:
- 'dspmc-helper-server:helper-host'
volumes:
- './common/datagen/input_a_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1.csv:/etc/example/dspmc/company.csv'

dspmc-partner-server:
container_name: 'dspmc-partner-server'
profiles: ['dspmc']
depends_on:
datagen:
condition: service_completed_successfully
dspmc-company-server:
condition: service_started
build:
context: .
entrypoint: '/opt/private-id/bin/dspmc-partner-server'
command: >-
--host 0.0.0.0:10020
--company company-host:10010
--input-keys /etc/example/dspmc/partner_1.csv
--input-features /etc/example/dspmc/partner_1_features.csv
--no-tls
environment:
- 'RUST_LOG=info'
links:
- 'dspmc-company-server:company-host'
volumes:
- './common/datagen/input_b_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1.csv:/etc/example/dspmc/partner_1.csv'
- './common/datagen/input_b_size_${ENV_VARIABLE_FOR_SIZE:-10}_cols_1_features.csv:/etc/example/dspmc/partner_1_features.csv'

dspmc-shuffler:
container_name: 'dspmc-shuffler'
profiles: ['dspmc']
depends_on:
datagen:
condition: service_completed_successfully
dspmc-company-server:
condition: service_started
dspmc-helper-server:
condition: service_started
dspmc-partner-server:
condition: service_started
build:
context: .
entrypoint: '/opt/private-id/bin/dspmc-shuffler'
command: >-
--company company-host:10010
--helper helper-host:10030
--partners partner-host:10020
--stdout
--no-tls
environment:
- 'RUST_LOG=info'
links:
- 'dspmc-helper-server:helper-host'
- 'dspmc-company-server:company-host'
- 'dspmc-partner-server:partner-host'

0 comments on commit 4998e81

Please sign in to comment.