Coder Social home page Coder Social logo

firecracker-microvm / firecracker Goto Github PK

View Code? Open in Web Editor NEW
24.1K 24.1K 1.7K 29.66 MB

Secure and fast microVMs for serverless computing.

Home Page: http://firecracker-microvm.io

License: Apache License 2.0

Rust 81.41% Shell 1.78% Python 16.37% C 0.29% Dockerfile 0.14%
containers minimalist open-source oversubscription rust sandbox serverless virtual-machine virtualization

firecracker's People

Contributors

acatangiu avatar aghecenco avatar alexandruag avatar alexandrucihodaru avatar alindima avatar andreeaflorescu avatar andreitraistaru avatar bchalios avatar cm-iwata avatar dependabot[bot] avatar dhrgit avatar dianpopa avatar fristonio avatar georgepisaltu avatar ioanachirca avatar jbyoshi avatar jonathanwoollett-light avatar kalyazin avatar karthiknedunchezhiyan avatar lauralt avatar luminitavoicu avatar mattschlebusch avatar pb8o avatar raduweiss avatar roypat avatar sandreim avatar shadowcurse avatar sudanl0 avatar tamionv avatar zulinx86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firecracker's Issues

VirtIO Network Virtualization

Implement VirtIO network virtualization, based off the crosVM implementation.

Done when the guest OS can see & use a network device.

Firecracker Secure Start & Jailing

When running a VM, Firecracker must be an unprivileged, contained process. If it's started as root, it should drop privileges and jail it's self as soon as possible.

Emulate SMP

Emulate "Symmetric Multiprocessing" to support multiple CPUs.

Unit Test Catch-Up

With the unit test coverage tooling complete:

  • define coverage targets for all crates, and
  • bring unit test coverage up to par in existing crates.

Legacy Device Emulation (With Live Update)

We need a minimal device model, and emulate:

  • Real-Time Clock
  • Power-Management
  • UART, for the serial console (for development purposes, should be turned off in the release)

Investigate Bug in Setting up the FPU through the KVM Interface

Currently, as part of the x86 configuration prior to booting the kernel, the floating point registers gets set up by calling KVM_GET_FPU and KVM_SET_FPU. After trying to alter the mxcsr and fcw registers, the only one that gets set is the fcw. Only when the order of the mxcsr in the kvm structure is changed by bringing it closer to fcw, its value gets set.

Investigate and Fix the Setup of the LAPIC Registers

Currently for setting the lapic state registers we use std::mem::transmute. Based on the documentation: 'transmute is incredibly unsafe. There are a vast number of ways to cause undefined behavior with this function. transmute should be the absolute last resort'. Moreover, when trying to set the APIC_LVT0 register inside a zeroed out array, rust-gdb does not show any change in the registers array.

Enforce virtio's limits specification on virtqueues

As per the virtio 1.0 specification, the maximum queue size has to be a power of 2 and be less then 32768 (see chapter 2.4 Virtqueues). Insert a check when creating a new queue that makes sure the specification is followed.

Enforce Memory Limitations While Registering a mmio Device

Currently the device manager starts off with a memory base address which gets incremented with every mmio device registration. There is no limit enforcement on the space the device manager could use for that. Investigate and possibly fix if memory overlaps are possible.

Research File Descriptors Passing

  • Figure out how to pass file descriptors atomically within the API message.
  • Do a short PoC on the mechanism.
  • Investigate and PoC the mechanism using RUST.

I/O Rate Limiting

We will need network and storage rate limiting since we don't trust the guests (CPU is handled by c-groups).

  • Change current PoC to use timer_fd as a source for refreshing the token buckets when limiter is at capacity (while not at capacity – when budget is still available – buckets are refreshed without the use of an external timer, it is done in the transaction processing flow). TimerFDs are a linux kernel feature and have a C interface so either use an external rust crate, or implement our own. Will try to find an external crate of high quality that also suits our needs.
  • Design and refactor the currently very hacky PoC to end up with proper/clean Block IO rate limiting.
  • Block IO rate limiting proper implementation might spill into this week as well.
  • Implement Network rate limiting – once we get the current design and code right for Block IO rate-limiting, network implementation should be smooth.

Emulate ACPI

Emulate the "Advanced Configuration and Power Interface" to support power management features.

Add kernel support for kvmclock

The current fallback clocksource of the kernel is 'tsc' which counts the number of cycles since reset. As a consequence, 'busybox date' is incorrect (constant). By enabling kvm clock we should obtain a synchronized date with the host.

Limit the size of a virtuqueue to its maximum possible

Currently the access modifier of the 'size' member of a virtqueue could lead to the maximum size becoming smaller than its actual size which would in turn invalidate the queue (effect: unlimited number of error messages).
Explicitly check that the size does not exceed max_size before setting it.
We should also put a limit on the number of messages displayed in case queue becomes invalid. See is_valid function from virtio/queue.rs.

CI Build-Time Tests

Via our CI system, ensure that PR/Merge actions are preceded by:

  • Successful build.
  • Unit testing.
  • Rust FMT.

Restful API

Firecracker is controlled via a RESTful API.

  • Figure out how to pass file descriptors atomically within the API message. #14
  • Create API definition #4
  • Implement the application program interface #15

Storage Virtualization

Implement VirtIO storage virtualization, based off the crosVM implementation.

Done when the guest OS can see & use a block storage device

Optimize the size of the kernel config used for Firecracker with VIRTIO

The minimal Linux kernel config we have been using so far does not have the relevant VIRTIO options enabled. Moreover, simply adding these options does not lead to a successful boot for a simple filesystem image created with deboostrap.

The boot process completes successfully for a larger config file (such as the one created by make defconfig + VIRTIO options), but we would like to disable all unnecessary features (or as many of them as possible).

Create API Definition

  • Identify API needs and design a model for interacting with firecracker's resources
  • Ramp-up on swagger
  • Describe the API using swagger (OpenAPI Specification)

VMM: Replace poll() with epoll()

The current polling mechanism is poll() which has the following disadvantages:

  • copies the used fd set each time poll() is called
  • cannot pass private data per fd

We should use epoll to overcome these problems.

Definition of done:

  • Have the vmm use epoll() for the async loop.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.