Skip to content

runtime: hard-code Firecracker API socket path #139

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

Merged
merged 1 commit into from
Mar 19, 2019
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
5 changes: 0 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ configuration file has the following fields:
`firecracker` located in its working directory. A fully-qualified path to the
`firecracker` binary is recommended, as the working directory typically
changes every execution when run by containerd.
* `socket_path` (required) - A path where a socket file should be created for
communicating with the Firecracker API. A relative path like
`./firecracker.sock` is recommended so that the socket is created in the
temporary working directory allocated by containerd.
* `kernel_image_path` (required) - A path where the kernel image file is
located. A fully-qualified path is recommended.
* `kernel_args` (required) - Arguments for the kernel command line.
Expand All @@ -241,7 +237,6 @@ configuration file has the following fields:
```json
{
"firecracker_binary_path": "/usr/local/bin/firecracker",
"socket_path": "./firecracker.sock",
"kernel_image_path": "/var/lib/firecracker-containerd/runtime/hello-vmlinux.bin",
"kernel_args": "console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw",
"root_drive": "/var/lib/firecracker-containerd/runtime/hello-rootfs.ext4",
Expand Down
1 change: 0 additions & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ sudo mkdir -p /etc/containerd
sudo tee -a /etc/containerd/firecracker-runtime.json <<EOF
{
"firecracker_binary_path": "/usr/local/bin/firecracker",
"socket_path": "./firecracker.sock",
"kernel_image_path": "/var/lib/firecracker-containerd/runtime/hello-vmlinux.bin",
"kernel_args": "console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw",
"root_drive": "/var/lib/firecracker-containerd/runtime/hello-rootfs.ext4",
Expand Down
4 changes: 0 additions & 4 deletions runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ configuration file has the following fields:
`firecracker` located in its working directory. A fully-qualified path to the
`firecracker` binary is recommended, as the working directory typically
changes every execution when run by containerd.
* `socket_path` (required) - A path where a socket file should be created for
communicating with the Firecracker API. A relative path like
`./firecracker.sock` is recommended so that the socket is created in the
temporary working directory allocated by containerd.
* `kernel_image_path` (required) - A path where the kernel image file is
located. A fully-qualified path is recommended.
* `kernel_args` (required) - Arguments for the kernel command line.
Expand Down
2 changes: 1 addition & 1 deletion runtime/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
const (
configPathEnvName = "FIRECRACKER_CONTAINERD_RUNTIME_CONFIG_PATH"
defaultConfigPath = "/etc/containerd/firecracker-runtime.json"
defaultSocketPath = "./firecracker.sock"
)

// Config represents runtime configuration parameters
type Config struct {
FirecrackerBinaryPath string `json:"firecracker_binary_path"`
SocketPath string `json:"socket_path"`
KernelImagePath string `json:"kernel_image_path"`
KernelArgs string `json:"kernel_args"`
RootDrive string `json:"root_drive"`
Expand Down
1 change: 0 additions & 1 deletion runtime/config.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"firecracker_binary_path": "./firecracker",
"socket_path": "./firecracker.sock",
"kernel_image_path": "vmlinux",
"kernel_args": "console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw",
"root_drive": "./vsock.img",
Expand Down
4 changes: 2 additions & 2 deletions runtime/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ func (s *service) startVM(ctx context.Context,
}

cfg := firecracker.Config{
SocketPath: s.config.SocketPath,
SocketPath: defaultSocketPath,
VsockDevices: []firecracker.VsockDevice{{Path: "root", CID: cid}},
KernelImagePath: s.config.KernelImagePath,
KernelArgs: s.config.KernelArgs,
Expand Down Expand Up @@ -673,7 +673,7 @@ func (s *service) startVM(ctx context.Context,
cfg.Drives = driveBuilder.Build()
cmd := firecracker.VMCommandBuilder{}.
WithBin(s.config.FirecrackerBinaryPath).
WithSocketPath(s.config.SocketPath).
WithSocketPath(defaultSocketPath).
Build(ctx)
machineOpts := []firecracker.Opt{
firecracker.WithProcessRunner(cmd),
Expand Down