This project integrates DPolicy with the Cohere DP Management System, featuring a simplified Cohere DP Planner.
This adapted planner exclusively supports the DPK resource allocation algorithm.
A key addition is the cohere-dpolicy/dp-planner/src/measure_traps.rs Rust binary, which analyzes the Cohere simulation results to calculate privacy loss for specific subcomponents (e.g., releases accessing a specific attribute).
Crucially, it considers parallel composition via partitioning attributes.
To get a local copy up and running follow these simple steps.
-
Installed
curl,git, andm4:sudo apt-get install curl git m4 -
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Gurobi The dp-planner relies on Gurobi for solving resource allocation problems, which requires a Gurobi license. Free academic licenses can be obtained from the following link: https://www.gurobi.com/downloads/end-user-license-agreement-academic/ The acquired license keys still need to be activated on the designated machine with
grbgetkey. -
Local clone of the repository (with submodules)
git clone --recurse-submodules git@github.com:pps-lab/dpolicy.git
-
Install Rust Version 1.65:
rustup install 1.65 && rustup override set 1.65
-
Install Gurobi Version 9.5.1
For Ubuntu 22.04 LTS:
curl -o gurobi951.tar.gz https://packages.gurobi.com/9.5/gurobi9.5.1_linux64.tar.gz
sudo tar -xzf gurobi951.tar.gz -C /opt
Gurobi should now be installed under:
/opt/gurobi951 -
Build the DP-Planner:
cargo build --release
-
Set your current working directory to the directory containing this
README.mdfile. -
Execute the following command. You may need to adjust the path specified in the
$OUT_DIRenvironment variable (or others) at the beginning of the command to match your system setup.
export \
GUROBI_HOME=/opt/gurobi951/linux64 \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gurobi951/linux64/lib \
DATA_DIR=./dp-planner/resources/applications/minimal \
OUT_DIR=./../doe-suite-results-super-reproduce/minimal \
RUST_LOG=info \
CACHE_REQUEST_COST=1; \
mkdir -p $OUT_DIR && \
cargo run --release --bin dp_planner -- \
--schema $DATA_DIR/schema.json \
--requests $DATA_DIR/requests_0.json \
--blocks $DATA_DIR/blocks_0.json \
--req-log-output $OUT_DIR/request_log.csv \
--round-log-output $OUT_DIR/round_log.csv \
--runtime-log-output $OUT_DIR/runtime_log.csv \
--stats-output $OUT_DIR/stats.json \
simulate --timeout-rounds 1 \
efficiency-based --block-selector-seed 1000 dpk --eta 0.05 --kp-solver gurobi \
block-composition-pa --num-threads 4 \
unlocking-budget --trigger round --slack 0.4 --n-steps 12 \
--alphas 1.5 1.75 2 2.5 3 4 5 6 8 16 32 64 1e6 1e10 \
--convert-block-budgets \
&& cargo run --release --bin measure_traps -- \
--dir $OUT_DIR \
--privacy-unit user \
--alphas 1.5 1.75 2 2.5 3 4 5 6 8 16 32 64 1e6 1e10 --delta 1.0e-7
This command runs a minimal simulation locally. The raw results will be written to the directory specified by the $OUT_DIR variable you set in the command.
Additional command examples are available from DPolicy's evaluation (configuration). All the commands can be listed by executing the commands below from the root directory of the repository. Please note that for these commands, it is necessary to update the file paths (schema, requests, blocks, ...) to match your local environment.
List all commands for the context scenario:
make cmd-contextList all commands for the scope scenario:
make cmd-scopeList all commands for the time-based privacy unit scenario:
make cmd-timeunit