Commit graph

48 commits

Author SHA1 Message Date
Chris Roberts
e958c6183a Adds initial HCP config support
Adds initial basic support for HCP based configuration in vagrant-go.
The initalization process has been updated to remove Vagrantfile parsing
from the client, moving it to the runner using init jobs for the basis
and the project (if there is one). Detection is done on the file based
on extension for Ruby based parsing or HCP based parsing.

Current HCP parsing is extremely simple and currently just a base to
build off. Config components will be able to implement an `Init`
function to handle receiving configuration data from a non-native source
file. This will be extended to include a default approach for injecting
defined data in the future.

Some cleanup was done in the state around validations. Some logging
adjustments were applied on the Ruby side for better behavior
consistency.

VirtualBox provider now caches locale detection to prevent multiple
checks every time the driver is initialized.
2023-09-07 17:26:10 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
739bb7703d Allow connection to close when process closes 2023-06-05 14:18:06 -07:00
Chris Roberts
4eff04d20f Enable foreign key constraints 2023-06-05 14:18:06 -07:00
Chris Roberts
b6192eba0d Fixup scoping usage to properly validate 2023-06-05 14:18:05 -07:00
Chris Roberts
1a0c6b9d70 Request ruby runtime to stop itself when closing 2022-07-25 15:00:49 -07:00
Chris Roberts
f5f1fa7f0d Remove direct target loading from client for now 2022-06-20 12:55:38 -07:00
Chris Roberts
a0c78056d2 Add cleanup tasks individually 2022-06-20 12:55:18 -07:00
Chris Roberts
b5233bc86b Prepend closing the runner so data can still be saved 2022-06-20 12:54:39 -07:00
Chris Roberts
c698980afd Update client to use cleanup helper 2022-06-20 12:54:00 -07:00
Chris Roberts
67c374ddd2 Log value so it is used 2022-06-15 11:15:08 -07:00
Chris Roberts
255c75eeba Load Vagrantfile from the client 2022-06-15 10:55:00 -07:00
Paul Hinze
8b5d4b8631
Update and address protobuf package deprecations
These changes address the following warning showing up on `go get`
operations:

    go: module github.com/golang/protobuf is deprecated: Use the
    "google.golang.org/protobuf" module instead.

All changes are made using the recommendations in the per-function
deprecation notices from the docs at
https://pkg.go.dev/github.com/golang/protobuf/ptypes
2022-06-08 11:51:19 -05:00
Paul Hinze
9f9b3855b9
Remove unused GetDefaultProvider impl 2022-05-25 16:19:50 -05:00
Paul Hinze
4c21cb6ae5
Add release-grade logic for finding legacy Vagrant
After lots of experimentation I have landed on this as my proposal for
how we have our Go binary find its Ruby counterpart: just have it grab
it from the $PATH! @evanphx showed me this neat trick where by borrowing
a couple of helper methods from `exec` and tweaking them we can get
logic that will do a $PATH lookup that excludes "ourself". This allows
us to have both `vagrant` executables on the path... and means that
switching between Gogo-by-default or Legacy-by-default is just a matter
of tweaking $PATH order.

It _also_ means that we don't need any different lookup logic for
"release mode" vs "development mode" which is what I was looking at
before this solution.

In order to continue to facilitate development, I've generated a binstub
for vagrant using `bundle binstubs vagrant --standalone --path
./binstubs`, and I've updated the Nix development setup to prepend this
directory to the $PATH.

