Commit graph

248 commits

Author SHA1 Message Date
Samuel
38f24f4ad1
Release prep for v1.3.0 2021-03-03 12:25:08 -06:00
Samuel
55ead89ab2
Merge pull request #134 from puppetlabs/DIO-1522
(DIO-1522) Show the VM state (running, destroyed) and colorize in red…
2021-02-25 13:24:57 -06:00
Samuel Beaulieu
8143641f83
(DIO-1522) Show the VM state (running, destroyed) and colorize in red when it has been deleted
the ABS system does not have a real sense of the current state of the resources
it has allocated. When running list --active it can list VMs that have been
deleted or reaped after their lifetime expired.
This change enables to show more information when a vmpooler_fallback service
is provided to ABS, and will show the state (running, destroyed) and colorize
in red when the VM is destroyed.
2021-02-25 10:14:41 -06:00
a9c8d17e9a
Release prep for 1.2.0 2021-02-11 10:16:21 -05:00
Samuel Beaulieu
4192631d70 (DIO-908) Adding a way to set Logger level via --loglevel
this is specially useful if you also use in combination --json to remove superfluous stdout
2021-02-09 15:38:43 -06:00
Samuel Beaulieu
a3d8484124 (DIO-908) Floaty can now report the status of ABS requests
- If ABS queries returns a body for 200 or 202, floaty will print it
this is useful in the new version of ABS, since it shows the progress
for ondemand requests (AWS or vmpooler)
- removed the queue_place and querying the queue for a 'get' request
this queue_place number was misleading since it was just a redis index
and did not represent well where the request was in the queue
- Also added a flag option --continue to be used when the cli was
interrupted for example with ctrl-c
2021-02-09 11:29:19 -06:00
Samuel Beaulieu
ced6b46032 (v1.1.1) Prepare for pushing the gem to rubygems 2020-10-16 13:15:15 -05:00
Samuel Beaulieu
846cc7050c when missing, adds the api/v2 to the url endpoint 2020-10-16 13:14:57 -05:00
Samuel
ad8196970c
Merge branch 'master' into maint/dont-require-fallback-config 2020-10-09 14:54:29 -05:00
e146857706
Merge pull request #103 from cthorn42/maint/master/add_vmpooler_fallback_to_service_check
(maint) Add vmpooler_fallback to the get service check
2020-10-09 11:52:24 -04:00
3ce0222b38
Merge pull request #105 from puppetlabs/dont-require-vmfloaty.yml-list
(maint) Don't require config file for list --active
2020-10-09 11:45:13 -04:00
221f6c18cc
Merge pull request #107 from puppetlabs/fix-jobid-uniqueness
(maint) Add more uniqueness to jobid and useful termination message
2020-10-09 11:44:29 -04:00
Samuel Beaulieu
671623bc4f handle ctrl-c and term signal and return useful message on how
to query ABS for the state of the request or to delete it
2020-10-09 10:37:16 -05:00
Samuel Beaulieu
e0fac0bb6c (maint) Add more uniqueness to jobid
Before this change there was a non zero chance that two requests could be received
at the same millisecond and have the same jobid. Added the username as a prefix
to the job id
2020-10-09 10:23:23 -05:00
Samuel Beaulieu
fbd98f93ae (maint) Fix bug with detecting ABS service
Before this change the code would try to check if an object was ABS
by using is_a? which is only for instances of a class. It also compared
with ABS.class which returns the Class class.
Now fixed by comparing the object to the static class
2020-10-09 10:18:53 -05:00
Nate Wolfe
56f0896d48
(maint) Don't require configuration file for get
Make the vmpooler_fallback optional for cases when there's no
configuration file and everything is specified on the CLI invocation.
2020-09-24 12:32:29 -07:00
Samuel Beaulieu
3a60ffbdbd (maint) Don't require config file for list --active
Will fallback to printing ABS information, which is less than what you
get if vmpooler_fallback is available
2020-09-24 09:46:22 -05:00
Christopher Thorn
5c8aa13081 (maint) Add vmpooler_fallback to the get service check
Previously the vmpooler_fallback setting was not being recognizied, this
PR will fix it.
2020-09-23 15:06:24 -07:00
d9b5bb5e89
Bump to version 1.0.0 2020-09-22 12:02:56 -04:00
bc1ea2e2d9
Merge pull request #90 from scotje/add_zsh_completions_new
Add tab completion script for zsh and fix bash completion for ABS services
2020-09-22 11:56:31 -04:00
Samuel Beaulieu
2b56448d50 Fix pretty print when multiple backend services
are returned by ABS. Added test with vmpooler and nspooler result
2020-09-22 09:53:13 -05:00
Jesse Scott
dee735e017
(FIXUP) Collect hostnames in array before outputting 2020-09-21 16:55:09 -07:00
Jesse Scott
b31f44fb40
Add --hostnameonly option to floaty list --active
Adds an option to the `floaty list` subcommand so that, when listing
active hosts, floaty will output just the hostnames, without any
additional information or formatting. Hostnames will be separated by a
newline.

