Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update vagrantfile to forward vm port to access grpc api & fix validations #170

Merged
merged 4 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Vagrant.configure("2") do |config|
config.ssh.forward_agent = true
config.vm.synced_folder "./", "/home/vagrant/flintlock"

config.vm.network "forwarded_port", guest: 9090, host: 9090

cpus = 2
memory = 4096
config.vm.provider :virtualbox do |v|
Expand Down
2 changes: 1 addition & 1 deletion core/models/microvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type Initrd struct {
// Image is the container image to use for the initrd.
Image ContainerImage `json:"image" validate:"imageURI"`
// Filename is the name of the initrd filename in the container.
Filename string `validate:"file"`
Filename string
}

// ContainerImage represents the address of a OCI image.
Expand Down
2 changes: 1 addition & 1 deletion core/models/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type NetworkInterface struct {
AllowMetadataRequests bool `json:"allow_mmds,omitempty"`
// GuestMAC allows the specifying of a specifi MAC address to use for the interface. If
// not supplied a autogenerated MAC address will be used.
GuestMAC string `json:"guest_mac,omitempty" validate:"mac"`
GuestMAC string `json:"guest_mac,omitempty" validate:"omitempty,mac"`
// Type is the type of host network interface type to create to use by the guest.
Type IfaceType `json:"type" validate:"oneof=tap macvtap unsupported"`
// Address is an optional IP address to assign to this interface. If not supplied then DHCP will be used.
Expand Down
12 changes: 7 additions & 5 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ sudo ./bin/flintlockd run \
--parent-iface="${NET_DEVICE}"
```

If you're running `flintlockd` from within a Vagrant VM and wish to call the gRPC API from your host machine then you need to run `flintlockd` with the `--grpc-endpoint=0.0.0.0:9090` flag, otherwise the connection will be rejected.

You should see it start successfully with similar output:
```
INFO[0000] reignited, version=undefined, built_on=undefined, commit=undefined
INFO[0000] reignited grpc api server starting
INFO[0000] flintlockd, version=undefined, built_on=undefined, commit=undefined
INFO[0000] flintlockd grpc api server starting
INFO[0000] starting microvm controller
INFO[0000] starting microvm controller with 1 workers controller=microvm
INFO[0000] resyncing microvm specs controller=microvm
Expand Down Expand Up @@ -279,7 +281,7 @@ To created a MicroVM:
--method CreateMicroVM
```

In the terminal where you started the Reignite server, you should see in the logs that the MircoVM
In the terminal where you started the Flintlock server, you should see in the logs that the MircoVM
has started.

### BloomRPC
Expand All @@ -291,7 +293,7 @@ has started.
To import Flintlock protos into the Bloom GUI:

1. Click `Import Paths` on the left-hand menu bar and add `<absolute-repo-path>/api` to the list
1. Click the import `+` button and select `reignite/api/services/microvm/v1alpha1/microvms.proto`
1. Click the import `+` button and select `flintlock/api/services/microvm/v1alpha1/microvms.proto`

All available endpoints will be visible in a nice tree view.

Expand All @@ -301,7 +303,7 @@ To create a MircoVM, select the `CreateMicroVM` endpoint in the left-hand menu.
Replace the sample request JSON in the left editor panel with [this example](hack/scripts/payload/CreateMicroVM.json).
Click the green `>` in the centre of the screen. The response should come immediately.

In the terminal where you started the Reignite server, you should see in the logs that the MircoVM
In the terminal where you started the Flintlock server, you should see in the logs that the MircoVM
has started.

To delete the MircoVM, select the `DeleteMicroVM` endpoint in the left-hand menu.
Expand Down
2 changes: 1 addition & 1 deletion hack/scripts/payload/CreateMicroVM.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"volumes": [
{
"id": "root",
"is_root": true,
"is_root": false,
"is_read_only": false,
"mount_point": "/",
"source": {
Expand Down