start.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash -ex
  2. rm -rf /tmp/dump*
  3. export RAILS_APP_DIR=$(pwd)
  4. ssh-add ~/.ssh/rockbox.pem
  5. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
  6. cd /tmp && redis-server &
  7. redis-cli flushall
  8. tika &
  9. cd $RAILS_APP_DIR
  10. docker-machine create -d virtualbox contactrocket
  11. docker-machine start contactrocket
  12. eval $(docker-machine env contactrocket)
  13. docker-compose down
  14. docker-compose up -d
  15. sleep 10
  16. echo "-- RUNNING TESTS --"
  17. # Image Classification
  18. curl -X PUT "http://localhost:8883/services/imageserv" -d "{\"mllib\":\"caffe\",\"description\":\"image classification service\",\"type\":\"supervised\",\"parameters\":{\"input\":{\"connector\":\"image\"},\"mllib\":{\"nclasses\":1000}},\"model\":{\"repository\":\"/opt/models/ggnet/\"}}"
  19. curl -X POST "http://localhost:8883/predict" -d "{\"service\":\"imageserv\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"output\":{\"best\":3},\"mllib\":{\"gpu\":false}},\"data\":[\"http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg\"]}"
  20. # Imaging Processing
  21. curl http://localhost:9001
  22. # Text Analysis
  23. curl http://localhost:5000/api --header 'content-type: application/json' --data '{"text": "This is a text that I want to be analyzed. My name is Peter Alcock and I live in Boston, MA."}' -X POST
  24. curl http://localhost:8888/add --header 'content-type: application/x-www-form-urlencoded' --data '{"filepath":"britney.jpg" , "url": "http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg"}' -X POST
  25. curl -d "text=I%20am%20happy" http://localhost:8880
  26. curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://localhost:9292/ocr
  27. curl http://localhost:8882/locate?ip=172.56.38.214
  28. cd ./web
  29. bundle install
  30. bundle exec rake db:setup
  31. guard start
  32. cd ../engine
  33. bundle install
  34. guard start &
  35. cd ../crm
  36. bundle install
  37. bundle exec rails s -p 3001 -b 0.0.0.0 &
  38. cd ../web
  39. bundle install
  40. bundle exec rake db:setup
  41. guard start
  42. exit 0