Commit graph

22 commits

Author SHA1 Message Date
Samuel Beaulieu
b859743694
(maint) Bump version to 2.4.0
Upgrade to jruby 9.3.6.0
Remove workaround for jruby 9.2 using JRUBY_OPTS=-Xinvokedynamic.yield=false
Removed unused dependency nokogiri?
2022-07-25 11:09:59 -05:00
72c82cf084
Add OTel HttpClient Instrumentation
This will be useful for the GCE provider.
2022-01-20 11:42:43 -05:00
f7eaeedbfc
Update dev tooling and related docs 2022-01-19 15:21:02 -05:00
6db71d8589
Update Dockerfile_local to rebuild faster
This makes it so that cached layers can be used when all that is
changing is VMPooler's code, and not its gems.
2021-11-04 13:32:21 -04:00
87abab272c
Adding make to the other two Dockerfiles 2020-09-18 15:29:05 -04:00
8f3039e321
Add distributed tracing (#399)
This change utilizes OpenTelemetry's automatic instrumentation to add
distributed tracing capabilities to VMPooler. This is a non-breaking
change as traces are processed in noop mode by default.
2020-09-17 15:35:21 -04:00
kirby@puppetlabs.com
811fd8b60f (POOLER-158) Add capability to provision VMs on demand
This change adds a capability to vmpooler to provision instances on
demand. Without this change vmpooler only supports retrieving machines
from pre-provisioned pools.

Additionally, this change refactors redis interactions to reduce round
trips to redis. Specifically, multi and pipelined redis commands are
added where possible to reduce the number of times we are calling redis.

To support the redis refactor the redis interaction has changed to
leveraging a connection pool. In addition to offering multiple
connections for pool manager to use, the redis interactions in pool
manager are now thread safe.

Ready TTL is now a global parameter that can be set as a default for all
pools. A default of 0 has been removed, because this is an unreasonable
default behavior, which would leave a provisioned instance in the pool
indefinitely.

Pool empty messages have been removed when the pool size is set to 0.
Without this change, when a pool was set to a size of 0 the API and pool
manager would both show that a pool is empty.
2020-06-03 14:00:04 -07:00
kirby@puppetlabs.com
85cd1fb4ed Remove providers addition to docker-compose.yml 2020-03-17 12:17:53 -07:00
kirby@puppetlabs.com
7597185fa4 Fix reference to unused e to satisfy rubocop 2020-03-17 11:24:03 -07:00
Brandon High
e7f53d659a
Pin to JRuby 9.2.9 in Dockerfiles
This commit pins all the `Dockerfile` to Jruby 9.2.9. This is an
attempt to narrow down if the JRuby 9.2.11 is the reason for the
StackOverflow we were seeing or if there is something strange going on
with an update to the Gemfiles.
2020-03-09 11:58:38 -07:00
Samuel
ae10bd4e22 (POOLER-123) Implement a max TTL (#349)
* (POOLER-123) Implement a max TTL

Before this change, we could checkout a vm and set the lifetime to a
very high number which would esssentially keep the vm running forever.
Now implementing a config setting max_lifetime_upper_limit which enforces
a maximum lifetime in hours both for initial checkout and extending a
running vm

* (POOLER-123) Improve PUT vm endpoint error messaging

Prior to this commit the PUT vm endpoint didn't give any useful
information about why a user's request failed.

This commit updates PUT to output a more helpful set of error messages
in the `failure` key that gets returned in the JSON response.

* (POOLER-123) Update max_lifetime_upper_limit key

This commit switches the max_lifetime_upper_limit key from being a
symbol to being a string, which is what the config hash seems to contain.

* (maint) Add option to disable Redis persistence in docker-compose

This commit is just a handy little command override to the redis
container to prevent persistence.
2019-12-05 09:35:30 -07:00
kirby@puppetlabs.com
09a382a10f Make it possible to disable linked clones
This commit adds a new configuration parameter to allow setting whether to create linked clones on a global, or per pool basis. Without this change vmpooler would always attempt to create linked clones. The default behavior of creating linked clones is preserved.
2019-08-06 14:29:31 -07:00
kirby@puppetlabs.com
d6e948d34d (POOLER-140) Ensure a VM is alive at checkout
This commit duplicates the vm_ready? check to the API layer to allow for API to validate that a VM is alive at checkout. Without this change API relies upon the checks in pool_manager validating pools. This change should allow for additional insight into whether a machine is in a ready state and resopnding at checkout time.
2019-07-17 12:03:55 -07:00
kirby@puppetlabs.com
0cc06f6eef (MAINT) Add bundler to dockerfile_local
This commit adds bundler to dockerfile_local in order to support building vmpooler. Without this change the dockerfile_local build fails reporting bundler is not available.
2019-04-11 11:54:00 -07:00
kirby@puppetlabs.com
3e26a8f998 (POOLER-139) Fix discovering checked out VM
This commit updates how vmpooler retrieves VMs to add a VM to the running queue as soon as it is checked out. Without this change it is possible that a VM can be discovered when it is checked out before it is added to the running queue if multiple systems are requested. Additionally, the dockerfile is updated to support specifying the version of vmpooler to install.
2019-02-13 16:43:55 -08:00
kirby@puppetlabs.com
cde7648a22 Update dockerfile jruby to 9.2
This commit updates jruby in dockerfiles from 9.1 to 9.2. Without this change the dockerfiles use a version of ruby that is no longer tested with vmpooler.
2019-01-22 15:01:30 -08:00
kirby@puppetlabs.com
3c856d7ae9 (POOLER-133) Identify when a ready VM has failed
This commit fixes checking of a VM that has already been identified as ready. Without this change a ready VM that has failed will be identified as having failed, but will not successfully be removed from the ready queue. Additionally, the default vm_checktime value has been reduced from 15 to 1 to ensure that ready VMs are checked within one minute of the time they have reached the ready state by default.

Lastly, the docker-compose files are updated to specify that the redis
instance used is a local redis instance.
2018-12-03 12:21:08 -08:00
kirby@puppetlabs.com
8bddb4f854 Add docker-compose and dockerfile to support it
This commit adds a docker-compose file and a dockerfile to build vmpooler and install it from source.
2018-09-21 13:39:04 -07:00
Samuel Beaulieu
3aac95d5b9 (POOLER-114) Refactor check_pool in pool_manager
This commit refactorss the check_pool method in pool_manager.
Specifically, each commented section describing a stage of check_pool is
broken out into a separate method and check_pool is simplified by
calling these methods. Without this change it is difficult to follow the
intent for or make changes to check_pool.

Additionally, a docker-compose file is added to make it simple to launch
an all-in-one vmpooler instance along with a separate redis server with
docker.
2018-08-23 14:04:52 -07:00
kirby@puppetlabs.com
7623058ae7 Update entrypoint in dockerfile for vmpooler gem
This commit updates dockerfile entrypoint to remove the explicit
vmpooler executable path. Additionally, CMD is added to run a default
command when runtime parameters are not passed in by the user. Without
this change the vmpooler executable path is hardcoded into a directory
that will not exist.
2018-07-17 16:01:22 -07:00
kirby@puppetlabs.com
fcb3880852 Configure vmpooler to run from bin/vmpooler 2018-07-14 15:49:58 -07:00
kirby@puppetlabs.com
528020fec7 (POOLER-109) Allow API to run independently
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.
2018-07-13 09:35:18 -07:00