Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:docker:add-dataset [2014/10/14 16:00] admindoc:docker:add-dataset [2014/11/17 15:35] – [Adding a dataset to data.open-ease.org] admin
Line 57: Line 57:
 ==== Adding a query library ==== ==== Adding a query library ====
  
-The entries in the query library, that is commonly in the lower left corner of the interface, are generated from a JSON file of the following format. Each entry in the 'query' list corresponds to one row in the generated query library.+The entries in the query library, that is commonly in the lower left corner of the interface, are generated from a JSON file of the following format. Each entry in the 'query' list corresponds to one row in the generated query library. JSON parsers do not like syntax errors, so it is recommended to use a validator such as [[http://jsonlint.com/|JSONLint]] to check the syntax before committing the file.
  
 <code javascript> <code javascript>
Line 96: Line 96:
 # build is finished. Check the build details tab here: # build is finished. Check the build details tab here:
 # https://registry.hub.docker.com/u/knowrob/knowrob_data/ # https://registry.hub.docker.com/u/knowrob/knowrob_data/
-docker pull knowrob/knowrob_data+docker pull knowrob/knowrob_data:latest 
 +docker rm knowrob_data 
 +docker run --name knowrob_data knowrob/knowrob_data:latest true
      
 # if you have added your own query library: # if you have added your own query library:
Line 105: Line 107:
  
 ==== Accessing your new experiment ==== ==== Accessing your new experiment ====
-After rebuilding the containers, you +After rebuilding the containers, you can start the system locally and see if you can access your data. The //start-webrob// script contains the commands for starting all necessary containers:
  
 +  ~/docker/scripts/start-webrob
 +
 +You should now be able to login to the system at http://localhost and then open http://localhost/exp/your-data. This page should load the query library you have created, and you should be able to call the queries from there.
 +
 +
 +
 +
 + 
 +==== Debugging the containerized setup ====
 +
 +If you have tested your code with a 'normal' KnowRob without docker first, chances are good that things also work in the 'containerized' version. However, there may still be issues, and the following points may help to get started with debugging:
 +
 +  * The terminal in which you executed the 'start-webrob' script will contain output of the 'webrob' container that serves the HTML/JavaScript front-end. Watch out for Python exceptions and HTTP response codes 404 (could not find files) or 500 (internal server error, often an exception in a program generating a web site).
 +  * To inspect the output of the KnowRob container, you can use the [[https://docs.docker.com/reference/commandline/cli/#logs|docker logs]] and [[https://docs.docker.com/reference/commandline/cli/#attach|docker attach]] commands on your user container. This container has the same name as your username, so the command would be //docker logs demo// for user 'demo'.
 +  * If you make changes to the query library and it is not reloaded, this may be related to the browser cache. Try opening that file directly (e.g. http://localhost/static/queries-your-data.json) and press 'reload' in the browser.
 +
 +
 +==== Deploying your code to the server ====
 +
 +When verything works fine on your computer, you are ready to deploy the containers to the server at data.open-ease.org. 
 +
 +Please be careful with updates of the server -- only deploy well-tested code and refrain from deleting other people's containers! Especially when doing one of your first updates, try to do it when more experienced people are still around and sufficiently before any important deadline so that there is still time to fix problems that may occur.
 +
 +The following steps need to be performed after logging into the server:
 +  - Import your data into the MongoDB on the server as described above. You will need to copy your-tf.json to the server and run the mongoimport program from there.
 +  - Rebuild the containers you have changed as you have done it on your local computer (see description above)
 +  - The startup script is running in a [[http://wiki.ubuntuusers.de/screen|screen session]]. You will need to resume that session, stop the currently running script, and start it again.
 +<code bash>
 +# connect to the server
 +ssh data.open-ease.org
 +
 +# resume the screen session
 +screen -r
 +
 +# stop the script with CRTL+C
 +
 +# start the script again
 ./start-webrob ./start-webrob
-http://data.open-ease.org/exp/your-data 
  
 +# detach the screen session using CTRL+A+D
 +</code>