-
Notifications
You must be signed in to change notification settings - Fork 121
Instructions to run a openroberta lab server using DOCKER
to run the openroberta lab on a local win or linux system, install docker, select (unused) directories for the data base and for temporary files (for crosscompilation), then run one command of the example section below.
A lot of teachers, companies and people have reasons not to use our online lab at https://lab.open-roberta.org. Even if we prefer if you use the official lab, this text describes how to run a local installation of the lab :-).
Almost all server, laptops, workstations are powerful enough to run the lab with some hundred users. You can run the lab on windows10 and linux systems (Ubuntu, Debian, ...). A RaspberryPI is possible, but due to the slow SD card, it doesn't perform as good as the systems mentioned before. The network, the server is part of, may be connected to the internet or not. Note, that during the initial setup described below internet access is mandatory.
To have a real lightweight setup and operating, we are using docker
.
For the initial setup you need access to the internet.
- First install
docker
on your computer. Check, that the docker demon is working. You'll find a lot of resources on the internet about installation and checking. On windows, you needdocker desktop
, too. - you need a directory for the data base. The directory may not exist or be empty. In this case an empty data base is created automatically. Otherwise it must contain a valid data base, for instance from earlier runs of the lab (on the same or any other system).
- you need a directory for temporary files used by the various crosscompilers. The directory may not exist or exist and even contain files. But it will be crowded with sources and binaries. From time to time you should remove the garbage, otherwise you'll run out of space (for a typical laptop, this will take a very, very long time, but it can happen). If you use no real robots, then you will not use crosscompiler and the directory is not used. But it must be declared.
- you have to select the version of the lab server. If you look at
https://hub.docker.com/r/openroberta/standalone/tags
, you get a list of the versions ("tags") we have stored at dockerhub. It is likely that you select the highest version number for your local server. From time to time you may look for newer versions and switch. - When the local lab is started for the first time, this takes some time, because the lab image is pulled from dockerhub. You need internet connection for the pull (not for the later runs of the lab).
- start the lab using a command from the example section below. The container gets the name you select, in the example
my-local-lab
. The internal container port 1999 is mapped to the external port 8080 (you can change it, 80 is a sensible value for http :-). - Check for success, e.g. by
docker ps
or with docker desktop. The container should be running. - Assuming, that your computer name is
cavy
, point your browser tohttp://cavy:80
, select a robot that supports the simulator (calliope, ev3, ...), write a small program and run the simulator to check your installation. - Later you may stop the container:
docker stop my-local-lab
and remove it:docker rm my-local-lab
. The data base is not lost. For stopping you may use docker desktop. If you don't remove the container, you have to select new names for every start. But beetter: remove exited container, they waste space!
- switch your computer on, start the docker demon, start the lab. That's it.
- logging of the lab server goes to the console. Use
docker log my-local-lab
to see the log. - when you specify the data base directory or the directory for temporary files, use always a full path (as in the examples)
- you may want to start the lab when the computer is switched on (init). There are descriptions on the net how to do that for all operating systems. See below for an example for linux.
- specify the robots you want to support in the -d robot.whitelist. If you omit the parameter, you get all plugins. That is ok.
The list of all plugins available currently is:
- microbit, microbitv2, calliopev3 (soon coming :-), calliope2017NoBlue, calliope2017, calliope2016
- ev3lejosv1, ev3dev, ev3c4ev3, nxt, xnn
- spike
- botnroll, nao, bob3, sensebox, mbot, mbot2, edison, festobionic
- uno, nano, mega, nano33ble, unowifirev2
- thymio, wedo
- examples to start some plugins (append these parameters to the example commands below):
- calliope and microbit only: -d robot.whitelist=calliope2017NoBlue,microbit
- all Lego robots: -d robot.whitelist=ev3lejosv1,ev3dev,ev3c4ev3,nxt,spike,xnn
- some arduinos: -d robot.whitelist=sim,ev3lejosv1,uno,unowifirev2,nano,mega,nano33ble -d robot.default=ev3lejosv1
- if the lab is stopped, you may backup the data base by simply copying, zipping or tarring the data base directory.
On my windows 10 I start the lab from cmd
with a data base located at D:\data\db
and the directory for temporary files located at D:\tmp\openrobertaTmp
:
docker run -d --name my-local-lab -p 8080:1999 -v D:\data\db:/opt/db -v D:\tmp\openrobertaTmp:/tmp/openrobertaTmp openroberta/standalone:5.2.2
On my ubuntu I start the lab from bash
with a data base located at /data/db
and the directory for temporary files located at /tmp/openrobertaTmp
:
docker run -d --name my-local-lab -p 8080:1999 -v /data/db:/opt/db -v /tmp/openrobertaTmp:/tmp/openrobertaTmp openroberta/standalone:5.2.2
You access the OpenRoberta lab in both cases with the URL http://<name-of-the-machine-running-the-lab>:8080
The following primitive init script works for linux. It starts the lab when the machine powers up. For safety reasons first it stops and removes all containers, then it starts the standalone lab. Obviously this script only works if no other container are running on that machine:
#!/bin/sh
### BEGIN INIT INFO
# Provides: openrobertalab
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: standalone openrobertalab service
# Description: Start, stop and restart the standalone lab
### END INIT INFO
docker stop $(docker ps -a -q)
docker rm $(docker ps -q -f status=exited)
case "$1" in
start|restart) echo 'openroberta standalone lab start'
docker run -d --name my-local-lab -p 8080:1999 -v /data/db:/opt/db -v /tmp/openrobertaTmp:/tmp/openrobertaTmp openroberta/standalone:5.2.2
;;
stop) echo 'openroberta standalone lab stop'
;;
*) echo "invalid command \"$1\" for openroberta standalone lab init script. Usage: $0 {start|stop|restart}"
;;
esac
- it is likely, that you want to access the lab using https. In this case you will use
apache2
ornginx
as webserver. This is quite easy. You have to install the certificates needed, of course.. - if you need more robust operation of the server, e.g.
- data base access and/or backup when the lab is running (This requires a container running a data base server).
- automatic restart if the server is frozen. This is unlikely to happen, but if the server is unattended, it makes sense.
... then you should use the docker setup of our production server, which has this and more.
It is more demanding from a technical point of view, but described in our git repo
https://github.com/OpenRoberta/docker
in THE README. Please contact me (address below) and I support your setup.
do not hesitate to ask us or send corrections and proposals to reinhard.budde at iais.fraunhofer.de
Home | Community | Installation | Team
Installation Tutorials
- Instructions to run a openroberta lab server using DOCKER
- Instructions to run the Open Roberta Lab Server natively on ubuntu ‐ not recommended
- Raspberry Pi 2/3/4 and the Open Roberta Lab
- EV3 and leJOS
- EV3 and ev3dev
- Creating the OR leJOS image
- Arduino Create Agent
- Mbed DAL: Generation and automation
Development
-
Workflows
-
Architecture
-
Blockly
-
Software engineering issues
-
Misc
-
Notes on robots
Textual Representation
Contribution
Discussions on future development