Differences

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

Link to this comparison view

Next revision
Previous revision
doc:docker [2015/09/24 08:38] – [Installing the Docker daemon] daniel86doc:docker [2020/03/09 13:55] (current) – [Setting up admin user] daniel86
Line 1: Line 1:
-====== KnowRob and Docker ======+====== Setting up your own openEASE server ======
  
-This page collects information on the installation and usage of KnowRob with [[http://www.docker.com|Docker]], a tool for easily creating and managing Linux containers. Using Docker, we have created a cloud-based infrastructure for providing KnowRob as a service via the Web.+This page collects information on the installation and usage of openEASE, a web-service based on [[http://www.docker.com|Docker]]. Using Docker, we have created a cloud-based infrastructure for providing KnowRob as a service via the Web
 +You can follow the steps described here for any Ubuntu version that has docker independently of the Ubuntu version running inside of openEASE.
  
-===== Installing the Docker daemon ===== +===== Installing web-browser with WebGL support ==== 
-Install Docker following the instructions at http://nerds.qminderapp.com/docker-1-6-in-ubuntu.html. For Ubuntu Precisethis boils down to+ 
-  curl -sLo http://j.mp/install-docker-1-6 sudo sh -xe +Firefox is by far the most tested browserPackages in ubuntu repositories should work with KnowRob. 
-  sudo gpasswd -a ${USER} docker +If you don't already have firefox installedyou can do so by calling
-  sudo service docker restart+  sudo apt-get install firefox 
 + 
 +Alternatively, you can use the Chromium Web-Browser. 
 + 
 +When the Browser is installed check that [[https://get.webgl.org/|WebGL is supported]]. 
 + 
 +===== Installing the docker daemon & docker-compose ===== 
 +Install Docker following the instructions at https://docs.docker.com/engine/installation/linux/ubuntulinux/.
  
 After installation, you need to log out and log in again to have your username added to the new group 'docker'. After installation, you need to log out and log in again to have your username added to the new group 'docker'.
  
-**//NOTE//**: At the moment there are unresolved issues with docker version >= 1.7Please use an earlier version for now.+In addition, you will need to install docker-compose which is used for the orchestration of the openEASE application. 
 +Install instrucitons for docker-compose can be found here: https://docs.docker.com/compose/install/ 
  
  
-===== Installing dockerized KnowRob =====+===== Installing openEASE =====
  
-The next step is to clone the KnowRob Docker repository to get some utility scripts, and to pull the docker images for KnowRob from [[https://hub.docker.com/|DockerHub]]+The next step is to clone the openEASE repository: 
-  git clone --recursive https://github.com/knowrob/docker.git +  git clone https://github.com/ease-crc/openease.git
-  cd docker +
-  ./scripts/update-containers+
  
  
-===== Setting up WebSocket Authentication =====+===== Setting up WebSocket authentication =====
  
 Clients can communicate with the openEASE webserver using SSL encryption. Clients can communicate with the openEASE webserver using SSL encryption.
 For local testing you can generate a certificate with following commands: For local testing you can generate a certificate with following commands:
-  cd ./nginx-proxy/certs/+  cd ./openease/certs/
   ./gencert.sh   ./gencert.sh
- 
-This certificate must be included in the web server container (the certificate will be mounted as host volume inside of the docker container). Make sure to remove any old web server container 
-that doesn't include the certificate: 
-  docker rm -f nginx 
  
 **//NOTE//**: Please consider using a trusted certificate when running a production server, browsers will complain about the generated certificate! **//NOTE//**: Please consider using a trusted certificate when running a production server, browsers will complain about the generated certificate!
  
-===== Setting up Experiment Logs =====+===== Setting up experiment logs ===== 
 + 
 +**NOTE: this is subject of change, experiment logs will be inserted differently soon (DB 08/19)**
  
 Experiment logs can be downloaded via a public FTP server that is hosted in the network of Experiment logs can be downloaded via a public FTP server that is hosted in the network of
Line 42: Line 48:
 The openEASE server requires experiments to be available in the local filesystem. The openEASE server requires experiments to be available in the local filesystem.
 In order to download all experiments, you can use following commands: In order to download all experiments, you can use following commands:
-  wget -ftp://open-ease-stor.informatik.uni-bremen.de +  wget --mirror --no-host-directories -P episodes ftp://open-ease-stor.informatik.uni-bremen.de
-  mv ./open-ease-stor.informatik.uni-bremen.de/ ./episodes+
  
 Finally, the server needs to know where the episodes are located in the local filesystem. Finally, the server needs to know where the episodes are located in the local filesystem.
Line 55: Line 60:
 The volume container is automatically created based on the environment variable next time you start the openEASE webserver. The volume container is automatically created based on the environment variable next time you start the openEASE webserver.
  
-===== Setting up Admin User =====+===== Setting up admin user =====
  
 The admin user is automatically created when the webserver starts for the first time. The admin user is automatically created when the webserver starts for the first time.
-The password is taken from an environment variablePlease add following environment variable to your .bashrc +The default password is **1234**You can change it after logging in for the first time.
-and replace 'XXX' with your admin password: +
-  export OPENEASE_ADMIN_PASSWORD="XXX"+
  
-**//NOTE//**: No admin user will be created if this variable is undefined. 
  
-===== Setting up Password Recovery =====+===== Selecting a ROS distribution ===== 
 + 
 +openEASE depends on rosjava. There are ubuntu packages available for ROS **hydro** and **indigo**. 
 +indigo is used by default, but you can change the ROS distribution by extending your environment: 
 +  export OPENEASE_ROS_DISTRIBUTION="kinetic" 
 + 
 +===== Setting up mesh repositories ===== 
 +**NOTE: this is subject of change, meshes will be part of episodic memory soon (DB 08/19)** 
 + 
 +Meshes can be downloaded from custom **git** or **svn** repositories. 
 +This information must be included in the environment, for example: 
 +  export OPENEASE_MESHES="svn http://svn.ai.uni-bremen.de/svn/cad_models" 
 +  export OPENEASE_MESHES="git https://github.com/code-iai/iai_maps,$OPENEASE_MESHES" 
 +  export OPENEASE_MESHES="git https://github.com/code-iai/iai_robots,$OPENEASE_MESHES" 
 +  export OPENEASE_MESHES="git https://github.com/daniel86/pr2_common,$OPENEASE_MESHES" 
 + 
 +===== Setting up remote login (optional) ===== 
 +openEASE allows you to sign in via oAuth. 
 +You have to register the openEASE app and acquire authentication and secret token from the service. 
 +This information must be included in the environment: 
 +  export GITHUB_APP_ID "XXX" 
 +  export GITHUB_APP_SECRET "XXX" 
 +  export GOOGLE_APP_ID "XXX" 
 +  export GOOGLE_APP_SECRET "XXX" 
 +  export FACEBOOK_APP_ID "XXX" 
 +  export FACEBOOK_APP_SECRET "XXX" 
 +  export TWITTER_APP_ID "XXX" 
 +  export TWITTER_APP_SECRET "XXX" 
 + 
 +===== Setting up password recovery (optional) =====
  
 For production servers, you might want a working password recovery mechanism. For production servers, you might want a working password recovery mechanism.
Line 72: Line 103:
   export OPENEASE_MAIL_PASSWORD="XXX"   export OPENEASE_MAIL_PASSWORD="XXX"
  
 +===== Launching openEASE =====
 +openEASE uses //docker-compose//. You can run openEASE by changing into the 'openease' folder and then running:
  
-===== Launching the Web interface ===== +  docker-compose up
-The Web interface runs in its own container. On the one hand, this app provides the Web GUI, on the other hand it manages the container infrastructure, e.g. to start a new container when a user logs in. You can start this container using the 'start-webrob' script. +
- +
-  ./scripts/start-webrob+
      
 Then you can connect to the Web interface at https://localhost. Then you can connect to the Web interface at https://localhost.
  
-===== Setting up Mongo Logs =====+===== Setting up mongo server =====
  
 Mongo dumps are included in the episode data downloaded from the FTP. Mongo dumps are included in the episode data downloaded from the FTP.
Line 89: Line 119:
 A table with a row for each experiment is shown then. Press the "Import" button in the A table with a row for each experiment is shown then. Press the "Import" button in the
 right most column in order to import the mongo logs for one of the experiments. right most column in order to import the mongo logs for one of the experiments.
 +
 +
 +===== Offline openEASE =====
 +**NOTE: this is not supported as of 08/19, but the feature will be added again at a later time
 +**
 +
 +openEASE is a webapp and thus components may require active internet connection.
 +We try to keep our code offline compatible but since external libraries are used,
 +we can't ensure that all features are working without Internet connection.
 +We provide a special start script that -- additionally -- starts a dummy DNS server
 +in order to avoid timeouts when requesting DNS with no active Internet connection
 +(the dummy DNS server maps all domains to localhost).
 +
 +Without active Internet connection, execute following call instead of calling 'start-webrob'
 +
 +  ./scripts/start-webrob-offline
 +
 +
 +
 +===== Administration =====
 +
 +==== PostgresDB ===
 +
 +Get a bash console in the postgres container
 +  docker exec -it postgres_db bash
 +
 +Start ''psql'' session for //docker// user
 +  psql --username=docker
 +
 +Write SQL statements, e.g., add a column in the user table
 +  ALTER TABLE public.user ADD column_name character varying(50) NOT NULL DEFAULT '';
 +
 +Or update text of the ''tutorial'' table (Note the ''E'' in the beginning of the string)
 +  UPDATE tutorial SET text=E'The user interface consists of six panes with different purposes.\n....' WHERE id=220;
 +
 ===== Troubleshooting ===== ===== Troubleshooting =====
  
Line 112: Line 177:
 With Ubuntu, you can stop the server by executing following command: With Ubuntu, you can stop the server by executing following command:
   sudo service mongodb stop   sudo service mongodb stop
 +  
  
 ==== Other docker problems ==== ==== Other docker problems ====