mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
This commit updates vmpooler to allow the API component and dashboard to run separately from pool_manager. Without this change vmpooler does not offer a mechanism to run only the API, or pool_manager components. Two instances of hardcoded puma environment settings are removed. This is still set in the init script explicitly as well as via an environment variable in the dockerfile. To extend the mechanism of running the API or pool_manager components to instances running in docker an entrypoint is added in the dockerfile. The entrypoint allows a user to specify whether to run the API or pool_manager components when running the application. The default behavior is preserved where both components are run. To support these changes vmpooler.rb is updated to allow more of the configuration to be specified via individual environment variables. It was already possible to specify the entire config block as an environment variable, but this is more difficult to manage and less of a standard implementation than specifying individual parameters. Where specified environment variable options will override a value configured via the configuration file or environment. The running pool configuration when starting pool_manager is loaded to redis at pool_manager start time. This allows the API to load the running pool configuration from redis and be able to run without requiring the pool configuration. Lastly, the dockerfile leveraging entrypoint will no longer start vmpooler with the init script or write logs to a file. Instead, LOGFILE is set to /dev/stdout and the vmpooler application is started directly. This behavior is preferred because the log file writes to disk are an unnecessary overhead. Without this change the docker installation will attempt to daemonize the vmpooler application and always requires puma.
6 lines
68 B
Bash
6 lines
68 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
set -- /var/lib/vmpooler/vmpooler "$@"
|
|
|
|
exec "$@"
|