Giter Site home page Giter Site logo

dokku-logging-supervisord's Introduction

dokku-logging-supervisord

Deprecated as of Dokku 0.3.14 (process management) and 0.7.0 (restart policies)

dokku-logging-supervisord is a plugin for dokku that injects supervisord to run applications and redirects stdout & stderr to app/process specific log files (rather than the Docker default per-container JSON files).

Requirements

This plugin uses the docker-args hook to inject the data volume argument. As such, at the moment it only works with the development version of Dokku.

Installation

# Install the plugin:
# dokku 0.3.x
git clone https://github.com/sehrope/dokku-logging-supervisord.git /var/lib/dokku/plugins/logging-supervisord

# dokku 0.4+
dokku plugin:install https://github.com/sehrope/dokku-logging-supervisord.git

All future deployments will use this plugin to start all processes and all log output will be in /var/log/dokku/$APP/.

What it does

Normally, dokku only runs the web process within Procfile. The dokku-logging-supervisord plugin will run all process types (web, worker, etc.) and will restart crashed applications.

Additionally, it creates and binds a shared directory for each app from /var/log/dokku/$APP on the host machine to /var/log/app in the app's container. The supervisord config is setup to have each process in your Procfile send it's stdout and stderr to a separate file in that directory named $PROCESS_NAME.$PROCESS_NUM.log. Output for the supervisord process itself (startup/shutdown notices, etc) will be logged to a file named supervisor.log in the same log directory.

Example

If you have an app myapp with a Procfile that looks like this:

web: node web.js
worker: node worker.js

And you push your app with Dokku like this:

$ git push [email protected]:myapp master

Then upon starting it you would have log files at:

/var/log/dokku/myapp/supervisor.log
/var/log/dokku/myapp/web.00.log
/var/log/dokku/myapp/worker.00.log

Scaling

This plugin supports running multiple of the same process type. At start it checks for a file in the apps home diretory named SCALE. The file should be a series of lines of the form name=<num> where name is the process name and <num> is the number of processes of that type to start.

Example:

web=1
worker=5
clock=1

If the file does not exist then a single process of each type will be created for each process type in Procfile. Additional lines in the file ignored.

Logs for each process will go to separate log file in /var/log/dokku/$APP/process.<num>.log

Note: All the processes will run in same Docker container. They do not run in separate containers. This means that if you have multiple "web" processes they will each try to listen on the same PORT environment variable. For this to work properly you should use the socket option SO_REUSEPORT. If that is not available then you will need to stick with a single web process.

Rather than editing the file manually you can use the command:

dokku scale myapp web=1 worker=6

This will generate a new SCALE file and then deploy the app. An app rebuild will not happen. It will just kill and restart your application.

Adding the SCALE file is done by copying it into the container. This adds another layer to the container's AUFS. As there is a max number of layers you may need to occasionally run a rebuild (try dokku rebuild myapp) to rebase the container.

TODO

  • Better handle log file rotation
  • Add date/time to log output
  • Have the application runner see the scale file on the host so we don't have to copy it (volume mount?)

Thanks

Thanks to dokku-supervisord and dokku-persistent-storage as this plugin is really a combination of those two.

License

This plugin is released under the MIT license. See the file LICENSE.

dokku-logging-supervisord's People

Contributors

aljohri avatar arturaz avatar josegonzalez avatar kleinmann avatar michaelshobbs avatar sehrope avatar u2mejc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dokku-logging-supervisord's Issues

Does this break zero downtime deploys?

My Procfile looks like this:

web: node -r babel-register -r babel-polyfill src/web/index.js
mailer: node -r babel-register -r babel-polyfill src/mailer/index.js

When I push a new release or do a dokku ps:rebuild, right after it switches containers and reloads nginx, for a while (more than a minute) I see a page that says:

We're sorry, but something went wrong.
If you are the application owner check the logs for more information.

Googling for this phrase, apparently it's dokku's internal 500 error file for nginx:
https://github.com/dokku/dokku/blob/master/plugins/nginx-vhosts/templates/500-error.html

So, does this plugin break zero downtime deployment?

You cannot attach to a stopped container, start it first

We're seeing the aforementioned error occasionally when pushing our nodejs app. I think its in the dokku-logging-supervisord plugin as we never get past the "Releasing app" output from dokku and the last command to run is /bin/bash -c cat > '/build/procfile-to-supervisord'. In fact it's most likely happening on line 14 of lib/helpers. Do we need to attach there?

