Skip to content

Docker container-based substitute for webgme's server worker manager

Notifications You must be signed in to change notification settings

webgme/docker-worker-manager

Repository files navigation

webgme-docker-worker

Since webgme version 2.14.0 the server worker manager is a replaceable module. The server worker manager (SWM) handles computationally expensive requests such as project/model export, constraint checking, project seeding etc., in processes separate from the server process.

If server execution of plugins is available (gmeConfig.plugin.allowServerExecution = true;) these are also handled by the SWM. This module reuses the basic webgme SWM, but instead of running plugins in separate processes they are executed in docker containers. (This can be configured per plugin, see config/config.default.js)

It's worth mentioning here that plugins executed on the server do not directly connect to storage database, but rather connects to the webgme server through websockets using the identity of the invoker of the plugin. This means they can't access projects outside of the user's scope.

Usage

The host machine must have docker installed.

Add this a node-module.

npm install webgme-docker-worker-manager --save

The manager launches containers from existing images. To build an image with the full "webgme stack" for executing plugins. Read through the short Dockerfile. Built correctly it will include all plugins and code for the specific repo.

Move over and modify the configuration parameters illustrated in gmeConfig to your configuration file.

Together with Dockerized WebGME Server

If the webgme server itself runs within a docker container it is preferable to run the workers as sibling containers.

siblings

With using the default settings the webgme container can be given access to the docker socket by mapping it as a volume to the webgme-server (-v).

docker run -d -p 8888:8888 -v /var/run/docker.sock:/var/run/docker.sock -e NODE_ENV='myConfigWithDockerWM' webgme-server

Common Issues

If after installing docker you get the error at the server start Could not find correct info from docker "bridge" network correctly a reload of docker daemon might fix the issue as mentioned in this issue.

moby/moby#26799

Developers

Tests

To run the full stack tests the a docker images must be built first.

docker build -t docker-worker-test:<PACKAGE_JSON.version> .

Publish

npm version 0.1.0 -m "Release %s"
git push origin master
git checkout v0.1.0
git push origin v0.1.0
npm publish ./

After bumping the version make sure to bump image version in .travis.yml.

About

Docker container-based substitute for webgme's server worker manager

Resources

Stars

Watchers

Forks

Packages

No packages published