How to run a local instance of the Open Bidder UI
If you made changes to the Open Bidder UI, you may want to run a local instance of it for testing purposes. In order to do so, run the following command:
mvn -pl open-bidder-ui appengine:devserver
Then access the local Open Bidder UI at:
How to run a local bidding instance
In order to avoid being charged for usage, we recommend that testing be performed in a local development environment rather than on Google Compute Engine.
The Open Bidder project includes shell scripts to facilitate
testing. If you have not done so already, you should create an
OPENBIDDER_HOME environment variable that points to the
installation directory of the Open Bidder project—this will
make it easier for you to access these scripts from your own project. In
this guide, we will create a simple wrapper script for
maven-run-bidder.sh that provides the necessary
arguments for running your bidder server with a provided set of
By default, maven-run-bidder.sh is configured to run
the open-bidder-samples-binary project with the main
SamplesServer. Below is an example of a wrapper script
that you might use to modify this behavior:
#!/bin/bash # # Wrapper script for maven-run-bidder.sh that configures it to run with our # own main module and other parameter defaults. sh $OPENBIDDER_HOME/bin/maven-run-bidder.sh -module example-binary \ -main com.example.ExampleServer \ --bid_interceptors=com.example.MyBidInterceptor1,com.example.MyBidInterceptor2 \ --click_interceptors=com.example.MyClickInterceptor \ --impression_interceptors=com.example.MyImpressionInterceptor
In the wrapper script above, we run
maven-run-bidder.sh with arguments that will configure
the bidder server, such as which interceptors we want to use and the
binary module and its main class. You can also set the environment variable
OPENBIDDER_ARGS with common parameters that will be be used
in every call to that script.
Open Bidder supports a long list of command-line parameters, almost all
are optional or have sensible defaults. The major exception is the
platform configuration, where "platform" is itself a parameter:
Google Compute means a GCP instance, and Generic (the default) is anything
else (including other cloud platforms without special support from
Open Bidder; Amazon EC2 was tested, anything with JDK 8 should work).
The table below explains the platform-dependent parameters; for others,
run maven-run-bidder.sh --platform=XXX --help.
||(GOOGLE_CLOUD, required) To get the GCE project ID:
||(GOOGLE_CLOUD, required)To get the GCE numeric project ID:
||(GENERIC, optional) To get the service account ID (email address):
||(GENERIC, optional) To generate the file (you must be the project owner):
Run the bidder
Now that we've prepared our bidder server and created our wrapper script for maven-run-bidder.sh—which we'll arbitrarily name "run-bidder.sh" and place in a directory named bin in our project's root directory— we can run our bidder with the following command from within our project's root directory:
When you run this script,
ExampleServer will be started with
the parameters you provided.
Running a complex project
If you want to quickly try out a non-trivial bidder server project, a
good place to start is open-bidder-samples-binary.
This project configures a bidder server such that it can use the
interceptors from open-bidder-samples and
maven-run-bidder.sh defaults to running
open-bidder-samples-binary, we only need to specify
the command-line arguments we'd like to pass to our bidder server.
Assuming that you have already defined
you could start the bidder server by entering the following in the root
directory of the Open Bidder project:
bin/maven-run-bidder.sh \ --bid_interceptors=com.google.openbidder.bidding.interceptor.ConfigurableBidInterceptor \ --configbid_url=https://wikipedia.org --configbid_snippet=src/main/config/samplesnippet-simple.html
The code above will configure
SamplesServer to run using
ConfigurableBidInterceptor. If you look to the
SamplesModule, you'll notice that the other arguments are
being used to configure the interceptor with JCommander.