Skip to content

Commit 4736226

Browse files
committed
firecracker: preparing 0.9.0 release
Updated various doc files, and changed the version number to 0.9.0. Signed-off-by: Alexandru Agache <[email protected]>
1 parent 43d070c commit 4736226

File tree

7 files changed

+62
-28
lines changed

7 files changed

+62
-28
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# Changelog
22

3+
## [0.9.0]
4+
5+
### Added
6+
7+
- Seccomp filtering is configured via the `--seccomp-level` jailer parameter.
8+
- Firecracker logs the starting addresses of host memory areas provided as guest
9+
memory slots to KVM.
10+
- The metric `panic_count` gets incremented to signal that a panic has occurred.
11+
- Firecracker logs a backtrace when it crashes following a panic.
12+
- Added basic instrumentation support for measuring boot time.
13+
14+
### Changed
15+
16+
- `StartInstance` is a synchronous API request (it used to be an asynchronous
17+
request).
18+
19+
### Fixed
20+
21+
- Ensure that fault messages sent by the API have valid JSON bodies.
22+
- Use HTTP response code 500 for internal Firecracker errors, and 400 for user
23+
errors on InstanceStart.
24+
- Serialize the machine configuration fields to the correct data types (as specified
25+
in the Swagger definition).
26+
- NUMA node assignment is properly enforced by the jailer.
27+
- The `is_root_device` and `is_read_only` properties are now marked as required
28+
in the Swagger definition of `Drive` object properties.
29+
30+
### Removed
31+
32+
- `GET` requests on the `/actions` API resource are no longer supported.
33+
- The metrics associated with asynchronous actions have been removed.
34+
- Remove the `action_id` parameter for `InstanceStart`, both from the URI and the
35+
JSON request body.
36+
337
## [0.8.0]
438

539
### Added

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "firecracker"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Amazon firecracker team <[email protected]>"]
55

66
[dependencies]

