Skip to content

Commit d1c20ed

Browse files
committed
Update README with latest changes
* logging info * ability to run in-tree integration tests Signed-off-by: Diana Popa <[email protected]>
1 parent f5781d4 commit d1c20ed

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Firecracker consists of a single micro Virtual Machine Manager binary that will
1111
* Add memory to the microVM.
1212
* Add one or more network interfaces to the microVM.
1313
* Add one or more read/write disks (block devices) to the microVM.
14+
* Configure the logging system (i.e. path on host for log file, log level, etc).
1415
* Start the microVM using a given kernel image and root file system.
1516
* Stop the microVM.
1617

@@ -20,6 +21,7 @@ Firecracker consists of a single micro Virtual Machine Manager binary that will
2021
* Emulated keyboard (i8042) and serial console (UART). The microVM serial console input and output are connected to those of the Firecracker process (this allows direct console access to the guest OS).
2122
* The capability of mapping an existing host tun-tap device as a virtIO/net device into the microVM.
2223
* The capability of mapping an existing host file as a virtIO/block device into the microVM.
24+
* Logging capabilities.
2325
* Default demand fault paging & CPU oversubscription.
2426

2527
## Limits and Performance
@@ -51,6 +53,9 @@ To run microVMs with Firecracker, you will need to have:
5153
## Runtime Dependencies
5254
* Firecracker needs rw access to `/dev/kvm`. You can grant these rights, e.g., to all users, with: `sudo chmod a+rw /dev/kvm`.
5355

56+
## Testing
57+
* In-tree integration tests, that can be run locally or as part of a continuous integration system, are provided. See `tests/README.md` for more information.
58+
5459
## Start Firecracker & the Micro VM
5560

5661
The python-based toy example below will start a Firecracker microVM with 2 vCPUs, 256 MiB or RAM, two network interfaces and two disks (rootfs and temp).
@@ -121,6 +126,17 @@ requests.put(
121126
}
122127
)
123128
129+
# Configure logging system.
130+
requests.put(
131+
firecracker.logger_url,
132+
json={
133+
'path': '/tmp/firecracker0001/file.log',
134+
'level': 'Info',
135+
'show_level': True,
136+
'show_log_origin': True,
137+
}
138+
)
139+
124140
# Specify a boot source: a kernel image.
125141
# Currently, only linux kernel images are supported.
126142
requests.put(

examples/hello_api/spawn_microvm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Firecracker:
2121
drives_path = '/drives'
2222
boot_source_path = '/boot-source'
2323
actions_path = '/actions'
24+
logger = '/logger'
2425

2526
def __init__(self, socket_name):
2627
self.socket_name = socket_name
@@ -40,6 +41,7 @@ def spawn(self):
4041
self.drives_url = usocket_url + self.drives_path
4142
self.boot_source_url = usocket_url + self.boot_source_path
4243
self.actions_url = usocket_url + self.actions_path
44+
self.logger_url = usocket_url + self.logger
4345

4446
screen_cmd = (
4547
'screen -dmS ' + self.session_name +
@@ -116,6 +118,15 @@ def get_usocket_url(self):
116118
}
117119
)
118120

121+
requests.put(
122+
firecracker.logger_url,
123+
json={
124+
'path': '/tmp/firecracker0001/file.log',
125+
'level': 'Info',
126+
'show_level': True,
127+
'show_log_origin': True,
128+
}
129+
)
119130

120131
# Specify a boot source: a kernel image.
121132
# Currently, only linux kernel images are supported.

0 commit comments

Comments
 (0)