NOTE: Non-Nix users will need to modify their $PATH in the same way to
get the same behavior in development.
2022-04-25 12:26:49 -05:00
Chris Roberts
6b4e13c615
Use environment variable for logging level 2022-04-25 12:26:19 -05:00
sophia
bb43048813
Remove unused cli config code 2022-04-25 12:26:06 -05:00
sophia
e68c210921
Associate machine config with machines 2022-04-25 12:26:01 -05:00
sophia
d49944a25d
Only init targets when running a job scoped at the project or target 2022-04-25 12:26:01 -05:00
sophia
d75f76edf7
Prune old jobs as part of vagrant server clean ups 2022-04-25 12:24:40 -05:00
sophia
b30bbcb13a
Don't check for 'found' in basis/project/target query results 2022-04-25 12:24:39 -05:00
sophia
ea87b6824d
Upgrade bolt to bbolt
boltdb/bolt is no longer a maintained project. bbolt is the CoreOS
fork that the author of boltdb suggests using as a replacement.
2022-04-25 12:24:34 -05:00
sophia
058d929046
Setup data.db in global vagrant data path 2022-04-25 12:24:33 -05:00
Chris Roberts
96ac78a9a4
Fix some panics 2022-04-25 12:24:31 -05:00
sophia
277972f38f
Disable tests that use plugin manager to load builtin plugins
Loading builtin plugins is being changed. Once it has been fixed,
these tests should be re-enabled
2022-04-25 12:24:29 -05:00
Chris Roberts
219cfe81c5
Rename client target file to properly reflect contents 2022-04-25 12:24:24 -05:00
Chris Roberts
5a4d607437
Remove things no longer required of target 2022-04-25 12:24:24 -05:00
Chris Roberts
cf7630d14d
Update target and vagrantfile loading in project 2022-04-25 12:24:24 -05:00
Chris Roberts
07dbd15ea6
Attach functions to client instead of basis 2022-04-25 12:24:24 -05:00
Chris Roberts
1c87679bc0
Introduce a base client
Provide a base client type that can then be used for loading
scoped items (like basis, project, etc). Allow per-run setup
of server and runner be handled by the client. Add project
loading and project detection support to basis implementation
and load vagrantfiles during client setup.
2022-04-25 12:24:24 -05:00
Chris Roberts
b553544808
Initial updates for client loading 2022-04-25 12:24:22 -05:00
Chris Roberts
cdfcd0dc5b
Update local runner lifecycle within client 2022-04-25 12:24:21 -05:00
sophia
07296157a8
Better error handling 2022-04-25 12:24:20 -05:00
sophia
49cf6b8c29
Search for project before upserting 2022-04-25 12:24:20 -05:00
sophia
ada96f13a3
Upload targets found in Vagrantfile 2022-04-25 12:24:20 -05:00
sophia
6421b671e1
Store Vagrantfile related to the basis 2022-04-25 12:24:19 -05:00
sophia
26333d420e
Store Vagrantfile related to the project 2022-04-25 12:24:19 -05:00
sophia
053be35242
Parse Vagrantfiles 2022-04-25 12:24:16 -05:00
sophia
61ba8c356e
Load Vagrantfile for basis and project 2022-04-25 12:24:16 -05:00
sophia
a6af4062f8
Save point 2022-04-25 12:24:15 -05:00
sophia
70b71dc39e
Make no-op test work 2022-04-25 12:24:14 -05:00
Chris Roberts
05d5634c83
Host component related work 2022-04-25 12:24:10 -05:00
Chris Roberts
3f86194f60
Replace machine usage with target. Update proto ref location to plugin sdk 2022-04-25 12:24:06 -05:00
Chris Roberts
741ab97565
Remove core machine and environment services 2022-04-25 12:24:06 -05:00
Chris Roberts
d9893c1a13
Return immediately on error to prevent inspecting nil result 2022-04-25 12:23:59 -05:00
Chris Roberts
bba557c29d
Close the client to shutdown the plugin and prevent hang.
This also updates the Ruby runtime usage to pass the ClientProtocol
    instead of the full client since after init we only need it for
    dispensing plugins.
2022-04-25 12:23:59 -05:00
Chris Roberts
cffd771288
Move Vagrant runtime out of server and into runner (via client startup) 2022-04-25 12:23:58 -05:00
sophia
c3ee750db1
Add gogo 2022-04-25 12:23:57 -05:00