-
Notifications
You must be signed in to change notification settings - Fork 92
Manifest
Manifests describe your app. In particular, manifests specify what exactly to execute.
First of all, you should specify a path to your app's slave; generally, it should be a relative path or just an executable's name, like __init__.py
, because your app is always started with working directory set to the root of your extracted app archive. Absolute paths are allowed as well, but we plan to restrict this usage. Also, it's considered a good practice to bundle all your dependencies along with your app package using your development platform tools, like rpath
, virtualenv
or bundler
.
{
"slave": "main.py"
}
The JSON above is actually a minimal manifest, which is enough to start some app with an entry point called main.py
.
Sometimes its needed to pass additional environment strings to your app; in the near future, these strings would be able to use runtime variables like %{hostname}
. Right now, this can be achieved like that:
{
"slave": "main.py",
"environment": {
"SECRET_VARIABLE": "password",
"DEPLOYMENT_TYPE": "production"
}
}
Although it's preferred to use services to drive your application, sometimes a specific set of requirements forces developers to use event drivers for that task; event drivers are like services, but they run locally inside the app's engine thread and are only able to emit events once statically configured via the manifest. Drivers can be set up as follows:
{
"slave": "main.py",
"environment": {
"SECRET_VARIABLE": "password",
"DEPLOYMENT_TYPE": "production"
},
"drivers": {
"some-driver-name": {
"type": "filesystem-monitor",
"args": {
"path": "/path/to/some/file"
}
},
"some-other-driver-name": {
"type": "useless-driver-without-any-args"
}
}
}