This functionality is primarily intended for consuming by tooling (such
as the tab completion scripts).
2020-09-21 16:55:07 -07:00
Jesse Scott
40072e90e4
Fix print_to_stderr option for Utils.pretty_print_hosts
Previously this option had no effect on the output. This commit makes
the option effective and also refactors the tests for this method to
cover this case.
2020-09-21 16:54:17 -07:00
Samuel Beaulieu
cd7c0fae13 Adding spec tests for #list 2020-09-21 15:20:22 -05:00
Samuel Beaulieu
4df970b21f (maint) Fix for ABS PR#306 that includes json responses
Before this change ABS sometiimes returned a string of JSON with escaped
quotes, that had to be parsed again
With this change, floaty should accept both the legacy and the new
full JSON responses.
2020-09-21 14:46:00 -05:00
mattkirby
f3cd540455
Merge pull request #98 from puppetlabs/better-abs-config
(maint) Support any vmpooler for ABS via vmpooler_fallback
2020-09-17 10:08:05 -07:00
mattkirby
81c6e48528
Merge pull request #97 from puppetlabs/types-docs
(DIO-991) Add service command
2020-09-17 08:58:24 -07:00
mattkirby
e34964be00
Merge pull request #96 from puppetlabs/dio-911
( DIO-911) Include job_id in ABS --json output
2020-09-17 08:55:43 -07:00
9e61247cfe
Add service command
This change creates the `floaty service` command with two valid
arguemnts: types and examples

- `floaty service types` prints out a list of valid types for use in a
  service definition in ~/.vmfloaty.yml
- `floaty service examples` prints out example configuration files for
  both a single service and multiple services.
2020-09-16 12:55:42 -04:00
Samuel Beaulieu
5333158bdc (maint) Support any vmpooler for ABS via vmpooler_fallback
Before this change, the fallback vmpooler for ABS had to be named
'vmpooler' and it only supported one. With this new code, users can
set a key within an 'abs' service type called vmpooler_fallback that
points to any other service configured in the ~/.vmfloaty.yml config
file. If not set, the appropriate error message is returned, with
an example configuration.
Added the various use cases for the config to the unit tests
2020-09-16 11:25:49 -05:00
Samuel Beaulieu
dbf6c54173 The main goal for this PR is to enable using all of the vmfloaty scenarios when
the service is set to ABS. Since ABS does not implement all the services, it
fallsback on vmpooler when needed (example increasing the lifetime value)

- Validating JSON can be parsed before parsing, as it used to throw uncaught errors
- self.list_active is returning hosts for both nspooler and vmpooler but was returning
job_ids for abs. Now standardized the returned values for use in the "modify" cli,
and created a separate list_active_job_ids for the cases where a job_id list is expected

- added a way to change the service in place for methods that do not make sense
for ABS, and instead fallback on using vmpooler in those cases:
1. summary
2. modify
3. snapshot
4. revert
5. disk
For those methods in the class itself, raising a NoMethodError, in case it is used directly

- query now returns the queue info. For information on VMs, users should use --service vmpooler
- pretty_print_hosts (used in list, and delete scenarios) will now print the job_id
ABS information and indent each VM within and print it's metadata. Useful for
knowing the running time and extending it.

