Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

google/trusted-worklet-server

Aviary

Disclaimer

This is not an officially supported Google product.

Teams from across Google, including Ads teams, are actively engaged in industry dialog about new technologies that can ensure a healthy ecosystem and preserve core business models. Online discussions (e.g. on GitHub) of technology proposals should not be interpreted as commitments about Google ads products.

Overview

This code provides a server that can run JavaScript bidding and ad scoring functions, as specified in the FLEDGE explainer. The idea is to experiment with moving evaluation of JS from on-device to a server instead.

Discussions of how to add trust to the server are not covered here, see.

Configuring bidding functions

Bidding functions are currently statically configured in a server/sample_configuration.yaml file that gets built into the container. Edit the file to add or change the bidding function that Aviary should be able to run, for example:

biddingFunctions:
  squaring: |
    (function(inputs) { return inputs.perBuyerSignals.contextualCpm * return inputs.perBuyerSignals.contextualCpm; })

Local development

Development environment

In order to be able to build and run Aviary locally, a number of tools need to be installed on the local machine.

  1. Install Python and golang.

  2. Run setup.sh convenience script to set up the local development environment. It performs the following steps:

Building Aviary

An Aviary server is built as a Docker container.

One can build it with:

bazelisk run //server:aviary

or, if you're not using Bazelisk:

bazel run //server:aviary

Running Aviary locally

You can run Aviary locally with Docker and bind to a chosen local HTTP port:

export PORT=8080; docker run -p ${PORT}:${PORT} -e PORT=${PORT} bazel/server:aviary

To test that Aviary is running, we can send a request to invoke a simple bidding function that doubles the value from perBuyerSignals:

curl -X POST http://localhost:8080/v1alpha/adAuctions:computeBid -d '{"biddingFunctionName": "doubling","input": {"perBuyerSignals": {"contextualCpm": 1.23}}}' -H "Content-type: application/json"
{
 "bid": 2.46
}

Maintenance

This code is published so that it‘s possible for anyone to re-run the experiments that we’re doing. This code will not be supported once the experimentation is complete.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published