opensim-engine/README.md

82 lines
3.7 KiB
Markdown
Raw Normal View History

2020-11-15 02:30:15 -04:00
# OpenSim Engine -- Readme
2020-11-15 02:22:26 -04:00
## Overwiew:
2020-11-18 21:43:20 -04:00
OpenSim Engine is intended to run OpenSim based simulators. Its main goal is to be part of a more elaborated solution to deploy simulators and/or grids, but can be used *as is* to test and even run (very simple) configurations inside containers.
2020-11-15 02:22:26 -04:00
## Features:
2020-11-18 21:43:20 -04:00
- Built upon the latest version of Mono
2020-11-18 21:23:42 -04:00
- Contains minimal tools to download and manipulate ZIP compressed binaries inside the container
- It runs OpenSim.exe onto a detachable console you can access the main screen, see status and use CLI.
- Allows both standalone sims/grids (e.g. OpenSim, DivaDistro), and also connect your sims to existing grids (e.g. OSGrid)
2020-11-18 21:43:20 -04:00
NOTE: The image does not provide simulator files, you have to download/uncompress it yourself.
2020-11-18 21:23:42 -04:00
## Requirements:
- Docker Engine. See [Docker Documentation](https://docs.docker.com/get-docker/) for further instructions
2020-11-18 21:43:20 -04:00
- Uncompressed main simulator folder tree, accessible by Docker with write permissions
2020-11-18 21:23:42 -04:00
2020-11-18 21:54:26 -04:00
## Basic Usage
2020-11-18 21:23:42 -04:00
Useful for tests, and also for running very simple configurations (e.g. standalone and/or default SQLite setup):
2020-11-18 21:50:04 -04:00
`docker run \`
2020-11-18 21:51:13 -04:00
2020-11-18 21:50:04 -04:00
`-it --restart=<restart-policy> \`
2020-11-18 21:51:13 -04:00
2020-11-18 21:50:04 -04:00
`--name <container-name> \`
2020-11-18 21:51:13 -04:00
2020-11-18 21:50:04 -04:00
`-v </path-to-main-folder>:/opensim \`
2020-11-18 21:51:13 -04:00
2020-11-18 21:50:04 -04:00
`-p 9XXX[-9YYY]:9XXX[-9YYY]/tcp \`
2020-11-18 21:51:13 -04:00
2020-11-18 21:50:04 -04:00
`-p 9XXX[-9YYY]:9XXX[-9YYY]/udp \`
2020-11-18 21:51:13 -04:00
2020-11-18 21:50:04 -04:00
`adrianparilli/opensim-engine[:<label>]`
2020-11-18 21:23:42 -04:00
Where:
`<restart-policy>`: `no` `on-failure[max-retries]` `unless-stopped` or `always` (see [Restart Policies](https://docs.docker.com/engine/reference/commandline/run/#restart-policies---restart) for more info
2020-11-18 21:54:26 -04:00
2020-11-18 21:23:42 -04:00
`<container-name>`: Name you want to give for this container
2020-11-18 21:54:26 -04:00
2020-11-18 21:23:42 -04:00
`</path-to-main-folder>`: Absolute path to the main simulator folder tree (containing inside 'bin' and 'doc' directories)
2020-11-18 21:54:26 -04:00
2020-11-18 21:23:42 -04:00
`9XXX[-9YYY]:9XXX[-9YYY]`: Port [or ports range] mapped to this container from the host, in order to connect to simulator(s) from your viewer. Both tcp and udp are need to be declared apart.
2020-11-18 21:54:26 -04:00
2020-11-18 21:23:42 -04:00
`label`: If even provisioned, will use a specific version of this image. It should not be needed.
2020-11-18 21:54:26 -04:00
### Example:
2020-11-18 21:23:42 -04:00
`docker run -it --name opensim-test -v /data/docker/opensim:/opensim -p 9000:9000/tcp -p 9000:9000/udp adrianparilli/opensim-engine`
The image will be downloaded and when runs, you will get attached to OpenSim.exe's first run CLI, being able to see the output and send commands to the simulator (e.g. setup, etc.)
To *detach* from the console, simply press `Ctrl+P` and `Ctrl+Q` (or `Ctrl+P+Q`) to exit. The simulator will keep running in background.
To *attach* to this container again: `docker attach <container-name>`
To *start|restart|stop* the container: `docker start|restart|stop <container-name>`
(NOTE: To stop|restart the simulator gracefully, you *must* attach the console and send the `shutdown` command before!)
2020-11-15 02:30:15 -04:00
2020-11-18 21:23:42 -04:00
To *delete* the container with `docker rm <container-name>`. Simulator files will be kept.
2020-11-15 02:22:26 -04:00
2020-11-15 02:30:15 -04:00
2020-11-18 21:23:42 -04:00
From your viewer, you should be able to access your simulator once configured via the local ip or dns name and configured port where Docker is running.
Example: http://localhost:9000
2020-11-15 02:22:26 -04:00
2020-11-15 02:30:15 -04:00
2020-11-18 21:54:26 -04:00
## Advanced Usage
2020-11-18 21:23:42 -04:00
This section is an ongoing work (commits are welcome!). By know, it's useful to mention that by using this image, you will be able to:
2020-11-15 02:22:26 -04:00
2020-11-18 21:23:42 -04:00
- Dump a clean simulator folder tree onto a Docker volume or directly inside the container, and mount just the files you need to manage
2020-11-15 02:22:26 -04:00
2020-11-18 21:23:42 -04:00
- Customize your entire settings firat, and dump either to a volume or inside the container, and run without mounts
2020-11-15 02:30:15 -04:00
2020-11-18 21:23:42 -04:00
- You can add more mount points to import/export files (e.g. terrains, OARs, IARs, etc.)
2020-11-15 02:22:26 -04:00
2020-11-18 21:23:42 -04:00
- You can connect to an existing DB server (e.g. MySQL) and this can be also another container
2020-11-15 02:22:26 -04:00
2020-11-18 21:23:42 -04:00
- You can use this image *to build and deploy your own OpenSim Stack* with Docker composer, Kubernetes, etc.
2020-11-15 02:22:26 -04:00
2020-11-18 21:54:26 -04:00
## To Do
2020-11-15 02:22:26 -04:00
2020-11-18 21:23:42 -04:00
- Create an entrypoint.sh to 'shutdown' the simulator gracefully.