sophia
92a0b1c541
Allow remote machine to be initialized with just a machine client
2022-05-04 11:23:06 -05:00
sophia
31393eb3a9
Fill in some missing target client functions
2022-05-04 11:22:41 -05:00
sophia
0117c01e4b
Fill in environment remote class
2022-05-04 11:22:41 -05:00
sophia
f340e192f2
Fill in project ruby client
2022-05-04 11:22:41 -05:00
sophia
0a37521ef2
Remove reload machine function from the grpc api
2022-05-04 09:32:36 -05:00
sophia
6dfca17d54
Get machine state from go impl
2022-05-04 09:32:36 -05:00
sophia
b4fbf76a33
Plug machine#uid methods into remote go backend
2022-05-04 09:32:36 -05:00
sophia
adf2340712
Update Ruby clients for proto changes
2022-04-25 14:12:28 -05:00
sophia
cddcfef0a1
Update Box#UpdateInfo to use box metadata client
2022-04-25 12:26:57 -05:00
sophia
35c094f570
Get box update info
2022-04-25 12:26:57 -05:00
Chris Roberts
9ab74271cf
Add some comments and expand some method documentation
2022-04-25 12:26:57 -05:00
Chris Roberts
f220ac2f94
Add name based re-weight helper. Add documentation/comments.
2022-04-25 12:26:56 -05:00
Chris Roberts
f9e55a8f9d
Fill in vertex base methods
2022-04-25 12:26:56 -05:00
Chris Roberts
66c9fd45d6
Map key and value when converting Hash types
2022-04-25 12:26:56 -05:00
Chris Roberts
1bf4c8d090
Provide Graph#each_vertex helper to graph
2022-04-25 12:26:56 -05:00
Chris Roberts
12cb795392
Add name support for inputs
2022-04-25 12:26:56 -05:00
Paul Hinze
eacb798a71
Fix action hooks running twice in destroy_on_error scenarios
...
The "destroy_on_error" functionality for `vagrant up` is implemented in
the `recover()` action chain, and works by firing off a destroy action
from inside that chain.
This is all well and good, but it copies its existing `env` which has
had `action_name` set for the up action. This was causing action_hooks
for up actions to attach to this destroy action stack.
Setting the action_name explicitly in the env before firing the runner
should correct the behavior. I'm not sure if raw_action_name is used
anywhere but I figured it was better to be consistent vs conservative in
what we change.
2022-04-25 12:26:56 -05:00
Chris Roberts
305fddb49a
Retry cached path executions with full graph
2022-04-25 12:26:55 -05:00
Chris Roberts
f3a3bb83fd
Only register types for blind maps after a blind map
2022-04-25 12:26:55 -05:00
Chris Roberts
e8a4c35cf6
Remove any unpacking of value prior to mapping
2022-04-25 12:26:55 -05:00
Chris Roberts
2baea78820
Properly clone mappers
2022-04-25 12:26:55 -05:00
Chris Roberts
823e589a26
Freeze base mappers list to prevent direct modifications
2022-04-25 12:26:55 -05:00
Chris Roberts
2f9daa8498
Include value in error message when mappers not found
2022-04-25 12:26:55 -05:00
Chris Roberts
61b5d3549f
Don't use blind mapping when generating value
2022-04-25 12:26:54 -05:00
Chris Roberts
3917449552
Provide source information when mapping, register blind maps
2022-04-25 12:26:54 -05:00
Chris Roberts
f6a46634a5
When performing a blind map, if previous mapping found, use it
2022-04-25 12:26:54 -05:00
Chris Roberts
1d555b025f
Use global list of mappers and cache as defaults
2022-04-25 12:26:54 -05:00
Chris Roberts
7404ef89a6
Isolate generate class from instance so we can do class checks
2022-04-25 12:26:54 -05:00
Chris Roberts
8cc6116cdf
Store previous successful lookups for future graph generation
2022-04-25 12:26:54 -05:00
Chris Roberts
aaed7b2d82
Update Method vertex hash code and allow callable access
2022-04-25 12:26:54 -05:00
Chris Roberts
3a6308b7fc
Use blocks for logging content to reduce processing
2022-04-25 12:26:54 -05:00
sophia
7b470d4b25
Ensure box metadata has optional arguments
2022-04-25 12:26:53 -05:00
sophia
03ecb877e6
Update box metadata Name endpoint to boxName
2022-04-25 12:26:53 -05:00
sophia
66524426d0
Update ruby remote box metadata for proto changes
2022-04-25 12:26:53 -05:00
sophia
0556c804fd
Add load metadata client endpoint
2022-04-25 12:26:52 -05:00
sophia
1f5d66fd76
Get box metadata client from box
2022-04-25 12:26:52 -05:00
sophia
428c3b02fd
Use remote box metadata implementation
2022-04-25 12:26:52 -05:00
sophia
3e641fbe6b
Stub machine index proto mapper for environment test
2022-04-25 12:26:51 -05:00
sophia
333fc16096
Map provisioner config to Hash using mappers instead of assuming Struct type
2022-04-25 12:26:51 -05:00
sophia
7dd3649d73
Update Symbol proto mappers
2022-04-25 12:26:51 -05:00
sophia
d5aacc0bc6
Thrash around making to proto for config faster
2022-04-25 12:26:51 -05:00
sophia
f4811af759
Use symbol proto when protoizing plugin configs
2022-04-25 12:26:51 -05:00
sophia
ccf2bf6197
Pass config as a SDK hash in order to use the Symbol proto
2022-04-25 12:26:51 -05:00
sophia
9a61574f52
Add core plugin manager to default mapper list
2022-04-25 12:26:50 -05:00
sophia
b40dde3797
Module for core plugin manager mappers
2022-04-25 12:26:50 -05:00
sophia
afc6d1c27d
Extract core plugin manager from context
2022-04-25 12:26:50 -05:00
sophia
05244e67c1
Add mappers for core plugin manager
2022-04-25 12:26:50 -05:00
sophia
b3003e8cb6
Add core plugin service client
2022-04-25 12:26:50 -05:00
Paul Hinze
1341bfe0af
Tweak Ruby->Go error handling so exit codes match
...
In legacy Vagrant, any exception raised that's a subclass of
Vagrant::Errors::VagrantError is considered user-facing and so causes
the error message to be printed to the console and the process to use
exit code 1. Anything outside of that causes the process to use exit
code 255. (See `bin/vagrant` for the code.)
Here we mirror that behavior by treating errors that have a
LocalizedMessage as user-facing and those without as unexpected. This
allows the basic virtualbox component to pass in vagrant-spec!
2022-04-25 12:26:49 -05:00
Paul Hinze
09c03893b2
Simplify truncate_to per feedback
...
No need to spin up a full regexp if it's not necessary!
2022-04-25 12:26:49 -05:00
Paul Hinze
253c6658b3
Truncate error message to address RST_STREAM issues
...
This is the result of a whole journey of learning about GRPC errors! See
the hefty inline comment which has all the context for future
generations.
2022-04-25 12:26:49 -05:00
Paul Hinze
7f56168959
Work around a few global flag collisions for ssh command
...
* `vagrant ssh` has a --no-tty flag colliding with the one defined in
`bin/vagrant` - in fact none of the flags in `bin/vagrant` are
processed in `serve` mode, so remove the code that captures them from
the CommandInfo OptionParser dance
* `vagrant ssh` has a `--plain` flag colliding with the one defined in
`internal/cli/base.go` - this flag was inherited from Waypoint, so we
can just rename it to line up with the (inversely defined) `--color`
flag used in legacy vagrant
2022-04-25 12:26:48 -05:00
Paul Hinze
8f9952089a
Fix commands that run without a project
...
Some commands like `vagrant init` and `vagrant box` should be able to
run successfully without a full Project available in VAGRANT_CWD (in
other words, they don't require that a valid Vagrantfile be available.)
Thus far we've been assuming that a Project is available when
dispatching commands, which mean that commands of this nature weren't
working.
Here we make the Basis available to serve as an alternative client to
Vagrant::Environment::Remote such that it can be instantiated and passed
through to commands. This required some changes to Environment::Remote
to make its interactions with the client more defensive, but we manage
to avoid needing to make any changes to the normal legacy codepaths.
2022-04-25 12:26:47 -05:00
sophia
128599ab68
Get local box metadata in remote box
2022-04-25 12:26:47 -05:00
sophia
b6d42d0695
Clean up machine client
2022-04-25 12:26:46 -05:00
sophia
f55da8168a
Check if a box is in use using the machines endpoint
...
This returns a list of machine index entries that use the box. This
is what is expected from the Ruby side.
2022-04-25 12:26:46 -05:00
sophia
4dcd120448
Load machine from machine ref
2022-04-25 12:26:46 -05:00
sophia
8b5bc0cd1c
Set box metadata url
2022-04-25 12:26:45 -05:00
sophia
3516aa7131
Set defailt Vagrant log level
2022-04-25 12:26:44 -05:00
Paul Hinze
7c1d2e5368
Use optional fields on Synced Folder instead of empty string checks
...
Addresses concerns raised in discussion here
https://github.com/hashicorp/vagrant-ruby/pull/219#discussion_r816966056
and makes it so we don't have to change any plugin code to make things
work.
Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/133
2022-04-25 12:26:44 -05:00
Paul Hinze
0fc068822a
Fix rsync ownership settings in synced folders
...
When the opts are being pass through the go side, we get back empty
string values instead of nil values, so the `||=` assignment was not
working to populate the default owner and group. This was causing the
rsync_post hook to fail on linux guests.
2022-04-25 12:26:43 -05:00
Chris Roberts
f457cbb72b
Use machine UI when processing actions
2022-04-25 12:26:43 -05:00
Chris Roberts
df0bbe343f
Support bold style and add #clear_line
2022-04-25 12:26:43 -05:00
Chris Roberts
71fb214d95
Add #input to terminal client and use event stream
2022-04-25 12:26:43 -05:00
Paul Hinze
06ad1b4565
Fixup tests for Ruby 3.0
...
This is a pass through test failures and deprecation warnings:
* Make all ambiguous `.with(..., key: val)` use explicit hashes to
prevent test failures for argument mismatch in Ruby 3.0
* Scope down all unbounded `raise_error` to address warnings (remove
one test that was revealed to be referencing a nonexistent variable
once the raise_error was scoped.)
* Update all `any_instance` usage to new syntax to address warnings
* Allow the service cache to be cleared and do so between some tests
* Fix a small bug in with_plugin's plugin not found code path (revealed
by a scoped and_raise)
2022-04-25 12:26:40 -05:00
Chris Roberts
20d717a521
Update provisioner service plugin setup and caching
2022-04-25 12:26:39 -05:00
Chris Roberts
74ff5da434
Trace item registration in the cache
2022-04-25 12:26:39 -05:00
Chris Roberts
39a85d1cf3
Support caching plugins within services
2022-04-25 12:26:39 -05:00
Chris Roberts
2b5bd64ec8
Remove local provider injection to machine
2022-04-25 12:26:39 -05:00
Chris Roberts
ab8dee7a72
Add some missing mappers for converting to proto
2022-04-25 12:26:39 -05:00
Chris Roberts
6dd5a3ae9b
Load plugins within #with_plugin helper
2022-04-25 12:26:39 -05:00
Chris Roberts
d070b2cc6f
Initialize cache in the proper location within Service class
2022-04-25 12:26:38 -05:00
Chris Roberts
b0b5d1191e
Update and document cacher
2022-04-25 12:26:38 -05:00
Chris Roberts
f88254eb23
Let #with_plugin load plugins by type
2022-04-25 12:26:38 -05:00
sophia
b7d12a0907
Get provider from remote machine
2022-04-25 12:26:38 -05:00
Chris Roberts
f183a8a810
Update provisioner service implementation
2022-04-25 12:26:38 -05:00
Chris Roberts
2f4670e48a
Define cache for services and provide it
2022-04-25 12:26:38 -05:00
Chris Roberts
8542650e38
If destination is any, only allow proto destinations
2022-04-25 12:26:38 -05:00
Chris Roberts
3e7f72b9b0
Extract direct arguments to use for spec
2022-04-25 12:26:37 -05:00
Chris Roberts
987998aa41
Grab cacher from local instance
2022-04-25 12:26:37 -05:00
Chris Roberts
b976be72bd
Simplify cacher
2022-04-25 12:26:37 -05:00
Chris Roberts
d82702064f
Only deactivate remote plugin manager if activated
2022-04-25 12:26:37 -05:00
Chris Roberts
83ca40e239
Refactor Ruby service implementations
...
Update the Ruby service implementations to use the funcspec util
module for generating spec content. A helper method is now used
for generating a parent class for services to subclass which
automatically includes all required modules for usage.
2022-04-25 12:26:37 -05:00
Paul Hinze
ff86d86ac8
Provisioner Plugins
2022-04-25 12:26:37 -05:00
Chris Roberts
2b38005dfb
Include namespace for wrapper type
2022-04-25 12:26:37 -05:00
Chris Roberts
4679d39039
Fix name and method call in folders mappers
2022-04-25 12:26:37 -05:00
sophia
94698704ab
Fix some small errors
2022-04-25 12:26:37 -05:00
Chris Roberts
c7fdd92eb5
Add folders type to mappers
2022-04-25 12:26:36 -05:00
Chris Roberts
14d2d66d29
Use folders and options types in client/services
2022-04-25 12:26:36 -05:00
Chris Roberts
c32ba38b70
Add mappers for Folders type
2022-04-25 12:26:36 -05:00
Chris Roberts
0cb053c20c
Add a Folders type
2022-04-25 12:26:36 -05:00
Chris Roberts
c00eb5a5a8
Store options value as hash
2022-04-25 12:26:36 -05:00
Chris Roberts
f507a3d7ff
Add todo note about deleted entries
2022-04-25 12:26:36 -05:00
Chris Roberts
b7f074e492
Remove debugging artifacts
2022-04-25 12:26:36 -05:00
Chris Roberts
ac8790b694
Remove deleteion of host and machine index entries
2022-04-25 12:26:36 -05:00
Chris Roberts
9a6f5fa316
Don't unany mapping if source value is proto
2022-04-25 12:26:35 -05:00
Chris Roberts
a5b3ca9f6d
Return remote plugin instances
2022-04-25 12:26:35 -05:00
Chris Roberts
095a0f8847
WIP checkpoint with callable remote provider action
2022-04-25 12:26:35 -05:00
Chris Roberts
d2f795e11b
Provide client to manager enable helper method
2022-04-25 12:26:35 -05:00
sophia
55fb52f174
Update the synced folder client to pass direct values
2022-04-25 12:26:34 -05:00
Paul Hinze
f314c090e2
Set local machine within provider service
...
See inline comment for more context
2022-04-25 12:26:34 -05:00
Paul Hinze
8730b9f100
Fix MachineState mapper so IsRunning actions work
...
The IsRunning action checks if `env[:machine].state.id == :running` but
this check was never passing as the protobuf-washed version of machine
state was yielding a machine state w/ a string value like `"running"`.
Easy fix in the mapper!
2022-04-25 12:26:34 -05:00
Paul Hinze
a5f0996f5f
Fix ssh_info protobuf empty value handling
...
In https://github.com/hashicorp/vagrant-plugin-sdk/pull/115 we make the
SSHInfo fields optional, which allows us to remove zero values and fix
default value population within Machine#ssh_info.
2022-04-25 12:26:34 -05:00
sophia
29eb55909c
Refactor guest detect client
2022-04-25 12:26:34 -05:00
sophia
b6de8c3a80
Add guest detect function to client
2022-04-25 12:26:34 -05:00
sophia
8911ebd2b7
Get hash of synced folders
2022-04-25 12:26:33 -05:00
sophia
87f8c9cc5e
Implement synced folder prepare endpoint
2022-04-25 12:26:33 -05:00
sophia
19f3d2f0b6
Refactor named plugin bits to apply to all components
2022-04-25 12:26:33 -05:00
sophia
6c28de9ea9
Refactor named plugin service/client endpoints
2022-04-25 12:26:33 -05:00
sophia
153d218d68
Set plugin name
2022-04-25 12:26:32 -05:00
sophia
e95d906f74
Get plugin name from client
2022-04-25 12:26:32 -05:00
Chris Roberts
e2b135eb80
Accept options for actions on provider service
2022-04-25 12:26:31 -05:00
Chris Roberts
38d7bcc51f
Use machine as default argument for synced folder caps
2022-04-25 12:26:31 -05:00
Chris Roberts
ea3932be22
Allow options hash for action on provider client
2022-04-25 12:26:31 -05:00
Chris Roberts
e7686882fa
Log error and stacktrace on mapping errors
2022-04-25 12:26:31 -05:00
Chris Roberts
c6f6bf0c47
Include source and destination in no path exception message
2022-04-25 12:26:31 -05:00
Chris Roberts
32ea6a4509
Add new options type with mappers
2022-04-25 12:26:31 -05:00
Chris Roberts
312080ba60
Only write graph when logging mapper output
2022-04-25 12:26:31 -05:00
Chris Roberts
710adc8f7b
Retain simple hash type for now
2022-04-25 12:26:31 -05:00
Chris Roberts
4c9f14572a
Update target to addr in plugin protos
2022-04-25 12:26:30 -05:00
Chris Roberts
9e58090d09
Update the provider client to use funcspec utility
2022-04-25 12:26:30 -05:00
Chris Roberts
9f5e7780aa
Modifications to provide expected behavior of communicator client
2022-04-25 12:26:30 -05:00
Chris Roberts
b0f59c40f6
Update the search to use a reversed graph
...
Reverse the graph before searching so we are only working with
a single possible destination. A DFS is used to initially prune
down the graph.
2022-04-25 12:26:30 -05:00
Chris Roberts
3865008b89
Update weights and remove vertices from destination output
2022-04-25 12:26:30 -05:00
Chris Roberts
a98d91e15f
Unpack named arguments and provide value to flag generation request
2022-04-25 12:26:30 -05:00
Chris Roberts
b26a1ac515
Log error when input type is missing
2022-04-25 12:26:30 -05:00
Chris Roberts
2f0fdfc153
Add unique vertex type for root
2022-04-25 12:26:30 -05:00
Chris Roberts
cd99ff6525
Add logging to funcspec helper and build named types correctly
2022-04-25 12:26:30 -05:00
Chris Roberts
5609a32af0
Fix input type for duration mapping
2022-04-25 12:26:30 -05:00
Chris Roberts
32c77ef96a
Remove need for environment when mapping machine
2022-04-25 12:26:29 -05:00
Chris Roberts
0a9c02f957
Return hash with indifferent access from mapper
2022-04-25 12:26:29 -05:00
Chris Roberts
afdaf046dc
Log errors from submapping on direct type
2022-04-25 12:26:29 -05:00
Chris Roberts
14895eded1
Grab value from cache when mapping
2022-04-25 12:26:29 -05:00
Chris Roberts
58568b06fa
Define expected type with name
2022-04-25 12:26:29 -05:00
Chris Roberts
c9d93f2f8a
Request machines instead of targets
2022-04-25 12:26:29 -05:00
Chris Roberts
025808ba27
Add types for communicator information
2022-04-25 12:26:29 -05:00
Chris Roberts
8d8e9ae8ea
Properly include Empty argument to calls
2022-04-25 12:26:29 -05:00
Chris Roberts
ad402fd6d0
Update component clients to use FuncSpec module
2022-04-25 12:26:29 -05:00
Chris Roberts
6e16a8835c
Update clients to subclass Client
2022-04-25 12:26:29 -05:00
Chris Roberts
c413335e14
Add mappers for new types
2022-04-25 12:26:29 -05:00
Chris Roberts
451f3041f9
Add support for named vertices to mappers graph
2022-04-25 12:26:28 -05:00
Chris Roberts
286886ae89
Add named vertex type
2022-04-25 12:26:28 -05:00
Chris Roberts
32251ecb64
Include named value to mapper graph
2022-04-25 12:26:28 -05:00
Chris Roberts
1f731bbf9f
Add more default type maps
2022-04-25 12:26:28 -05:00
Chris Roberts
7c69fde71c
Break out type finding from unany method
2022-04-25 12:26:28 -05:00
Chris Roberts
4cf1090725
Add new custom types for easier conversions
2022-04-25 12:26:28 -05:00
Chris Roberts
58dd2e491f
Update cacher implementation
2022-04-25 12:26:28 -05:00
Chris Roberts
e29011d0b3
Add FuncSpec module
...
This module provides helper methods for handling FuncSpecs
and generating FuncSpec::Args protos. At this stage it is
intended for use in client implementations
2022-04-25 12:26:28 -05:00
Chris Roberts
e533d9f0a8
Convert client to class and populate with modules
2022-04-25 12:26:28 -05:00
sophia
891eb27e9a
Rename plugin "target" to "addr"
2022-04-25 12:26:27 -05:00
sophia
93ec8c1571
Refactor with_plugins util
2022-04-25 12:26:24 -05:00
sophia
81a9d7b241
Pass machine to provider functions
2022-04-25 12:26:24 -05:00
sophia
fcf405bdf8
Run provider actions
2022-04-25 12:26:24 -05:00
sophia
274ed6c756
Add mapper for machine state
2022-04-25 12:26:24 -05:00
sophia
8355209654
Accept machine for provider state endpoint
2022-04-25 12:26:24 -05:00
sophia
1e428a0812
Add mappers for provider
2022-04-25 12:26:24 -05:00
sophia
f3a1a9caa6
Add dependency on common protos for error details
2022-04-25 12:26:24 -05:00
sophia
526b7f2318
Remote init from provider grpc api
2022-04-25 12:26:23 -05:00
sophia
c48e43a12a
Add provider ruby client
2022-04-25 12:26:23 -05:00
sophia
75e6081e6d
Fill in provider ruby service
2022-04-25 12:26:23 -05:00
Paul Hinze
a86965c340
ruby mappers: Unwrap wrapper types in Hashes and Arrays
...
Boolean types (and possibly a few others) are returned as wrapper
classes when coming out from proto mapping; these need to be unwrapped
otherwise the caller who is expecting a nice clean boolean value ends up
with an icky protobuf class.
This fixes the shell provisioner, which relies on a communicator
receiving a settings hash `{error_check: false}` for a command that
usually fails but it sent just in case before provisioning starts.
2022-04-25 12:26:23 -05:00
sophia
c01a38b6e1
Load target index targets
2022-04-25 12:26:22 -05:00
Chris Roberts
1a32e8c2f9
Fetch command banner and remove switch characters
2022-04-25 12:26:21 -05:00
Chris Roberts
5e6fe71a37
Use ruby command arguments type when executing command
2022-04-25 12:26:21 -05:00
Chris Roberts
7b82ba7ca0
Add ruby local command arguments type and mapper
2022-04-25 12:26:21 -05:00
Paul Hinze
92c345b42d
Allow go push plugins to use config from Vagrantfile
...
* Populate push configs when parsing the vagrantfile
* Allow untyped configs to be shipped over GRPC
* In our demo plugin, walk the vagrantfile and snag the config
Example Vagrantfile that works with the demo plugin:
```ruby
Vagrant.configure("2") do |config|
config.push.define "myplugin" do |push|
push.coolkey = "coolvalue"
push.alist = ["so", "many", "items"]
push.ahash = { "hashkey" => "hashvalue" }
end
end
```
2022-04-25 12:26:21 -05:00
Paul Hinze
737c1a5f8b
Use the simpler plugin interface for Push plugins
...
* Bumps the go.mod to the just-merged SDK version
* Returns empty results on success vs messing around with PushResponses
2022-04-25 12:26:21 -05:00
Paul Hinze
0fef7cc416
Port push plugins
...
This uses the new Push plugin support added to the plugin SDK in https://github.com/hashicorp/vagrant-plugin-sdk/pull/106 to make the following changes:
* The plugin manager on the Go side now registers push plugins
* The the _remote_ plugin manager on the Ruby side now calls over to
the go side to get push plugins
* All the wiring is hooked up such that when a push plugin is replaced
with its remote GRPC-client-wielding equivalent, the messages are
ferried around.
2022-04-25 12:26:21 -05:00
sophia
53f7b3f8eb
Update tests for GRPC errors
2022-04-25 12:26:20 -05:00
sophia
deb667ecd3
Use common rpc errdetails messages
2022-04-25 12:26:20 -05:00
sophia
df5f7d40e8
Rename exception logger to exception transformer
...
The exception logger no longer logs errors. Instead it transforms
the errors into a grpc friendly format. The exception that would
have been logged at this point gets logged when the task completes.
2022-04-25 12:26:20 -05:00
sophia
a62c3d69cf
Only wrap error in grpc error if not already
2022-04-25 12:26:20 -05:00
sophia
c4e97bb89b
Send localized message originating from plugin (if applicable)
2022-04-25 12:26:20 -05:00
sophia
d09c12dad3
Add status proto message to outgoing errors
2022-04-25 12:26:20 -05:00
sophia
c70da0f548
Raise Vagrant error
2022-04-25 12:26:20 -05:00
sophia
0dcefddae4
Only add exception logger to non-generic methods
2022-04-25 12:26:20 -05:00
sophia
441f82760b
Include exception logger and attach to all available methods
2022-04-25 12:26:19 -05:00
Chris Roberts
914530d26a
Use trace log level for noisy log messages
2022-04-25 12:26:19 -05:00
Chris Roberts
dc03dd9cad
Wrap remote manager setup/teardown within usage tracker
2022-04-25 12:26:19 -05:00
Chris Roberts
d5cf2b66ed
Define a manager tracker for enabling remote manager
2022-04-25 12:26:18 -05:00
Chris Roberts
1a80e6112b
Remove WithMapper module and add autoload for UsageTracker
2022-04-25 12:26:18 -05:00
Chris Roberts
1849e941f3
Add helper class for usage tracking
2022-04-25 12:26:18 -05:00
Chris Roberts
b08ca1e109
Convert to pathnames on upload and download
2022-04-25 12:26:18 -05:00
Chris Roberts
2bf39a7dcf
If graph is not acyclic, break cycles before finding path
2022-04-25 12:26:18 -05:00
Chris Roberts
2f7a9c5a79
Add support for detecting and breaking cycles in graph
2022-04-25 12:26:18 -05:00
Chris Roberts
3cdac85d91
Allow nil values for input types
2022-04-25 12:26:18 -05:00
Chris Roberts
1256abc7b2
Fix synced folder plugin initialization in mapper
2022-04-25 12:26:18 -05:00
Chris Roberts
2a7e43d269
Fix value usage in the boolean mapper
2022-04-25 12:26:18 -05:00
Chris Roberts
43e5550203
Store the destination type so we can see it in the logs
2022-04-25 12:26:18 -05:00
Chris Roberts
2ff7d6a5bd
Allow value to be mapped to be nil
2022-04-25 12:26:18 -05:00
Chris Roberts
033dfba056
Fix known arguments value usage and do not allow adding nil values
2022-04-25 12:26:17 -05:00
Chris Roberts
9ace68f424
Add known mapping for synced folders
2022-04-25 12:26:17 -05:00
Chris Roberts
53d15203f9
Remove any mapper setup in the initializer
2022-04-25 12:26:17 -05:00
Chris Roberts
1ffbe5c474
When inspecting the broker, don't show details
2022-04-25 12:26:17 -05:00
Paul Hinze
142b1af0cc
Fix local exec pushes in server mode
...
The local-exec push strategy was assuming it was running from a CLI and
so it wouldn't be a big deal for it to straight up `exec` and replace
its running with the user command. That command will just do its thing
and we want the exit code for the CLI command to match anyways, right?
Sure that works for a shell, but in a GRPC server setting it's decidedly
Not Cool to suddenly swap out the running process!
As you can imagine - the effect of doing this was all sorts of broken
pipes and unexpected EOFs and a very confused @phinze.
Luckily we had a subprocess strategy sitting right there for Windows
compat, so it was just a matter of switching to that in the server
context as well. Long and winding debugging process; simple fix;
just another classic!
2022-04-25 12:26:17 -05:00
Chris Roberts
aa934f4436
Implement known type mappers directly
2022-04-25 12:26:17 -05:00
Chris Roberts
047a7f08d8
Replace auto-generated mappers with direct implementation of subset
2022-04-25 12:26:17 -05:00
Chris Roberts
64ebe30618
Remove string conversion to pathname
2022-04-25 12:26:17 -05:00
Chris Roberts
998432faee
Include source type when failed to reach destination
2022-04-25 12:26:17 -05:00
Chris Roberts
1e3547fdaa
Update log output and return immediately if type
2022-04-25 12:26:17 -05:00
Chris Roberts
6bdc7baf39
Update name from Types to Type
2022-04-25 12:26:16 -05:00
Chris Roberts
739b490f09
Make type common type and add boolean type
2022-04-25 12:26:16 -05:00
Chris Roberts
1d0077b716
Fix indentation
2022-04-25 12:26:16 -05:00
Chris Roberts
8676b13363
Include broker when setting service info
2022-04-25 12:26:16 -05:00
Chris Roberts
c6feb89138
Remove mappers that output the same type as the input
2022-04-25 12:26:16 -05:00
Chris Roberts
e6a3e16b48
Remove from string mappers
2022-04-25 12:26:15 -05:00
Chris Roberts
19d695cc78
Attempt to decode via JSON before failing
2022-04-25 12:26:15 -05:00
Chris Roberts
105c877551
Add a seed_protos helper method and remove debug logging
2022-04-25 12:26:15 -05:00
Chris Roberts
5c8f14041c
Update services to provide broker and use proper plugin manager
2022-04-25 12:26:15 -05:00
Chris Roberts
0989edb794
Update with_info to require broker and load plugin manager when available
2022-04-25 12:26:15 -05:00
Chris Roberts
0bb424c2df
Remove with_info method which is isolated to the module
2022-04-25 12:26:15 -05:00
Chris Roberts
de18081a35
Add mappers for host and plugin manager clients
2022-04-25 12:26:15 -05:00
Chris Roberts
3f7b7ee65a
Add mappers for loading command client
2022-04-25 12:26:15 -05:00
Chris Roberts
23c99b5806
Implement command and plugin manager clients
2022-04-25 12:26:15 -05:00
sophia
d5007d4d85
Use remote plugin module when in server mode
2022-04-25 12:26:13 -05:00
sophia
a3c3bb9cf1
Add mappers for synced folder client -> vagrant synced folder
2022-04-25 12:26:13 -05:00
sophia
7a75ed6cbb
Get stdout and stderr from privledged execute
2022-04-25 12:26:13 -05:00
sophia
88e1e5c1a7
Map ouput of capabilities
2022-04-25 12:26:12 -05:00
sophia
8e85561f61
Get stdout and stderr from command
2022-04-25 12:26:12 -05:00
sophia
1aabc7c4b5
Add mapper for a Class to String
2022-04-25 12:26:12 -05:00
sophia
f33e949138
Get a machine as defult synced folder arg
2022-04-25 12:26:12 -05:00
sophia
8e0f42ec17
Add mapper for synced folder client to proto
2022-04-25 12:26:12 -05:00
sophia
a18fb54ca6
Include seeds and default args for synced folder plugins
2022-04-25 12:26:11 -05:00
sophia
04a6f762af
Make synced folder mapping work
2022-04-25 12:26:11 -05:00
sophia
3c20f826ea
Don't send nil machine id value
2022-04-25 12:26:11 -05:00
sophia
38dd5ef5f9
Use path proto to pass around paths
2022-04-25 12:26:11 -05:00
sophia
175f05657c
go generate
2022-04-25 12:26:10 -05:00
sophia
1ce82cf14c
Re-enable cap service return values
2022-04-25 12:26:10 -05:00
sophia
37cf32ef85
Communicator test and ready functions update
2022-04-25 12:26:10 -05:00
sophia
84af97f0a9
Add placeholder remote guest name
2022-04-25 12:26:10 -05:00
sophia
8a7ecc8411
Use mapped wait duration
2022-04-25 12:26:10 -05:00
sophia
5ba4cf0363
Get communicator from remote machine
2022-04-25 12:26:10 -05:00
sophia
10f176950d
Cleanup mapper usage
2022-04-25 12:26:10 -05:00
sophia
f35b429335
Use Args.Hash for communincator execute function
2022-04-25 12:26:10 -05:00
sophia
6eaf399501
Add mapper Symbol -> String
2022-04-25 12:26:10 -05:00
sophia
a4694bcf91
Extract to/from arg from upload/download request
2022-04-25 12:26:10 -05:00
sophia
773276ba37
Ensure opts get passed to privledge execute
2022-04-25 12:26:09 -05:00
sophia
b29b37af0d
Add mappers for time duration proto
2022-04-25 12:26:09 -05:00
sophia
73b6c7c6d6
Use Hash Arg to pass around communincator args
2022-04-25 12:26:09 -05:00
sophia
ba1dd33fff
Include seeds in ruby communicator
2022-04-25 12:26:09 -05:00
sophia
b9e7d2197e
Clean up from rebase
2022-04-25 12:26:09 -05:00
sophia
bb084e42e4
Apply changes to download funciton
2022-04-25 12:26:09 -05:00
sophia
d57203f005
Get ruby communincator upload working
2022-04-25 12:26:09 -05:00
sophia
85f7aa1586
Make go communincator plugin work
2022-04-25 12:26:09 -05:00
sophia
49ad851606
Use named paths proto message for uploading/downloading
2022-04-25 12:26:09 -05:00
sophia
80457cd869
Run communincator execute
2022-04-25 12:26:08 -05:00
sophia
8513a14f9e
Use RemotePath proto message to upload/download files
2022-04-25 12:26:08 -05:00
sophia
04253a0aeb
Use named to, from arguments for uploading files with communincator
2022-04-25 12:26:08 -05:00
sophia
8a2375faf2
Add mapper for communincator path proto
2022-04-25 12:26:08 -05:00
sophia
da9ec1a96e
Make remote command execution work
2022-04-25 12:26:08 -05:00