We are on the latest master of dokku-logging-supervisord and dokku.

---- Begin output of git push dokku@localhost:myapp.mydomain.com master ----
STDOUT:
-----> Cleaning up ...
-----> Building myapp.mydomain.com ...
remote: HEAD is now at b1c4df7... logo experiment
-----> Checking Hostkeys Plugin sanity ...
-----> Installing Hostkeys in build environment ...
No app keys available.
Adding shared keys.
-----> Done Installing Hostkeys in build environment ...
Added the following keys:
|1|M8rxTmTXpFjumpcmYqL3OXTDhDo=|ywAg1+aPQJSUvknRY0KM3VRjrlg= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
Node.js app detected
-----> Requested node range: 0.10.25
-----> Resolved node version: 0.10.25
-----> Downloading and installing node
-----> Restoring node_modules directory from cache
-----> Pruning cached dependencies not specified in package.json
-----> Writing a custom .npmrc to circumvent npm bugs
-----> Installing dependencies
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/expa
npm http 404 https://registry.npmjs.org/expa
-----> Caching node_modules directory for future builds
-----> Cleaning up node-gyp and npm artifacts
-----> Building runtime environment
-----> Discovering process types
Procfile declares types -> web
-----> Releasing myapp.mydomain.com ...
remote: 2014/04/09 04:16:57 You cannot attach to a stopped container, start it first
To dokku@localhost:myapp.mydomain.com
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@localhost:myapp.mydomain.com'
---- End output of git push dokku@localhost:myapp.mydomain.com master ----
Ran git push dokku@localhost:myapp.mydomain.com master returned 1

Railsapp with Unicorn: invalid argument: -p -c (OptionParser::InvalidArgument)

Trying this out I suddenly notice the following entries in my rails apps log:

