stf icon indicating copy to clipboard operation
stf copied to clipboard

running stf local

Open romitincedoinc opened this issue 11 years ago • 7 comments

I have installed docker and pulled the image from the docker hub. Now i am confused what to do next? Do i need to install all the requirements explicitly on my ubuntu machine including rethinkdb ? I have also tried to ref. to the solution given by you but you have mentioned there to see the deployment file, which makes me confused to understand difference between stf local and actual deployment.

Can you please help me.

romitincedoinc avatar Nov 04 '15 13:11 romitincedoinc

which makes me confused to understand difference between stf local and actual deployment.

STF is a distributed application which means it is supposed to be run on a cluster of computers in production environment instead of a single machine. stf local feature is developed just for development purpose. You are not supposed to use it in production environment.

In order to deploy STF app in production, you will need

  1. A cluster of computers where you can connect your devices
  2. A tool which can deploy, stf docker container in the cluster

There are many ways to do this but STF's Deployment doc suggests, CoreOS + Fleet combination. CoreOS is to make cluster and Fleet is run STF services inside cluster.

I highly recommend you to go through all the CoreOS documentation even if you don't plan to use CoreOS because that will give you an idea about computer cluster. After you finish reading these docs and if you reread the deployment doc, you will automatically understand everything.

Do i need to install all the requirements explicitly on my ubuntu machine including rethinkdb ?

No, you do not need to install any thing on your ubuntu machine. All the required dependencies are already installed in docker image. You should consider reading docker documentation regarding how docker works.

including rethinkdb ?

There are many ways you can create database (rethinkdb) cluster. You can use or not use docker, its totally your choice. https://github.com/openstf/stf/issues/163 might helps.

vbanthia-zz avatar Nov 04 '15 14:11 vbanthia-zz

HI

Thanks for your reply.

Yes i am reading coreos in the meanwhile i have installed docker on ubuntu 14.04 lts and trying to get the things done.

I have also tried the "Mitesh Shah" method , by that i am able to create the tables in the db but i am getting an error of stf device. Can you help me in this

FTL/reaper 28116 [reaper001] Unable to load initial state { name: 'ReqlOpFailedError', msg: 'Index present was not found on table stf.devices.', frames: [], message: 'Index present was not found on table stf.devices in:\nr.table("devices").getAll(true, {index: "present"})\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' } FTL/util:lifecycle 28116 [reaper001] Shutting down due to fatal error FTL/cli:local 28106 [*] Child process had an error ExitError: Exit code "1" at ChildProcess. (/usr/local/lib/node_modules/stf/lib/util/procutil.js:49:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at Process.ChildProcess._handle.onexit (child_process.js:797:12)

romitincedoinc avatar Nov 04 '15 16:11 romitincedoinc

Well, this is a known bug which is already fixed in master branch. Looks like you have installed stf using npm and npm latest version is pretty old compare to master branch.

You have two choices. 1 Add 'present' index manually in devices table

  • Go to rethinkdb administrative UI (http://localhost:8080)
  • Open Data Explorer
  • Add index using query
 r.db("stf").table("devices").indexCreate('present');
  • Make sure your device table should look like below, check using this query.
r.db("stf").table("devices").info();

Output

{  
   "db":{  
      "id":"7195ff75-7ddf-49b5-99e9-64cebbd75da8",
      "name":"stf",
      "type":"DB"
   },
   "doc_count_estimates":[  
      0
   ],
   "id":"e4363c74-eaa3-42b6-b4d7-f019caed0bf6",
   "indexes":[  
      "owner",
      "present",
      "providerChannel"
   ],
   "name":"devices",
   "primary_key":"serial",
   "type":"TABLE"
}

2 Use master branch

You can find instruction here

vbanthia-zz avatar Nov 04 '15 17:11 vbanthia-zz

Hi I am able to up the system and up the ui on 7100 port . Currently it is showing zero devices connected. To test i started android studio on which i have installed genymotion. When i start avirtual device from genymotion , i suddenly get an error , which says try reconnect. can you please help me in resolving this

FTL/util:lifecycle 4024 [] Tracker had an error Error: Connection closed at /usr/lib/node_modules/stf/node_modules/adbkit/lib/adb/tracker.js:22:15 at tryCatcher (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/util.js:26:23) at CatchFilter.doFilter (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/catch_filter.js:40:36) at CatchFilter.tryCatcher (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/util.js:26:23) at Promise.settlePromiseFromHandler (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/promise.js:503:31) at Promise.settlePromiseAt (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/promise.js:577:18) at Promise.settlePromises (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/promise.js:693:14) at Async.drainQueue (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/async.js:123:16) at Async.drainQueues (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/async.js:133:10) at Async.drainQueues (/usr/lib/node_modules/stf/node_modules/adbkit/node_modules/bluebird/js/main/async.js:15:14) at process.tickCallback (node.js:415:13) FTL/util:lifecycle 4024 [] Shutting down due to fatal error FTL/cli:local 4011 [] Child process had an error ExitError: Exit code "1" at ChildProcess. (/usr/lib/node_modules/stf/lib/util/procutil.js:49:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at Process.ChildProcess.handle.onexit (child_process.js:797:12) INF/cli:local 4011 [] Shutting down all child processes INF/util:lifecycle 4015 [app001] Winding down for graceful exit INF/util:lifecycle 4016 [dev001] Winding down for graceful exit INF/util:lifecycle 4017 [proc001] Winding down for graceful exit INF/util:lifecycle 4020 [proc002] Winding down for graceful exit INF/util:lifecycle 4022 [reaper001] Winding down for graceful exit WRN/db 4022 [reaper001] Connection closed INF/db 4022 [reaper001] Connecting to 127.0.0.1:28015 WRN/db 4017 [proc001] Connection closed INF/db 4017 [proc001] Connecting to 127.0.0.1:28015 INF/util:lifecycle 4026 [] Winding down for graceful exit INF/util:lifecycle 4028 [] Winding down for graceful exit INF/auth-mock 4026 [] Waiting for client connections to end INF/util:lifecycle 4029 [] Winding down for graceful exit WRN/db 4020 [proc002] Connection closed INF/db 4020 [proc002] Connecting to 127.0.0.1:28015 WRN/db 4029 [] Connection closed WRN/db 4028 [] Connection closed INF/db 4029 [] Connecting to 127.0.0.1:28015 INF/db 4028 [_] Connecting to 127.0.0.1:28015

romitincedoinc avatar Nov 04 '15 19:11 romitincedoinc

Hi,

Thanks the system is up on Ubuntu 14.04 LTS single machine and now I'm exploring it. But yes the best thing would be to setup the production environment using core os.

romitincedoinc avatar Nov 04 '15 21:11 romitincedoinc

nice!

vbanthia-zz avatar Nov 05 '15 02:11 vbanthia-zz

@romitincedoinc

Can you tell, which rethinkdb version you were using?

vbanthia-zz avatar Nov 06 '15 15:11 vbanthia-zz