From 198599912d618c0243773514f780579b0dd931e1 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 7 Mar 2017 15:03:03 +0000 Subject: [PATCH] infrakit: Update docs While at it, also simplify the JSON file Signed-off-by: Rolf Neugebauer --- tools/infrakit.hyperkit/README.md | 31 +++++++++++++++++++++++---- tools/infrakit.hyperkit/hyperkit.json | 11 +--------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/tools/infrakit.hyperkit/README.md b/tools/infrakit.hyperkit/README.md index 46e2a6cf8..7e70d0864 100644 --- a/tools/infrakit.hyperkit/README.md +++ b/tools/infrakit.hyperkit/README.md @@ -14,14 +14,37 @@ command line using the `--vm-dir` option. ```sh make ``` -(you need a working docker installation...testing on Docker for Mac) +(you need a working docker installation, such as Docker for Mac) ## Quickstart -To play round with the plugin, simply follow the [infrakit tutorial](https://github.com/docker/infrakit/blob/master/docs/tutorial.md) and replace the file instance plugin with: +This is roughly based on the [infrakit tutorial](https://github.com/docker/infrakit/blob/master/docs/tutorial.md). You need to have the infrakit binaries in your path (or adjust the invocation of the commands below). To get the binaries, it's best to compile from source (checkout `https://github.com/docker/infrakit.git`, then `make` or `make build-in-container`). The add the `./build` directory to your path. + +Start the default group plugin: +```shell +infrakit-group-default ``` +and the vanilla flavour plugin: +```shell +infrakit-flavor-vanilla +``` + +Then start the hyperkit plugin: +```shell ./build/infrakit-instance-hyperkit ``` -where `./vmlib` contains a sub-directory named `default` with a `vmlinuz64` and `initrd.img` image. -Instead of the `cattle.json` in the infrakit tutorial, use `hyperkit.json` in this directory. +Next, you can commit a new configuration. There is a sample infrakit config file in `hyperkit.json` which assumes that the directory `./vms/default` contains the `vmlinuz64` and `initrd.img` image to boot. +``` +infrakit group commit hyperkit.json +``` + +This will create a single hyperkit instance with its state stored in +`~/.infrakit/hyperkit-vms`. There is a `tty` file which you can +connect to with `screen` to access the VM. + +If you kill the hyperkit process a new instance will be restarted. If +you change the VM parameter in JSON file and commit the new config, a +new VM will be created. f you change the `Size` parameter, multiple +VMs will get started. + diff --git a/tools/infrakit.hyperkit/hyperkit.json b/tools/infrakit.hyperkit/hyperkit.json index 73921aa74..574b6c17d 100644 --- a/tools/infrakit.hyperkit/hyperkit.json +++ b/tools/infrakit.hyperkit/hyperkit.json @@ -15,16 +15,7 @@ }, "Flavor": { "Plugin": "flavor-vanilla", - "Properties": { - "Init": [ - "docker pull nginx:alpine", - "docker run -d -p 80:80 nginx-alpine" - ], - "Tags": { - "tier": "web", - "project": "infrakit" - } - } + "Properties": { } } } }