FAQ.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Right now initrd is not supported in Firecracker. You can track the
1212
`Q2:`
1313
*Firecracker is not showing any output on the console.*
1414
`A2:`
15-
In order to debug the issue, you will first have to check the output of the GET
16-
request on Instance Start. You can find examples in
15+
In order to debug the issue, you will first have to check the response of the
16+
`InstanceStart` API request. You can find examples in
1717
[README.md](https://github.com/aws/PRIVATE-firecracker/blob/master/README.md) in
18-
the "Power-On the MicroVM" section. If the result of the GET is:
18+
the "Power-On the MicroVM" section. If the result is:
1919

2020
- **Error**: Submit a new issue with the label "Support: Failure".
21-
- **Success**: If the boot was successful, you should see an output like
22-
`{"action_type":"InstanceStart"}`.
21+
- **Success**: If the boot was successful, you should get a response with 204 as
22+
the status code.
2323

2424
If you have no output in the console, most likely you will have to update the
2525
kernel command line. By default, Firecracker starts with the serial console

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ The **API endpoint** can be used to:
3333
- Set a CPU template (the only available template is T2 for now)
3434
- Enable/Disable hyperthreading (by default hyperthreading is disabled).
3535
The host needs to be modified before starting Firecracker as this flag
36-
only changes the topology inside the microvm.
37-
- Add one or more network interfaces to the microVM. Firecracker is mapping
38-
an existing host file as a VirtIO/block device into the microVM.
36+
only changes the topology inside the microVM.
37+
- Add one or more network interfaces to the microVM.
3938
- Add one or more read/write disks (file-backed block devices) to the microVM.
39+
Firecracker is mapping an existing host file as a VirtIO/block device into the
40+
microVM.
4041
- Configure the logging system by:
4142
- Specifying two named pipes (one for human readable logs and one for the
4243
metrics).
@@ -86,6 +87,13 @@ The **API endpoint** can be used to:
8687

8788
- The boot-time SLA is enforced in `tests/performance/test-boottime.py`
8889

90+
### Measuring boot time
91+
92+
- Writing the magic value `123` to IO port `0x03f0` triggers a timestamp entry in
93+
the Firecracker log, which represents the time elapsed since receiving the
94+
`InstanceStart` command. This mechanism can be used to measure guest boot-time by
95+
writing to said IO port very early (ideally as part of init) from the guest.
96+
8997
## Getting Started
9098

9199
### Get or Build the Firecracker Binary

api_server/swagger/firecracker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ info:
44
description: RESTful public-facing API.
55
The API is accessible through HTTP calls on specific URLs carrying JSON modeled data.
66
The transport medium is a Unix Domain Socket.
7-
version: 0.8.0
7+
version: 0.9.0
88
termsOfService: ""
99
contact:
1010

docs/jailer.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The jailer is invoked in this manner:
66

77
``` bash
88
jailer --id <id> --node <numa_node> --exec-file <exec_file> --uid <uid> --gid <gid> [--chroot-base-dir <chroot_base>]
9-
[--netns <netns>] [--daemonize]
9+
[--netns <netns>] [--daemonize] [--seccomp-level <level>]
1010
```
1111

1212
- `id` is the unique VM identification string, which may contain alphanumeric
@@ -24,21 +24,16 @@ jailer --id <id> --node <numa_node> --exec-file <exec_file> --uid <uid> --gid <g
2424
will use this to join the associated network namespace.
2525
- When present, the `--daemonize` flag causes the jailer to cal **setsid()** and
2626
redirect all three standard I/O file descriptors to `/dev/null`.
27+
- Possible values for `--seccomp-level` are: 0 (disabled - the default value),
28+
1 (basic filtering), or 2 (advanced filtering). Basic filtering simply prohibits
29+
syscalls not whitelisted by Firecracker, whereas advanced filtering adds further
30+
checks on some of the parameters of the allowed syscalls. The filters are installed
31+
after the jailer execs into Firecracker, but before running any customer code.
2732

2833
## Jailer Operation
2934

3035
After starting, the Jailer goes through the following operations:
3136

32-
- If the `--secomp-level` flag is set to `1`, sets up a list of seccomp
33-
filters, white listing the minimum set of system calls that Firecracker
34-
requires to function.
35-
- If the `--seccomp-level` flag is set to `2`, sets up advanced
36-
seccomp filtering. The default action for a syscall is to send `SIGSYS`,
37-
unless there is an added rule white listing respective syscall with the given
38-
set of arguments. The added rules are the minimum set that Firecracker
39-
requires to function.
40-
- Otherwise if `--seccomp-level` flag is not set or is set to `0`, does not use
41-
seccomp filtering.
4237
- Validate **all provided paths** and the VM `id`.
4338
- Close all open file descriptors unrelated to standard input.
4439
- Open `/dev/kvm` as *RW*, and bind a Unix domain socket listener to
@@ -148,8 +143,9 @@ from the controlling terminal. Then, redirect standard file descriptors to `/dev
148143
because it is no longer necessary.
149144

150145
Finally, the jailer switches the **uid** to ```123```, and **gid** to ```100```, and execs
151-
`./firecracker --jailed`. We can now use the socket at `/srv/jailer/firecracker/551e7604-e35c-42b3-b825-416853441234/api.socket`
152-
to interact with the VM.
146+
`./firecracker --jailed --seccomp-level=<level>`. We can now use the socket at
147+
`/srv/jailer/firecracker/551e7604-e35c-42b3-b825-416853441234/api.socket` to
148+
interact with the VM.
153149

154150
### Observations
155151

@@ -166,10 +162,6 @@ to interact with the VM.
166162
this involves registering handlers with the cgroup **notify_on_release**
167163
mechanism, while being wary about potential race conditions (the instance
168164
crashing before the subscription process is complete, for example).
169-
- Seccomp filtering is currently disabled by default and needs to be enabled by
170-
setting the `USE_SECCOMP` environment variable due to a bug in the Linux
171-
kernel. Enabling it might cause slowness as a result of an increased number of
172-
page faults.
173165
- For extra resilience, the jailer expects to be spawned by the user in a new PID namespace, most likely via a
174166
combination of **clone()** with the **CLONE_NEWPID** flag and **exec()**. A process must be created in a new PID
175167
namespace in order to become a pseudo-init process, and the other option is to use a **clone()** in the jailer,

jailer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jailer"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Amazon Firecracker team <[email protected]>"]
55

66
[dependencies]

0 commit comments

Comments
 (0)