Commit graph

1326 commits

Author SHA1 Message Date
John O'Connor
5c38ba240a (POOLER-160) Revise some smelly logger code
Need the logger code in promstats.rb so move logger initialisation to
the top of the vmpooler script, remove the class method from vmpooler.rb
and make appropriate downstream changes to metrics and pooler manger
handling.

This also means we can start decent logging in the API if we wish do.

Fixed up to rebase on top of Matts POOLER-158 changes
2020-06-29 19:52:14 +01:00
John O'Connor
bbd76bde4c (POOLER-160) Add Prometheus to pooler startup
This is a re-architect of the vmpooler initialisation code to:
1. Allow an API service for both manager and the api
2. Add the Prometheus endpoints to the web service.
   Needed to change the way the Rack Service is started as instantiating
   using ".New" leads to a failure to initialise the http Stats
   collection.
3. Selectively load the pooler api and/or Prometheus endpoints.
4. Rework API Spec tests for revised API loading. Needed to tidy up the
   initialisation and perform a reset! after each test to avoid "leaks"
   and dependencies between the tests.
2020-06-29 19:52:14 +01:00
John O'Connor
ffab7def9e (POOLER-160) Add Prometheus Stats Feeds
Add a new Prometheus class as an additional stats feed along with the
existing feeds.

Move the metrics initialisation code into its own class and sub-class
the individual metrics implementations under this.
2020-06-26 21:37:22 +01:00
John O'Connor
c6ab52372a (MAINT) Change redis.exists calls
The mock_redis backend.exists return code has change with release 0.24.
See https://github.com/sds/mock_redis/compare/v0.23.0...v0.24.0#diff-af51dcbfed678206fc95148d957ff5bf

This meant that some spec tests started to fail after the new gem was
released.

