Giter VIP home page Giter VIP logo

charrua's Introduction

MirageOS logo
Build Unikernels in OCaml

OCaml-CI Build Status docs


MirageOS is a library operating system that constructs secure, performant and resource-efficient unikernels.

About

MirageOS is a library operating system that constructs unikernels for secure, high-performance network applications across various cloud computing and mobile platforms. Developers can write code on a traditional OS such as Linux or macOS. They can then compile their code into a fully-standalone, specialised unikernel that runs under the Xen or KVM hypervisors and lightweight hypervisors like FreeBSD's BHyve, OpenBSD's VMM. These unikernels can deploy on public clouds, like Amazon's Elastic Compute Cloud and Google Compute Engine, or private deployments.

The most up-to-date documentation can be found at the homepage. The site is a self-hosted unikernel. Simpler skeleton applications are also available online. MirageOS unikernels repositories are also available here or there.

This repository

This repository contains the mirage command-line tool to create and deploy applications with MirageOS. This tool wraps the specialised configuration and build steps required to build MirageOS on all the supported targets.

Local install

You will need the following:

  • a working OCaml compiler (4.08.0 or higher).
  • the Opam source package manager (2.1.0 or higher).
  • an x86_64 or armel Linux host to compile Xen kernels, or FreeBSD, OpenBSD or MacOS X for the solo5 and userlevel versions.

Then run:

$ opam install mirage
$ mirage --version

This should display at least version 4.0.0.

Using mirage

There are multiple stages to using mirage:

  • write config.ml to describe the components of your applications;
  • call mirage configure to generate the necessary code and metadata;
  • optionally call make depends to install external dependencies and download Opam packages in the current dune workspace.
  • call dune build to build a unikernel.

You can find documentation, walkthroughs and tutorials over on the MirageOS website. The install instructions are a good place to begin!

charrua's People

Contributors

avsm avatar craigfe avatar djs55 avatar dsheets avatar gridbugs avatar haesbaert avatar hannesm avatar juga0 avatar olleolleolle avatar samoht avatar talex5 avatar thelortex avatar tmcgilchrist avatar yomimono 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

charrua's Issues

calling buf_of_pkt with very long lists of options can crash

It's possible to call buf_of_pkt on a Dhcp_wire.pkt with an options field containing so many options that the buffer obtained for write is overrun in buf_of_options:

    (Invalid_argument
  "Cstruct.blit_from_string src=[64] dst=[2039,9](2048) dst-off=0 len=64")
    Raised at file "pervasives.ml", line 33, characters 20-45
    Called from file "lib/dhcp_wire.ml", line 841, characters 4-34
    Called from file "list.ml", line 88, characters 24-34
    Called from file "lib/dhcp_wire.ml", line 1036, characters 15-56
    Called from file "lib/dhcp_wire.ml", line 1124, characters 20-60

Write regression tests that mock IO.

It's horrible having to have a dhcp setup to actually test things, we should have regression tests that mock io and simulates a server/client in different cases.

Write a mini library for receiving a packet with the incoming interface. Makes mirage life easier.

So I'm rewriting extunix recvmsg to accept variant ancillary data. It currently works but it needs some finishing touches.

This will be a temporary solution as Anil pointed out it would be easier to have a solo implementation with ctypes.

But since I had begun this already, and talked to ygrek in extunix, I'm finishing it. When this is done I'll rewrite it in ctypes and drop the extunix dependency as suggested in issue #1

dhcp does not answer with correct ClientId

When using dhcpcd on archlinux to retrieve an address from the mirage dhcp server. The server does not respond with the correct ClientId.
dhcpc send CliendId with type 0xff,
mirage server answer with CliendId with type 0x00

Should hosts inherit network settings from the general pool?

I'm configuring a server by assembling a Dhcp_server.Config.t . I have one host included in the list. I was surprised that when there's no Subnet_mask set in the host's list of options, it doesn't inherit one from the more general network configuration in the Dhcp_server.Config.t. Is this a bug, or just a failure of understanding on my part?

Remove classic-display.

When we switched to topkg we inherited -classic-display in ocamlbuild, since topkg changes the default.

So far my solution is to keep my own topkg pinned and remove it.

Jbuilder generates bad .merlin in lib/

Since the topkg port, it seems merlin is broken.

It works for me if I removed the following two lines from lib/.merlin for example:
FLG -ppx "../_build/default/.ppx/ppx_sexp_conv+ppx_cstruct/ppx.exe --as-ppx --cookie 'library-name="dhcp_wire"' -no-check"
FLG -w -40 -w -40

Probably the problem is just the first, I've no idea what that is. I can't really code without merlin, does anyone know what's going on ?

Setup travis.

avsm@ already did it, I need to create an account and put my stuff in it.

Add support for answering IP lease timers in DHCPINFORM.

Currently the code assumes T1/T2 and IP_LEASE_TIME are included from a DHCPDISCOVER and a DHCPREQUEST, would be nice to tweak collect_replies so that it may answer a DHCPINFORM requesting a T1 for example.

One idea is to make collect_replies take a list of Parameter requests to ignore, so that we may still process them priorly.

Handle DHCPDISCOVER address hints

Currently we ignore the Requested_ip_address in a DHCPDISCOVER, would be nice to have this.
Some clients wrongly include a Requested_ip_address 0.0.0.0 to specify no preferences, this must be handled too.

renaming

Would it be possible to:

  1. rename the repository to charrua
  2. rename the core library to charrua

Not sure that -core is needed anymore. WDYT?

Stop exporting module Log.

Currently just to get going on the conversion from hdhcpd->charrua-core I'm installing all necessary modules via opam.

Allow empty range in server configuration.

It's useful to be able to create a DHCP server that serves addresses only in response to "registered" MAC addresses -- in other words, to have no general address range, but serve only fixed addresses that match known hosts. Dhcp_server.Config.t doesn't currently allow this, as range is not an option field.

Mysterious problem with MacAir broadwell.

Somehow after a long sleep, the client sends a discover, we send a reply, but the client does not see the reply. This was observed with charrua-mirage, it might not occur in charrua-unix.

Check checksum.

Currently we ignore the incoming checksum, this should be checked and the packet dropped accordingly.

ping before release! randomise lease ip

while deploying charrua in africa with no persistent leases, we discovered that a restart of charrua leads to it handing out ip addresses with active lease (from the previous incarnation). -- see also https://tools.ietf.org/html/rfc5227

ways to fix this include:

  • ask via arp before handing out an ip address
  • randomise (instead of linear search) which ip to hand out

IMHO we should do both.

Convert to mirage.

Now that basic functionality is in place and works, it's time to move to mirage.

`buf_of_pkt` allows creation of unreadable packets

Particularly, when given an empty list for options (which I would expect to be an error condition, since DHCP messages aren't valid without at least message-type):

utop # t;;
- : pkt =  {srcmac = <abstr>; dstmac = <abstr>; srcip = <abstr>; dstip = <abstr>;
            srcport = 68; dstport = 67; op = BOOTREQUEST; htype = Ethernet_10mb;
            hlen = 6; hops = 0; xid = 2l; secs = 0; flags = Broadcast; ciaddr = <abstr>;
            yiaddr = <abstr>; siaddr = <abstr>; giaddr = <abstr>; chaddr = <abstr>;
            sname = ""; file = ""; options = []}
utop # let b = Dhcp_wire.buf_of_pkt t;;
val b : Cstruct.t = {Cstruct.buffer = <abstr>; off = 0; len = 342}
utop # Dhcp_wire.pkt_of_buf b (Cstruct.len b);;
- : (pkt, string) result = Error "Invalid cookie"   

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.