/app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.8.3/bin/unicorn:110:in `block in <top (required)>': invalid argument: -p -c (OptionParser::InvalidArgument)
from /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.8.3/bin/unicorn:10:in `new'
from /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.8.3/bin/unicorn:10:in `<top (required)>'
from /app/vendor/bundle/ruby/2.2.0/bin/unicorn:23:in `load'
from /app/vendor/bundle/ruby/2.2.0/bin/unicorn:23:in `<main>'

Any idea how to fix?

Scale operation does not restart application

I'm not sure if something has changed in the master branch of https://github.com/progrium/dokku but I am unable to use the scale command.

# dokku scale gymboree worker=2 web=1
Checking for existing running application
Existing running application found. Will kill it.
Killed running application.
Scaling app gymboree:
     1  worker=2
     2  web=1
2014/03/18 21:51:21 You cannot attach to a stopped container, start it first
# docker -v
Docker version 0.9.0, build 2b3fdf2

# dokku version
dev-106-g4907c3c

dokku-logging-supervisord causes dokku deployment to fail

Hey everyone,

I'm able to deploy my app successfully without the plugin, but deployment fails with it installed. I'm very new to dokku, but can you please help me figure out what's going on?

Here's the gist from the dokku log:

remote: + echo '-----> Releasing mojito ...'
remote: + dokku release mojito
-----> Releasing mojito ...
remote: ++ id -un
remote: + [[ dokku != \d\o\k\k\u ]]
remote: + [[ -n '' ]]
remote: + case "$1" in
remote: + APP=mojito
remote: + IMAGE=dokku/mojito
remote: + pluginhook pre-release mojito
remote: + [[ -f /home/dokku/mojito/ENV ]]
remote: + pluginhook post-release mojito
remote: + APP=mojito
remote: + IMAGE=dokku/mojito
remote: + SCALE_FILE=/home/dokku/mojito/SCALE
remote: ++ dirname /var/lib/dokku/plugins/logging-supervisord/post-release
remote: + PLUGIN_DIR=/var/lib/dokku/plugins/logging-supervisord
remote: + . /var/lib/dokku/plugins/logging-supervisord/lib/helpers
remote: ++ docker run -d dokku/mojito test -f app/Procfile
remote: + id=0fa66c283de3fdb4bc18e8241e6301179e57dfdbc39833ace712fd81f3f02bb6
remote: ++ docker wait 0fa66c283de3fdb4bc18e8241e6301179e57dfdbc39833ace712fd81f3f02bb6
remote: + '[' 0 -ne 0 ']'
remote: + copy_to_container /var/lib/dokku/plugins/logging-supervisord/lib/procfile-to-supervisord /build/procfile-to-supervisord
remote: + SOURCE_FILE=/var/lib/dokku/plugins/logging-supervisord/lib/procfile-to-supervisord
remote: + TARGET_FILE=/build/procfile-to-supervisord
remote: + '[' '!' -f /var/lib/dokku/plugins/logging-supervisord/lib/procfile-to-supervisord ']'
remote: ++ docker run -i -a stdin dokku/mojito /bin/bash -c 'cat > '\''/build/procfile-to-supervisord'\'''
remote: ++ cat /var/lib/dokku/plugins/logging-supervisord/lib/procfile-to-supervisord
remote: + id=5dba014dfa3bef43eb59ca958fe397f1c0c1bd567bcbeeffc4ef89f4e765e648
remote: ++ docker wait 5dba014dfa3bef43eb59ca958fe397f1c0c1bd567bcbeeffc4ef89f4e765e648
remote: + test 0 -eq 0
remote: + docker commit 5dba014dfa3bef43eb59ca958fe397f1c0c1bd567bcbeeffc4ef89f4e765e648 dokku/mojito
remote: + '[' -f /home/dokku/mojito/SCALE ']'
remote: + echo '-----> Injecting Logging Supervisor ...'
remote: + docker run -a stdout -i dokku/mojito /usr/bin/dpkg -s supervisor
-----> Injecting Logging Supervisor ...
remote: + echo 'supervisor is not installed (will install via apt-get)'
supervisor is not installed (will install via apt-get)
remote: ++ docker run -i -a stdin dokku/mojito /bin/bash -c 'apt-get update && apt-get install -y supervisor && apt-get clean'
remote: + id=ca4ae34de9a5d2ea4628237735b3200fec3efd1afb344e1fbe4580c417ce1b6f
remote: ++ docker wait ca4ae34de9a5d2ea4628237735b3200fec3efd1afb344e1fbe4580c417ce1b6f
remote: + test 100 -eq 0
remote: + exit_code=1
remote: + set -e
remote: + '[' 1 -eq 10 ']'
remote: + implemented=1
remote: + '[' 1 -ne 0 ']'
remote: + exit 1
+ exit_code=0
+ set -e
+ '[' 0 -eq 10 ']'
+ implemented=1
+ '[' 0 -ne 0 ']'
+ for script in '$(ls -d $PLUGIN_PATH/*/commands)'
+ set +e
+ /var/lib/dokku/plugins/logging-supervisord/commands git-receive-pack ''\''mojito'\'''
++ dirname /var/lib/dokku/plugins/logging-supervisord/commands
+ PLUGIN_DIR=/var/lib/dokku/plugins/logging-supervisord
+ . /var/lib/dokku/plugins/logging-supervisord/lib/helpers
+ case "$1" in
+ exit_code=0
+ set -e
+ '[' 0 -eq 10 ']'
+ implemented=1
+ '[' 0 -ne 0 ']'
+ for script in '$(ls -d $PLUGIN_PATH/*/commands)'
+ set +e
+ /var/lib/dokku/plugins/nginx-vhosts/commands git-receive-pack ''\''mojito'\'''
+ case "$1" in
+ exit 10
+ exit_code=10
+ set -e
+ '[' 10 -eq 10 ']'
+ continue
+ '[' 1 -eq 0 ']'
+ exit 0
To [email protected]:mojito
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:mojito'

Thanks very much!

No longer appears to work.

Heya, I followed the install instructions but no logs are showing up in /var/log/dokku/ and the process isn't being restarted.

dokku plugins shows the plugin but it doesn't appear to be working. This is with dokku v0.3.19.

Failure to start app

I just tried simple example https://github.com/heroku/node-js-sample with Procfile

web: node index.js

I got lots of restarts of process

tail -f /var/log/dokku/testjs/web.00.log
2014-12-23 15:52:21,643 INFO supervisord started with pid 175
2014-12-23 15:52:22,645 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-12-23 15:52:22,647 INFO spawned: 'web' with pid 178
Generated supervisord.conf:
     1  [supervisord]
     2  logfile=/var/log/app/supervisor.log
     3  loglevel=info
     4  nodaemon=true
     5
     6  [program:web]
     7  command=/exec 'node index.js'
     8  process_name:%(program_name)s
     9  numprocs=1
    10  autostart=true
    11  autorestart=true
    12  stopsignal=QUIT
    13  redirect_stderr=true
    14  stdout_logfile=/var/log/app/%(program_name)s.%(process_num)02d.log
2014-12-23 15:52:22,788 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:22,791 INFO supervisord started with pid 189
2014-12-23 15:52:23,793 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-12-23 15:52:23,796 INFO spawned: 'web' with pid 192
Generated supervisord.conf:
     1  [supervisord]
     2  logfile=/var/log/app/supervisor.log
     3  loglevel=info
     4  nodaemon=true
     5
     6  [program:web]
     7  command=/exec 'node index.js'
     8  process_name:%(program_name)s
     9  numprocs=1
    10  autostart=true
    11  autorestart=true
    12  stopsignal=QUIT
    13  redirect_stderr=true
    14  stdout_logfile=/var/log/app/%(program_name)s.%(process_num)02d.log
2014-12-23 15:52:23,936 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:23,940 INFO supervisord started with pid 203
tail -f /var/log/dokku/testjs/supervisor.log 
2014-12-23 15:52:25,089 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:25,092 INFO supervisord started with pid 217
2014-12-23 15:52:26,095 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-12-23 15:52:26,097 INFO spawned: 'web' with pid 220
2014-12-23 15:52:26,244 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:26,248 INFO supervisord started with pid 231
2014-12-23 15:52:27,250 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-12-23 15:52:27,251 INFO spawned: 'web' with pid 234
2014-12-23 15:52:27,400 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:27,403 INFO supervisord started with pid 245
2014-12-23 15:52:28,404 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-12-23 15:52:28,406 INFO spawned: 'web' with pid 248
2014-12-23 15:52:28,545 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:28,549 INFO supervisord started with pid 259
2014-12-23 15:52:29,552 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-12-23 15:52:29,555 INFO spawned: 'web' with pid 262
2014-12-23 15:52:29,712 CRIT Supervisor running as root (no user in config file)
2014-12-23 15:52:29,717 INFO supervisord started with pid 273

I use this (with hacked /build dir) and fork https://github.com/expa/dokku-logging-supervisord, both have same behaviors.

Docker hangs with dokku-logginer-supervisord installed

Fresh install of dokku v4.0.4, install this plugin, then deploy my app. Sometimes it works for a few pushes, then deployments/restarts hang and never work again.

A dokku --trace ps:restart shows that the deployment hangs on this line. Running the same command from the CLI also just hangs:

docker run -i -a stdin dokku/myapp:latest /bin/bash -c 'if [[ -L /exec ]];then rm -f /exec && cp -f /start /exec; fi'

I uninstalled the plugin and everything works again.

I'm by no means a docker expert so I'm not sure what's going on beyond that, but I'm happy to debug/test if anyone has ideas.

Thanks,
Ryan

Problem After try to config:set something

When i try to config:set some key then my dokku Application deployed:
I got this error in my web.00.log file
Errno 2] No such file or directory: '/app/static/CACHE/css/872fa5081801.css'
[Errno 2] No such file or directory: '/app/static/CACHE/css/c6e8c66a889f.css'
[Errno 2] No such file or directory: '/app/static/CACHE/css/758c32c09d4e.css'
[Errno 2] No such file or directory: '/app/static/CACHE/js/daabd9e2de7a.js'
[Errno 2] No such file or directory: '/app/static/CACHE/css/872fa5081801.css'
[Errno 2] No such file or directory: '/app/static/CACHE/css/872fa5081801.css'
[Errno 2] No such file or directory: '/app/static/CACHE/css/c6e8c66a889f.css'
[Errno 2] No such file or directory: '/app/static/CACHE/js/daabd9e2de7a.js'
[Errno 2] No such file or directory: '/app/static/CACHE/css/758c32c09d4e.css'
[Errno 2] No such file or directory: '/app/static/CACHE/css/c6e8c66a889f.css'
[Errno 2] No such file or directory: '/app/static/CACHE/js/daabd9e2de7a.js'
[Errno 2] No such file or directory: '/app/static/CACHE/css/758c32c09d4e.css'
[Errno 2] No such file or directory: '/app/static/CACHE/css/872fa5081801.css'

all my static file gone but if i just push again from my desktop it will work fine !

Is this dokku-logging-supervisord bug ?​

Don't work with Dokku 0.4

I believe that plugin system changed in v0.4. Now you can list all installed plugins by dokku command. There's an error in that listing:

# dokku plugin
  00_dokku-standard    0.4.0 enabled    dokku core standard plugin
  20_events            0.4.0 enabled    dokku core events logging plugin
  app-predeploy-tasks  0.1.0 enabled    Run arbitrary app tasks prior to dokku's deploy phase
  apps                 0.4.0 enabled    dokku core apps plugin
  backup               0.4.0 enabled    dokku core backup plugin
  build-env            0.4.0 enabled    dokku core build-env plugin
  certs                0.4.0 enabled    dokku core certificate management plugin
  checks               0.4.0 enabled    dokku core checks plugin
  common               0.4.0 enabled    dokku core common plugin
  config               0.4.0 enabled    dokku core config plugin
  docker-options       0.4.0 enabled    dokku core docker-options plugin
  domains              0.4.0 enabled    dokku core domains plugin
  enter                0.4.0 enabled    dokku core enter plugin
  git                  0.4.0 enabled    dokku core git plugin
cat: /var/lib/dokku/plugins/available/logging-supervisord/plugin.toml: No such file or directory
panic: interface conversion: interface is nil, not map[string]interface {}

goroutine 1 [running]:
runtime.panic(0x5ffd60, 0xc2100520c0)
    /usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
main.TomlGet(0xc21000a030, 0x2, 0x2)
    /tmp/tmp/plugn/plugn.go:30 +0x1d1
github.com/progrium/go-basher.(*Context).HandleFuncs(0xc21000f320, 0xc21000a000, 0x5, 0x5, 0x0)
    /home/vagrant/gocode/src/github.com/progrium/go-basher/basher.go:182 +0x2ac
github.com/progrium/go-basher.Application(0xc21001edb0, 0x7fa13ec1df00, 0x4, 0x4, 0x6aeb20, ...)
    /home/vagrant/gocode/src/github.com/progrium/go-basher/basher.go:64 +0x4d2
main.main()
    /tmp/tmp/plugn/plugn.go:98 +0x431

goroutine 3 [runnable]:
os/signal.loop()
    /usr/lib/go/src/pkg/os/signal/signal_unix.go:19
created by os/signal.init·1
    /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x31
cat: /var/lib/dokku/plugins/available/logging-supervisord/plugin.toml: No such file or directory
panic: interface conversion: interface is nil, not map[string]interface {}

goroutine 1 [running]:
runtime.panic(0x5ffd60, 0xc2100520c0)
    /usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
main.TomlGet(0xc21000a030, 0x2, 0x2)
    /tmp/tmp/plugn/plugn.go:30 +0x1d1
github.com/progrium/go-basher.(*Context).HandleFuncs(0xc21000f320, 0xc21000a000, 0x5, 0x5, 0x0)
    /home/vagrant/gocode/src/github.com/progrium/go-basher/basher.go:182 +0x2ac
github.com/progrium/go-basher.Application(0xc21001edb0, 0x7fa1b8c4af00, 0x4, 0x4, 0x6aeb20, ...)
    /home/vagrant/gocode/src/github.com/progrium/go-basher/basher.go:64 +0x4d2
main.main()
    /tmp/tmp/plugn/plugn.go:98 +0x431

goroutine 3 [runnable]:
os/signal.loop()
    /usr/lib/go/src/pkg/os/signal/signal_unix.go:19
created by os/signal.init·1
    /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x31
  logging-supervisord        enabled
  logs                 0.4.0 enabled    dokku core logs plugin
  nginx-vhosts         0.4.0 enabled    dokku core nginx-vhosts plugin
  plugin               0.4.0 enabled    dokku core plugin plugin
  postgres             1.0.0 enabled    dokku postgres service plugin
  ps                   0.4.0 enabled    dokku core ps plugin
  shell                0.4.0 enabled    dokku core shell plugin
  tags                 0.4.0 enabled    dokku core tags plugin
  tar                  0.4.0 enabled    dokku core tar plugin

Maybe we can take an inspiration what to update from app-predeploy-tasks plugin, which as you can see works.

Cannot define custom stdout/stderr output

I'm having an issue getting a custom output to work.

My package.json has the following start script:

"start": "npm run server & npm run batch-deploy",

"server": "node server/server.js >> /var/log/dokku/studio-sensors/node.log 2>> /var/log/dokku/studio-sensors/node.err",
"batch-deploy": "node server/batch-deploy.js >> /var/log/dokku/studio-sensors/batch-deploy.log 2>> /var/log/dokku/studio-sensors/batch-deploy.err"

I would have thought that since /var/log/dokku/studio-sensors is being mounted as a volume, it would be accessible inside the container, however, I'm getting the following error when running:

sh: 1:
cannot create /var/log/dokku/studio-sensors/node.log: Directory nonexistent

Am I doing something wrong, or is this not possible?

Alternatively, is there another way to get the 2 processes to output to independent files? Less concerned with stderr and stdout being separate, as much as having the server task and batch-deploy task have separate output.

Restarting app hangs on supervisor install

This seems to be a rehash of a couple of old issues... I have the same node app running on two different DO droplets. On one I was able to install dokku-logging-supervisord without issues and it worked after restarting my app. On the other installation was also simple... but I cannot restart my app. It consistently hangs after these lines:

admin@SERVER:~$ dokku ps:restart APP
-----> Releasing APP (dokku/APP:latest)...
-----> Injecting Logging Supervisor ...
supervisor is not installed (will install via apt-get)

Here are the Docker logs from the (exited) container:

Get:1 http://apt.postgresql.org trusty-pgdg InRelease [30.2 kB]
Ign http://archive.ubuntu.com trusty InRelease
Get:2 http://archive.ubuntu.com trusty-security InRelease [64.4 kB]
Get:3 http://apt.postgresql.org trusty-pgdg/main amd64 Packages [65.8 kB]
Get:4 http://archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Get:5 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:6 http://archive.ubuntu.com trusty-security/main amd64 Packages [477 kB]
Get:7 http://archive.ubuntu.com trusty-updates/main amd64 Packages [836 kB]
Get:8 http://archive.ubuntu.com trusty Release [58.5 kB]
Get:9 http://archive.ubuntu.com trusty/main amd64 Packages [1743 kB]
Get:10 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB]
Fetched 10.9 MB in 4s (2568 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  python-meld3 python-pkg-resources
Suggested packages:
  python-distribute python-distribute-doc
The following NEW packages will be installed:
  python-meld3 python-pkg-resources supervisor
0 upgraded, 3 newly installed, 0 to remove and 73 not upgraded.
Need to get 415 kB of archives.
After this operation, 1878 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main python-pkg-resources all 3.3-1ubuntu2 [61.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/universe python-meld3 amd64 0.6.10-1 [39.0 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe supervisor all 3.0b2-1 [314 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 415 kB in 2s (163 kB/s)
Selecting previously unselected package python-pkg-resources.
(Reading database ... 48495 files and directories currently installed.)
Preparing to unpack .../python-pkg-resources_3.3-1ubuntu2_all.deb ...
Unpacking python-pkg-resources (3.3-1ubuntu2) ...
Selecting previously unselected package python-meld3.
Preparing to unpack .../python-meld3_0.6.10-1_amd64.deb ...
Unpacking python-meld3 (0.6.10-1) ...
Selecting previously unselected package supervisor.
Preparing to unpack .../supervisor_3.0b2-1_all.deb ...
Unpacking supervisor (3.0b2-1) ...
Setting up python-pkg-resources (3.3-1ubuntu2) ...
Setting up python-meld3 (0.6.10-1) ...
Setting up supervisor (3.0b2-1) ...
invoke-rc.d: policy-rc.d denied execution of start.

I don't recall any significant different in the way I set up the droplets or Dokku. How is policy-rc.d defined and do I need to adjust it for dokku-logging-supervisord to run properly? Thanks!

Mimic Heroku cli parameters to run > 1 process per app

Heroku's command-line heroku supports concurrency this way:

heroku ps:scale web=2 worker=3
   Scaling web processes... done, now running 2
   Scaling worker processes... done, now running 3

How feasible is it to implement a slightly modified parameter for this plugin?

Something along the lines of:

dokku:supervisord scale web=2 worker=3
   Scaling web processes... done, now running 2
   Scaling worker processes... done, now running 3

Could this be achieved by using by incrementing/decremnting the numprocs setting in supervisord.conf and then reloading the configuration file by sending a SIGHUP signal to the supervisord process?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.