- added a new utility method to get the config for the vmpooler service, used for the fallback
- added a passthrough for the vmpooler token to use when running ABS. This enables
vmpooler to track the VMs used by each token (user). Also aligns the list between
both ABS and vmpooler. Fixes the bit-bar issue where the VMs do not appear when created
via ABS
2020-09-11 13:38:24 -05:00
Nate Wolfe
cb1ea8247b
WIP (DIO-911) Include job_id in ABS --json output
Prior to this commit, when using --service=abs and --json the job_id
value is not included in the JSON blob, which makes it difficult for
calling code to grab both the job_id and the hosts without text
processing the log messages printed to standard error.
2020-08-24 16:07:49 -07:00
Nate Wolfe
9a44cc480e
(maint) Add --user CLI option on delete and list subcommands
To support usage without a configuration file.
2020-08-24 12:11:06 -07:00
Nate Wolfe
8341a5f45d
(maint) Mention configuration file in CLI help text description
So users can be aware of the configuration file since it will no
longer be emitted as a warning during CLI invocation.
2020-08-21 15:45:10 -07:00
Nate Wolfe
04c73a970d
(maint) Remove warning about missing configuration file
Previously the CLI would emit a warning about missing configuration
file, but a configuration file does not appear to be a requirement, at
least based on the documentation and the fact that everything can be
specified directly on the command line.

This commit simply removes the warning.

Users will no longer get a warning when doing things like `floaty
--version`, `floaty help`, and any other subcommand.
2020-08-21 14:38:04 -07:00
kirby@puppetlabs.com
3f10e987b4 Update version for 0.11.1 release 2020-08-20 14:06:08 -07:00
mattkirby
d3d6ebeb1a
Merge pull request #86 from McdonaldSeanp/json_output
Json output for delete/list + better ABS error handling
2020-08-20 14:02:53 -07:00
mattkirby
13fee7ef13
Merge pull request #87 from jarretlavallee/fix/master/nspooler
Fix the argument list for nonstandardpooler
2020-08-20 14:01:38 -07:00
Christopher Thorn
701534872d (maint) Fix using ABS service without a .vmfloaty.yml file
If you do not use a config file, and define everything on the command line,
previously the service always defaulted to vmpooler. Even if you requested ABS.
This PR fixes that, now we'll see if the config has no service defined and we
defined on the command line a service, we'll use that service.
2020-08-20 11:37:20 -07:00
Jarret Lavallee
e684933525 (maint) Fix the argument list for nonstandardpooler
Prior to this commit, 7 arguments would be sent into the `retrieve`
method in nonstandardpooler. There were only 6 arguments in the method
definition so an error would be thrown. This commit adds the `ondemand`
argument to the `retrieve` method, but does not utilize it.
2020-08-13 12:37:09 -06:00
Sean P. McDonald
1eaa80706c
(maint) Fail in ABS when queue requests don't return 200/202
When ABS returns an http status code other than 200 or 202, the ABS code
should fail
2020-08-12 16:14:02 -05:00
Sean P. McDonald
d22e2b4194
(new-feature) Add json option to list/delete command
This commit adds an option `--json` to the list and delete commands. When the
json flag is used the commands will print output as formatted JSON rather than
pretty printed strings.
2020-08-12 16:13:58 -05:00
kirby@puppetlabs.com
b44b9c6e98 Bump version for 0.11.0 release 2020-08-12 11:47:58 -07:00
Austin Blatt
35faeab6be Move logger instance to class var in FloatyLogger
This moves the instance of the logger class to a class variable in the
`FloatyLogger` class and provides three class methods to log with in the
rest of the project `FloatyLogger.info`, `FloatyLogger.warn`, and
`FloatyLogger.error`.
2020-08-12 09:57:18 -07:00
barriserloth
8ec90007ca Use Logger for non-result output
This adds the Logger class for log output, all of which goes to STDERR,
and uses puts to send only the command result to STDOUT.
2020-08-11 12:41:22 -07:00
Austin Blatt
4755343df2 Print all non-success output to STDERR 2020-08-10 16:20:25 -07:00
kirby@puppetlabs.com
a245316252 Bump version to 0.10.0 for release 2020-08-04 15:16:19 -07:00
kirby@puppetlabs.com
05a133fc72 Add support for ondemand provisioning to vmfloaty
This commit adds support for provisioning instances on demand with
vmpooler. Additionally, this change adds a capability to detect on
demand pools available in ABS. Without this change vmfloaty does not
support provisioning instances via the vmpooler ondemand endpoints.
2020-08-04 11:24:11 -07:00
28fb9290d4
Update docs
This chane updates docs to reflect that ownership has moved to the DIO
team at Puppet. It also includes some formatting changes.
2020-07-02 12:52:32 -04:00