Local developer console for Bidding and Auction Services
TL;DR:
- Install prerequisites
- Setup repositories
- Build the services
- Build and start the local companion app
- Start the services
- ???
- $$$
Use a linux local machine, or provision a linux VM of the cloud provider of your choice. Note that we will be connecting to http://localhost:3000 of this machine. If the VM does not provide a GUI, then make sure the port is accessible to your local machine so you can connect to it.
# Install Docker
> curl -fsSL https://get.docker.com -o get-docker.sh
> sudo sh get-docker.sh
# Setup sudo-less Docker
> sudo groupadd docker
> sudo usermod -aG docker $USER
> newgrp docker
# Test
> docker run hello-world
With the sudo-less setup, the docker group grants root-level privileges to the user. Read the sudo-less Docker guide to learn more.
The following commands installs node
using nvm
:
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
> nvm install --lts
> node -v
Doc: Detailed nvm
installation instruction
For our demo, we will be using two stacks of B&A to simulate auctions involving multiple buyers and sellers.
> git clone https://github.com/privacysandbox/bidding-auction-servers.git bidding-auction-servers-1
> git clone https://github.com/privacysandbox/bidding-auction-servers.git bidding-auction-servers-2
This is a temporary step that won't be necessary in 4.5+ release in the future
There are some changes we need to the B&A code to allow the local companion app to run. The changes in this patch will be included in a future B&A release, and the patch will not be necessary then.
We will use the 4.3 release.
- Download the patch and place it in the B&A repository folder
- Apply the patch in Stack 1 repository (in the
bidding-auction-servers-1
folder)
> cd bidding-auction-servers-1
> git checkout release-4.3
> curl https://raw.githubusercontent.com/privacysandbox/bidding-auction-local-console/refs/heads/main/resources/stack-1.patch > stack.patch
> git apply stack.patch
> git status
- Apply the patch in Stack 2 repository (in the
bidding-auction-servers-2
folder). This is a different patch from the stack 1 patch.
> cd ../bidding-auction-servers-2
> git checkout release-4.3
> curl https://raw.githubusercontent.com/privacysandbox/bidding-auction-local-console/refs/heads/main/resources/stack-2.patch > stack.patch
> git apply stack.patch
> git status
Execute the following command from the root of each stack's repository to build the services:
./production/packaging/build_and_test_all_in_docker \
--service-path bidding_service \
--service-path auction_service \
--service-path buyer_frontend_service \
--service-path seller_frontend_service \
--platform gcp \
--instance local \
--no-precommit \
--no-tests \
--build-flavor non_prod \
--gcp-skip-image-upload
This step may take up to 3 hours on an 8-core machine and an hour on a 32-core machine (Sorry! We are working on improving this process!).
Pull and build the service:
> git clone https://github.com/privacysandbox/bidding-auction-local-dev-console.git
> cd bidding-auction-local-dev-console
> ./setup
Start the service:
> ./start
Start Chrome from the command line with the following flags:
google-chrome --enable-privacy-sandbox-ads-apis --disable-features=EnforcePrivacySandboxAttestations,FledgeEnforceKAnonymity --enable-features=FledgeBiddingAndAuctionServerAPI,FledgeBiddingAndAuctionServer:FledgeBiddingAndAuctionKeyURL/https%3A%2F%2Fstorage.googleapis.com%2Fba-test-buyer%2Fcoordinator-test-key.json
Make sure you have fully exited out of all Chrome instances before opening it from the command line with the B&A flags.
Visit the UI at http://localhost:3000 or your VM's address and :3000
.
Execute each command in a separate terminal window.
Run the following commands in root folder of the first B&A Stack
BIDDING_JS_URL="https://192.168.84.100:5003/generate-bid.js" \
./tools/debug/start_bidding
BUYER_KV_SERVER_ADDR="https://192.168.84.100:5003/kv" \
./tools/debug/start_bfe
AUCTION_JS_URL="https://192.168.84.100:6002/score-ad.js" \
./tools/debug/start_auction
SELLER_ORIGIN_DOMAIN="https://localhost:6002" \
KEY_VALUE_SIGNALS_HOST="https://192.168.84.100:6002/kv" \
./tools/debug/start_sfe
Run the following commands in root folder of the second B&A Stack
BIDDING_JS_URL="https://192.168.84.100:5004/generate-bid.js" \
./tools/debug/start_bidding
BUYER_KV_SERVER_ADDR="https://192.168.84.100:5004/kv" \
./tools/debug/start_bfe
AUCTION_JS_URL="https://192.168.84.100:6003/score-ad.js" \
./tools/debug/start_auction
SELLER_ORIGIN_DOMAIN="https://localhost:6003" \
KEY_VALUE_SIGNALS_HOST="https://192.168.84.100:6003/kv" \
./tools/debug/start_sfe
SSP-TOP
- The top-level sellerSSP-X
- B&A-only sellerSSP-Y
- B&A + on-device (mixed-mode) sellerSSP-O
- On-device-only sellerDSP-A
andDSP-B
- On-device buyersDSP-X
andDSP-Y
- B&A buyers
The demo runs the following set of auctions:
- On-device single-seller auction with
SSP-O
,DSP-A
, andDSP-B
- B&A single-seller auction with
SSP-X
,DSP-X
, andDSP-Y
- B&A single-seller mixed-mode auction with
SSP-Y
,DSP-X
,DSP-Y
,DSP-A
, andDSP-B
- B&A multi-seller auction by
SSP-TOP
with:SSP-O
- on-device component auctionSSP-X
- B&A-only component auctionSSP-Y
- mixed-mode component auction
- App UI - https://localhost:3000 / https://192.168.84.100:3000
- SSP-TOP - https://localhost:4001 / https://192.168.84.100:4001
- SSP-X - https://localhost:4002 / https://192.168.84.100:4002
- SSP-Y - https://localhost:4003 / https://192.168.84.100:4003
- SSP-O - https://localhost:4004 / https://192.168.84.100:4004
- DSP-A - https://localhost:5001 / https://192.168.84.100:5001
- DSP-B - https://localhost:5002 / https://192.168.84.100:5002
- DSP-X - https://localhost:5003 / https://192.168.84.100:5003
- DSP-Y - https://localhost:5004 / https://192.168.84.100:5004