Name: wasabi
Owner: Clever
Description: Wasabi A/B Testing Service is a real-time, enterprise-grade, 100% API driven project.
Forked from: intuit/wasabi
Created: 2017-11-29 19:50:54.0
Updated: 2017-11-29 19:51:00.0
Pushed: 2017-11-28 10:11:51.0
Size: 19188
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Support:
Documentation: User Guide, JavaDocs
A/B Testing Overview:
Continuous Integration:
License:
Wasabi A/B Testing Service is a real-time, enterprise-grade, 100% API driven project. Users are empowered to own their own data, and run experiments across web, mobile, and desktop. It?s fast, easy to use, it?s chock full of features, and instrumentation is minimal.
Learn more about how Wasabi can empower your team to move from hunches to actionable, data-driven user insights with our simple, flexible, and scalable experimentation platform.
The following steps will help you install the needed tools, then build and run a complete Wasabi stack.
sr/bin/ruby \
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
ew install git
t clone https://github.com/intuit/wasabi.git
wasabi
bin/wasabi.sh bootstrap
Installed tools include: homebrew 0.9, git 2, maven 3, java 1.8, docker 1.12, node 6 and python 2.7.
Bootstrapping on Ubuntu requires sudo privileges to install all the required dependencies. You will be prompted to enter your password. Currently only 16.04 (x64) is supported.
do apt-get install git
t clone https://github.com/intuit/wasabi.git
wasabi
bin/wasabi.sh bootstrap
do reboot
NOTE: A reboot is required after running the bootstrap command on Ubuntu.
For all other processes (build, start etc.) the commands are same for Ubuntu and Mac OS.
Installed tools include: git 2, maven 3, OpenJdk 8, docker 1.12, node 6 and python 2.7
Similar tooling will work for Windows. Contribute a patch :)
Now that we have the necessary tools in place, let's move on to build and start Wasabi, followed by issuing a ping command to verify the build:
bin/wasabi.sh build start
bi is operational:
: % open http://localhost:8080 note: sign in as admin/admin
ng: % curl -i http://localhost:8080/api/v1/ping
bug: attach to localhost:8180
rl -i http://localhost:8080/api/v1/ping
/1.1 200 OK
: Wed, 25 May 2016 00:25:47 GMT
plication-Id: wasabi-api-20151215171929-SNAPSHOT-development
ent-Type: application/json
sfer-Encoding: chunked
er: Jetty(9.3.z-SNAPSHOT)
omponentHealths":[
{
"componentName":"Experiments Cassandra",
"healthy":true
},
{
"componentName":"MySql","healthy":true
}
asabiVersion":"wasabi-api-20151215171929-SNAPSHOT-development"
Congratulations! You are the proud owner of a newly minted Wasabi instance. :)
rt CASSANDRA_MIGRATION=/location/of/cassandra-migration-0.9-jar-with-dependencies.jar
rt MIGRATION_SCRIPT=/location/of/modules/repository-datastax/src/main/resources/com/intuit/wasabi/repository/impl/cassandra/migration
H_VERSION=<version> CQLSH_USERNAME=<username> CQLSH_PASSWORD=<pwd> CQLSH_HOST=<host> bin/docker/migration.sh
L_HOST=<mysql_host> NODE_HOST=<cassandra_host> ./bin/wasabi.sh start:wasabi
BI_CONFIGURATION="
database.url.host=$MYSQL_HOST\
database.url.port=$MYSQL_PORT\
database.url.dbname=$MYSQL_DATABASE\
database.user=$MYSQL_USER\
database.password=$MYSQL_PASSWORD\
database.pool.connections.min=$MYSQL_MIN_CONNECTIONS\
database.pool.connections.max=$MYSQL_MAX_CONNECTIONS\
username=$CASSANDRA_USER\
password=$CASSANDRA_PASSWORD\
nodeHosts=$CASSANDRA_HOST\
tokenAwareLoadBalancingLocalDC=$CASSANDRA_DATACENTER\
application.http.port=$PORT" bash usr/local/wasabi-main-*/bin/run
While starting Wasabi, if you see an error when the docker containers are starting up, you could do the following:
Look at the current docker containers that have been successfully started.
bin/wasabi.sh status
AINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
458057ef wasabi-main "entrypoint.sh wasabi" 25 minutes ago Up 25 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:8090->8090/tcp, 0.0.0.0:8180->8180/tcp wasabi-main
cc885239 mysql:5.6 "docker-entrypoint.sh" 26 minutes ago Up 26 minutes 0.0.0.0:3306->3306/tcp wasabi-mysql
a96abdcb cassandra:2.1 "/docker-entrypoint.s" 27 minutes ago Up 27 minutes 7000-7001/tcp, 0.0.0.0:9042->9042/tcp, 7199/tcp, 0.0.0.0:9160->9160/tcp wasabi-cassandra
bin/wasabi.sh start:cassandra
bin/wasabi.sh start:wasabi
These are the 3 common REST endpoints that you will use to instrument your client application with Wasabi.
Let's assume that you've created and started an experiment, 'BuyButton,' in the 'Demo_App' application with the following buckets:
You can assign a user with a unique ID (e.g. 'userID1') to the experiment by making this HTTP request:
Assign a user to experiment and bucket:
rl -H "Content-Type: application/json" \
http://localhost:8080/api/v1/assignments/applications/Demo_App/experiments/BuyButton/users/userID1
cache":true,
payload":"green",
assignment":"BucketA",
context":"PROD",
status":"NEW_ASSIGNMENT"
Now the 'userID1' user is assigned into the 'BucketA' bucket. Let's further record an impression, meaning the user has seen a given experience:
Record an impression:
rl -H "Content-Type: application/json" \
-d "{\"events\":[{\"name\":\"IMPRESSION\"}]}" \
http://localhost:8080/api/v1/events/applications/Demo_App/experiments/BuyButton/users/userID1
If the 'userID1' user performs an action such as clicking the Buy button, you'd record that action with the following request:
Record an action:
rl -H "Content-Type: application/json" \
-d "{\"events\":[{\"name\":\"BuyClicked\"}]}" \
http://localhost:8080/api/v1/events/applications/Demo_App/experiments/BuyButton/users/userID1
The following developer resources are available:
API: Swagger API playground
bin/wasabi.sh resource:api
Javadoc
bin/wasabi.sh resource:doc
Wasabi UI
bin/wasabi.sh resource:ui
Cassandra: cqlsh shell
bin/wasabi.sh resource:cassandra
MySQL: mysql shell
bin/wasabi.sh resource:mysql
Java Debugger: Remote attach configuration
ntlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8180
Alas, all good things must come to an end. Let's clean things up a bit stop the newly created Wasabi stack:
At this point in time, we now have all the requisite tools installed, and subsequent invocations of Wasabi will start up much more quickly.
bin/wasabi.sh stop
Further, there are a number of additional wasabi.sh options available you should become familiar with:
bin/wasabi.sh --help
age: wasabi.sh [options] [commands]
tions:
-e | --endpoint [ host:port ] : api endpoint; default: localhost:8080
-v | --verify [ true | false ] : verify installation configuration; default: false
-s | --sleep [ sleep-time ] : sleep/wait time in seconds; default: 30
-h | --help : help message
mmands:
bootstrap : install dependencies
build : build project
start[:cassandra,mysql,wasabi] : start all, cassandra, mysql, wasabi
test : test wasabi
stop[:wasabi,cassandra,mysql] : stop all, wasabi, cassandra, mysql
resource[:ui,api,doc,cassandra,mysql] : open resource api, javadoc, cassandra, mysql
status : display resource status
remove[:wasabi,cassandra,mysql] : remove all, wasabi, cassandra, mysql
package : build deployable packages
release[:start,finish] : promote release
n package
bin/wasabi.sh start:cassandra,mysql
d modules/main/target; \
WASABI_CONFIGURATION="-DnodeHosts=localhost -Ddatabase.url.host=localhost" ./wasabi-main-*-SNAPSHOT-development/bin/run) &
rl -i http://localhost:8080/api/v1/ping
The runtime logs can be accessed executing the following command in a another shell:
Viewing runtime logs:
il -f modules/main/target/wasabi-main-*-SNAPSHOT-development/logs/wasabi-main-*-SNAPSHOT-development.log
modules/ui
unt build
ash
unt serve
bin/wasabi.sh stop
Now while that was fun, in all likelihood you will be using an IDE to work on Wasabi. In doing so, you need only add the configuration information above to the JVM commandline prior to startup:
Wasabi runtime configuration:
deHosts=localhost -Ddatabase.url.host=localhost
Code changes can readily be verified by running the growing collection of included integration tests:
bin/wasabi.sh start test stop
Integration tests might fail intermittently due to a time drift issue in docker containers on Mac OSX.
When the Mac sleeps and wakes back up, there is a lag created between the clock in the Mac vs the running docker containers. This is a known issue in Docker for Mac.
This can be fixed by running the following command:
cker run --rm --privileged alpine hwclock -s
The above command will need to be run every time when there is a time drift.
To automatically run this command and update the time each time the Mac wakes up, you could install the following agent:
rl https://raw.githubusercontent.com/arunvelsriram/docker-time-sync-agent/master/install.sh | bash
You can read more about this at: quick-tip-fixing-time-drift-issue-on-docker-for-mac
Wasabi can readily be packaged as installable rpm or deb distributions and deployed at scale as follows:
Package by running integration tests 1st:
bin/wasabi.sh start package
Package without integration tests, if needed:
bin/wasabi.sh -t false package
Find generated package files:
nd . -type f \( -name "*.rpm" -or -name "*.deb" \)
Note: Java 8 is a runtime dependency
Wasabi is readily embeddable via the following maven dependency GAV family:
endency>
<groupId>com.intuit.wasabi</groupId>
<artifactId>wasabi</artifactId>
<version>1.0.20160627213750<build_timestamp></version>
pendency>
We greatly encourage contributions! You can add new features, report and fix existing bugs, write docs and tutorials, or any of the above. Feel free to open issues and/or send pull requests.
The master
branch of this repository contains the latest stable release of Wasabi, while snapshots are published to the develop
branch. In general, pull requests should be submitted against develop
by forking this repo into your account, developing and testing your changes, and creating pull requests to request merges. See the Contributing to a Project
article for more details about how to contribute in general and find more specific information on how to write code for Wasabi in our user guide.
Extension projects such as browser plugins, client integration libraries, and apps can be contributed under the contrib
directory.
Steps to contribute:
git clone https://github.com/YOURUSERNAME/wasabi.git
gh-pages
branchThank you for your contribution!