This repository is a sample of how to locally run Azure's Bidding and Auction Servers implementation.
This code is maintained by Google with contributions from Microsoft to support running in Azure. It also depends on another Google maintained repository with Microsoft contributions called Data Plane Shared Libraries.
It depends on the Azure Privacy Sandbox Key Management Service (KMS), which is written by Microsoft, and based on the Confidential Consortium Framework (CCF).
Here are three simple ways to setup an environment for running the demo, in order of the preferred options:
Opening in a codespace will automatically have all required dependencies, we recommend using larger containers as building the Bidding and Auction server code is slow.
Opening the repository in the devcontainer will also automatically have all required dependencies
Install the dependencies and proceed with the subsequent instructions below.
./scripts/install_dependencies_vm.sh
To setup a directory with the B&A and KMS code, run setup.sh.
./scripts/setup.sh
This does the following:
- Installs CCF
- Checks out the Key Management System
- Checks out the Microsoft fork of the Bidding and Auction Servers and the Data Plane Shared Libraries
NOTE: These repositories are checked out with HTTP and are therefore read only. To have write access, change the remote to SSH and setup your key as usual.
Name | Default | Description |
---|---|---|
DEMO_WORKSPACE |
./workspaces/demo |
Path to the directory where setup.sh will checkout the KMS and B&A code |
CCF_VERSION |
5.0.0-dev10 |
Version of CCF to run the KMS against |
KMS_REV |
main |
Revision of the KMS to checkout |
BA_REV |
main |
Revision of the B&A Services to checkout |
DATA_PLANE_REV |
main |
Revision of the Data Plance Shared Libraries to checkout |
To build the demo, run build.sh. If you're running inside a VM, it takes a few hours for the first build, subsequent builds will be faster as it's cached.
./scripts/build.sh
This builds the KMS and the Bidding and Auction server code. On a 32 core machine it takes ~30 minutes. You can setup a remote Bazel cache to speed up builds on multiple machines.
Name | Default | Description |
---|---|---|
DEMO_WORKSPACE |
./workspaces/demo |
Path to the directory where the KMS and B&A code to be built is |
USE_CBUILD |
1 |
Whether to use CBuild for building B&A Services, uses local Bazel if not 1 |
Bidding and Auction server code defaults to using CBuild to avoid manual dependency setup. The devcontainer and by extension codespace set this to 0 as Cbuild doesn't work inside a container.
To run the B&A servers and the KMS, run run.sh.
./scripts/run.sh
This runs the KMS and the Bidding and Auction servers. While this is running you can issue requests in a second terminal.
Name | Default | Description |
---|---|---|
DEMO_WORKSPACE |
./workspaces/demo |
Path to the directory where the KMS and B&A code to be run is |
You can issue requests with request.sh.
./scripts/request.sh
# Example requests
TARGET_SERVICE=bfe REQUEST_PATH=requests/get_bids_request.json ./scripts/request.sh
TARGET_SERVICE=sfe REQUEST_PATH=requests/select_ads_request.json ./scripts/request.sh
Name | Default | Description |
---|---|---|
DEMO_WORKSPACE |
./workspaces/demo |
Path to the directory where the running KMS and B&A code is |
TARGET_SERVICE |
bfe |
The service to send the request to |
REQUEST_PATH |
requests/get_bids_request.json |
The path to the request to send (relative to repository root) |
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.