So have changed all backend.exists to use the safer exists? method.
2020-06-26 21:37:22 +01:00
John O'Connor
ab92eb366d (MAINT) Change Rubocop Screening
Screen out redundant begin block rubocop compliance checks as these
are causing vsphere.rb and pool_manager.rb to fail with differing
ruby version checks.
2020-06-26 21:36:50 +01:00
mattkirby
a2a3bb7dfd
Merge pull request #382 from puppetlabs/pooler-167
(POOLER-167) Allow for network configuration at vm clone time
2020-06-23 14:30:25 -07:00
John O'Connor
5eba958796
Merge pull request #384 from mattkirby/jruby_9211_notes
Add a note on jruby 9.2.11 and redis connection pooling changes
2020-06-16 10:19:47 +01:00
kirby@puppetlabs.com
c42448a86c Add a note on jruby 9.2.11 and redis connection pooling changes 2020-06-15 17:11:49 -07:00
Jenkins
ffe07a3140 (GEM) update vmpooler version to 0.13.3 2020-06-15 15:21:59 +00:00
Belen Bustamante
3dfd70fa0e Allow for network configuration at vm clone time 2020-06-12 11:56:41 -07:00
Samuel
4ecd5dea51
(POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158 (#383)
* (POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158
refactored every parsing of request of type 'pool_alias:pool:count' into a
utility class, that is used by pool_manager and the api v1 class
* add some metrics to the od request generation
* fix rubocop offenses, we are now friends
2020-06-11 12:39:34 -05:00
Jenkins
2afc2a242b (GEM) update vmpooler version to 0.13.2 2020-06-05 22:43:53 +00:00
Brandon High
fc4ae967af
Merge pull request #379 from mattkirby/graphite_error
Rescue and warn when graphite connection cannot be opened
2020-06-05 12:08:47 -07:00
kirby@puppetlabs.com
e390efbb10 Rescue and warn when graphite connection cannot be opened
This commit updates vmpooler graphite stats behavior when a connection cannot be opened to the graphite server to warn instead of allowing the full backtrace to be output to stderr. Without this change a backtrace is output to stderr when a graphite connection fails.
2020-06-05 11:27:49 -07:00
Jenkins
9f397f02fb (GEM) update vmpooler version to 0.13.1 2020-06-04 18:10:55 +00:00
Belén
621aa07c3c
Merge pull request #378 from puppetlabs/fix-merge-issue
(maint) Fix merge issue
2020-06-04 11:07:51 -07:00
Samuel Beaulieu
30b96536b3 (maint) Fix merge issue
It seems like generate_and_check_hostname does not need a method argument
this was fixed in one PR, and another change made in another PR and was used
inconsistently
2020-06-04 12:55:30 -05:00
Jenkins
7d6c887aed (GEM) update vmpooler version to 0.13.0 2020-06-04 00:35:41 +00:00
Brandon High
3fc9ee0f4f
Merge pull request #375 from mattkirby/pooler_158
(POOLER-158) Add support for ondemand provisioning
2020-06-03 17:22:16 -07: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
Belén
1f6f08d172
Merge pull request #377 from puppetlabs/pooler_166_on_master
(POOLER-166) Check for stale dns records
2020-06-03 08:53:34 -07:00
Samuel Beaulieu
41f097cc3e with the addition of dns_available, renaming available to hostname_available 2020-05-29 12:14:29 -05:00
Samuel Beaulieu
6304743240 (POOLER-166) Check for stale dns records 2020-05-29 12:05:54 -05:00
Jenkins
eb0df8d83f (GEM) update vmpooler version to 0.12.0 2020-05-28 18:16:25 +00:00
mattkirby
e36c6444cb
Merge pull request #376 from puppetlabs/pooler-171
(POOLER-171) Enable support for multiple user objects
2020-05-28 10:59:41 -07:00
Belen Bustamante
477f270b52 Enable support for multiple user objects 2020-05-28 10:42:47 -07:00
Jenkins
e9a79cb6db (GEM) update vmpooler version to 0.11.3 2020-04-29 15:02:04 +00:00
Brandon High
9b41a542e9
Merge pull request #374 from puppetlabs/DIO-608
(DIO-608) vmpooler SUT handed out multiple times
2020-04-23 17:03:34 -07:00
Samuel Beaulieu
9c6f50691d (DIO-608) vmpooler SUT handed out multiple times
Before this change if the smove returned false, we would continue handing out the VM
which presumably could still be in the 'ready' state. Upon 'delete' that ready VM would not be
picked up and return a 404 which is consistent with the behavior seen. Adding a metric to keep
track of the smove failures since this is not expected. I think some API logging would be good
to add in the future.
2020-04-23 16:10:36 -05:00
Brandon High
48b4fb9a6b
Merge pull request #373 from jcoconnor/MAINT-Update-Codeowners
(MAINT) Update CODEOWNERS
2020-04-16 10:29:51 -07:00
John O'Connor
56a6e61dc7 (MAINT) Update CODEOWNERS
Changing ownership to DIO
2020-04-16 18:25:51 +01:00
Jenkins
4019a082f0 (GEM) update vmpooler version to 0.11.2 2020-04-16 15:54:02 +00:00
Brandon High
5fac5684a9
Merge pull request #371 from puppetlabs/POOLER-161
(POOLER-161) Fix extending vm lifetime when max lifetime is set
2020-04-15 13:27:27 -07:00
Samuel Beaulieu
953aa68907 (POOLER-161) Fix extending vm lifetime when max lifetime is set
Before this PR, the current running time was being inspected to decide if the
vm lifetime could be extended. But since vm lifetime is absolute and not relative
this check is now removed.
2020-04-15 13:17:14 -05:00
Brandon High
9ab1b89a6c
Merge pull request #370 from mattkirby/purge_failed
(POOLER-165) Fix purge_unconfigured_folders
2020-04-07 11:27:36 -07:00
kirby@puppetlabs.com
fc616ce055 Fix rubocop offenses 2020-04-07 11:22:05 -07:00
kirby@puppetlabs.com
68ecb7a3a4 (POOLER-165) Fix purge_unconfigured_folders
This commit fixes the purge_unconfigured_folders feature to ensure that it can successfully identify folders and instances that are no longer used. Without this change the feature does not work as advertised.
2020-04-07 09:39:59 -07:00
Brandon High
04a3c448fd
Merge pull request #369 from puppetlabs/16c0dependabot/bundler/rake-gte-12.3-and-lt-14.0
Update rake requirement from ~> 12.3 to >= 12.3, < 14.0
2020-03-18 14:25:13 -07:00
Jenkins
451003484e (GEM) update vmpooler version to 0.11.1 2020-03-17 23:51:30 +00:00
Brandon High
458b862b63
Update CHANGELOG for 0.11.1 2020-03-17 16:45:08 -07:00
Brandon High
0c0ee0cdd2
rake gemspec dep in ~> format instead of range 2020-03-17 15:10:15 -07:00
dependabot-preview[bot]
526d88d673
Update rake requirement from ~> 12.3 to >= 12.3, < 14.0
Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v12.3.0...v13.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-17 19:33:09 +00:00
Brandon High
3e2ab2db5f
Merge pull request #367 from puppetlabs/dependabot
Add Dependabot to keep gems updated
2020-03-17 12:32:01 -07:00
Brandon High
0289dac4f0
Merge pull request #366 from mattkirby/update_gems
Update gem dependencies to latest versions
2020-03-17 12:31:08 -07:00
Brandon High
5cfad48aac
Merge pull request #368 from mattkirby/docker_compose_defaults
Remove providers addition to docker-compose.yml
2020-03-17 12:30:30 -07:00
kirby@puppetlabs.com
85cd1fb4ed Remove providers addition to docker-compose.yml 2020-03-17 12:17:53 -07:00
Brandon High
ad39b53445
Merge pull request #365 from mattkirby/pooler_156
(POOLER-156) Detect redis connection failures
2020-03-17 12:07:26 -07:00
a717e5c5ca
Add Dependabot to keep gems updated 2020-03-17 15:01:57 -04:00
kirby@puppetlabs.com
7597185fa4 Fix reference to unused e to satisfy rubocop 2020-03-17 11:24:03 -07:00
kirby@puppetlabs.com
9e5b434582 Update gem dependencies to latest versions
This commit updates vmpooler gem dependencies in Gemfile and gemspec files. Without this change vmpooler is pinned to out of date version of multiple libraries.
2020-03-17 11:20:57 -07:00