A way to choose things.
In order to build you need
goinstalled.
You will need go1.7.1 if you are deploying to kubernetes.
To build choices library and all the included binaries run the following in a terminal.
go get -u github.com/Nordstrom/choices/...If you are only interested in the library you can run the following in a terminal.
go get -u github.com/Nordstrom/choicesThere are two main components of choices. The storage server (bolt-store or mongo-store) and the frontend experiment server (elwin). You should first start the storage server. You will need a local version of running, bolt-store will be the easiest to setup. It only requires a local file similar to sqlite.
cd bolt-store && go build
./bolt-storeYou can skip to starting the experiment server if you are using the bolt-store.
If you want to use mongo refer to this guide Mongo Installation. If you are using docker you can run the following docker cmd.
docker run -d --name mongo-storage -p 27017:27017 mongoWith mongo running you can start the storage server.
# from the choice/cmd/mongo-store directory run
./mongo-storeThis creates the storage service on port 8080
Now that the storage server is up you can start the experiment server (elwin).
# from the choices/cmd/elwin directory run
JSON_ADDRESS=":8181" GRPC_ADDRESS=":8282" MONGO_ADDRESS="localhost:8080" MONGO_DATABASE="elwin" MONGO_COLLECTION="staging" ./elwinThe
MONGO_ADDRESSMONGO_DATABASEandMONGO_COLLECTIONare an artifact of previously only supporting mongo. These may change in an upcoming version.
The experiment store loads some example data into the staging environment.
You should be able to open a web browser and navigate to
localhost:8181?label=test&userid=1234 and see some results. You can also run
the following command from a terminal if you have curl installed.
The
bolt-storedoes not load sample data.
curl "localhost:8181?label=test&userid=1234"