Commit abf3bb22 authored by jayunit100's avatar jayunit100

Cleanup after initial PR and shading of src.

parent c552e916
## Welcome to k8PetStore ## Welcome to k8PetStore
This is a follow up to the Guestbook example, which implements a slightly more real world demonstration using This is a follow up to the [Guestbook Example](../guestbook/README.md)'s [Go implementation](../guestbook-go/).
the same application architecture.
- It leverages the same components (redis, Go REST API) as the guestbook application - It leverages the same components (redis, Go REST API) as the guestbook application
- It comes with visualizations for graphing whats happening in Redis transactions, along with commandline printouts of transaction throughput - It comes with visualizations for graphing whats happening in Redis transactions, along with commandline printouts of transaction throughput
...@@ -20,7 +18,7 @@ The guestbook tutorial will teach you alot about the basics of kubernetes, and w ...@@ -20,7 +18,7 @@ The guestbook tutorial will teach you alot about the basics of kubernetes, and w
## Architecture of this SOA ## Architecture of this SOA
A diagram of the overall architecture of this application can be seen in arch.dot (you can paste the contents in any graphviz viewer, including online ones such as http://sandbox.kidstrythisathome.com/erdos/. A diagram of the overall architecture of this application can be seen in [arch.dot](arch.dot) (you can paste the contents in any graphviz viewer, including online ones such as http://sandbox.kidstrythisathome.com/erdos/.
## Docker image dependencies ## Docker image dependencies
...@@ -32,11 +30,11 @@ in your dockerhub "dockerhub-name". ...@@ -32,11 +30,11 @@ in your dockerhub "dockerhub-name".
Since these images are already published under other parties like redis, jayunit100, and so on, Since these images are already published under other parties like redis, jayunit100, and so on,
so you don't need to build the images to run the app. so you don't need to build the images to run the app.
If you do want to build the images, you will need to build and push these 3 docker images. If you do want to build the images, you will need to build and push the images in this repository.
For a list of those images, see the `build-and-push` shell script - it builds and pushes all the images for you, just
- dockerhub-name/bigpetstore-load-generator, which generates transactions for the database. modify the dockerhub user name in it accordingly.
- dockerhub-name/redis, which is a simple curated redis image.
- dockerhub-name/k8petstore, which is the web app image.
## Get started with the WEBAPP ## Get started with the WEBAPP
...@@ -46,17 +44,13 @@ We have extended it to do some error reporting, persisting of JSON petstore tran ...@@ -46,17 +44,13 @@ We have extended it to do some error reporting, persisting of JSON petstore tran
and supporting of additional REST calls, like LLEN, which returns the total # of transactions in the database. and supporting of additional REST calls, like LLEN, which returns the total # of transactions in the database.
To run it locally, you simply need to run basic Go commands. Assuming you have Go set up, do something like: To work on the app, just cd to the `dev` directory, and follow the instructions. You can easily edit it in your local machine, by installing
redis and go. Then you can use the `Vagrantfile` in this top level directory to launch a minimal version of the app in pure docker containers.
``` If that is all working, you can finally run `k8petstore.sh` in any kubernetes cluster, and run the app at scale.
#Assuming your gopath is in / (i.e. this is the case, for example, in our Dockerfile).
go get main
go build main
export STATIC_FILES=/tmp/static
/gopath/bin/main
```
## Set up the data generator ## Set up the data generator (optional)
The web front end provides users an interface for watching pet store transactions in real time as they occur. The web front end provides users an interface for watching pet store transactions in real time as they occur.
...@@ -74,15 +68,6 @@ Directions for that are here : https://github.com/apache/bigtop/tree/master/bigt ...@@ -74,15 +68,6 @@ Directions for that are here : https://github.com/apache/bigtop/tree/master/bigt
You will likely want to checkout the branch 2b2392bf135e9f1256bd0b930f05ae5aef8bbdcb, which is the exact commit which the current k8petstore was tested on. You will likely want to checkout the branch 2b2392bf135e9f1256bd0b930f05ae5aef8bbdcb, which is the exact commit which the current k8petstore was tested on.
## Set up REDIS
Install and run redis locally. This can be done very easily on any Unix system, and redis starts in an insecure mode so its easy
to develop against.
Install the bigpetstore-transaction-queue generator app locally (optional), but for realistic testing.
Then, run the go app directly. You will have to get dependencies using go the first time (will add directions later for that, its easy).
## Now what? ## Now what?
Once you have done the above 3 steps, you have a working, from source, locally runnable version of the k8petstore app, now, we can try to run it in kubernetes. Once you have done the above 3 steps, you have a working, from source, locally runnable version of the k8petstore app, now, we can try to run it in kubernetes.
...@@ -107,7 +92,11 @@ You might want to change it to point to your customized Go image, if you chose t ...@@ -107,7 +92,11 @@ You might want to change it to point to your customized Go image, if you chose t
like the number of data generators (more generators will create more load on the redis master). like the number of data generators (more generators will create more load on the redis master).
So, to run this app in kubernetes, simply run `k8petstore.sh`. So, to run this app in kubernetes, simply run [The all in one k8petstore.sh shell script](k8petstore.sh).
Note that there are a few , self explanatory parameters to set at the top of it.
Most importantly, the Public IPs parameter, so that you can checkout the web ui (at $PUBLIC_IP:3000), which will show a plot and read outs of transaction throughput.
## Future ## Future
...@@ -117,7 +106,9 @@ Thus we plan to add another tier of queueing, which empties the REDIS transactio ...@@ -117,7 +106,9 @@ Thus we plan to add another tier of queueing, which empties the REDIS transactio
## Questions ## Questions
For questions on running this app, you can ask on the google containers group. For questions on running this app, you can ask on the google containers group (freenode ~ google-containers@googlegroups.com or #google-containers on IRC)
For questions about bigpetstore, and how the data is generated, ask on the apache bigtop mailing list. For questions about bigpetstore, and how the data is generated, ask on the apache bigtop mailing list.
...@@ -10,7 +10,7 @@ Vagrant.configure("2") do |config| ...@@ -10,7 +10,7 @@ Vagrant.configure("2") do |config|
config.vm.define "rmaster" do |rm| config.vm.define "rmaster" do |rm|
rm.vm.provider "docker" do |d| rm.vm.provider "docker" do |d|
d.vagrant_vagrantfile = "./docker-host/Vagrantfile" d.vagrant_vagrantfile = "./dev/hosts/Vagrantfile"
d.build_dir = "redis-master" d.build_dir = "redis-master"
d.name = "rmaster" d.name = "rmaster"
d.create_args = ["--privileged=true", "-m", "1g"] d.create_args = ["--privileged=true", "-m", "1g"]
...@@ -21,7 +21,7 @@ Vagrant.configure("2") do |config| ...@@ -21,7 +21,7 @@ Vagrant.configure("2") do |config|
config.vm.define "frontend" do |fe| config.vm.define "frontend" do |fe|
fe.vm.provider "docker" do |d| fe.vm.provider "docker" do |d|
d.vagrant_vagrantfile = "./docker-host/Vagrantfile" d.vagrant_vagrantfile = "./dev/hosts/Vagrantfile"
d.build_dir = "web-server" d.build_dir = "web-server"
d.name = "web-server" d.name = "web-server"
d.create_args = ["--privileged=true"] d.create_args = ["--privileged=true"]
...@@ -31,10 +31,7 @@ Vagrant.configure("2") do |config| ...@@ -31,10 +31,7 @@ Vagrant.configure("2") do |config|
d.env = {"REDISMASTER_SERVICE_HOST"=>"rmaster","REDISMASTER_SERVICE_PORT"=>"6379"} d.env = {"REDISMASTER_SERVICE_HOST"=>"rmaster","REDISMASTER_SERVICE_PORT"=>"6379"}
end end
end end
### Todo , add data generator. ### Todo , add data generator.
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment