Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

Creating your own instance of OS-Server is no trivial task (ie, one size does not fit all), but here are some scripts that I use to do local deployments of OS-Server. The scripts are assumed to live in your home directory.

We currently use Docker 17.09.1-ce on Ubuntu 16.04 LTS, so make sure you have that setup correctly and '>Docker info' gives the right architecture and right number of CPUs.

OS-Server uses Docker Swarm to setup and scale the worker nodes. The bash script 'nuke.sh' will setup a Docker Registry and then pull the docker containers (with version given as an input argument,i.e. >nuke.sh 2.7.0) and then push them to the local Registry. Line 42 then scales the number of worker nodes to be 42 but you probably want to change that to the number of worker cores avail on your box.

There is also the docker-compose.yml file that needs to get configured. There are Environment Variables that need to get set to your server configuration. You can either replace them with values in the file or set actual ENV Vars:

  • AWS_MONGO_CORES - ceil(number_of_cpus / 64)
  • AWS_OS_SERVER_NUMBER_OF_WORKERS - number_of_cpus - WEB_CORES - MONGO_CORES - 3
  • AWS_MAX_REQUESTS - round((number_of_cpus + 10) * 1.2)
  • AWS_MAX_POOL - 16 * WEB_CORES
  • AWS_WEB_CORES - ceil(number_of_cpus / 32)

You can also experiment with replacing CPU reservations to limits, depending on the needs of you specific hardware. (https://docs.docker.com/compose/compose-file/#resources)

Ideally, all you'd have to do is run '>nuke.sh 2.7.0' from your home directory and that script will download version 2.7.0 of the related OS-Server containers, Mongo, Reddis and put them in a local Registry. Then setup the Volumes needed for the containers, create the Swarm and deploy the Stack and scale to the number of workers you select.

Scripts:

nuke.sh:

docker-compose.yml