diff --git a/README.md b/README.md
index f222dc6..419251f 100755
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Performance-wise, **HyperContainer is super light**:
- **Sub-second Boot**: milliseconds to launch a HyperContainer
- **Slimmed Footprint**: ~28 MB RAM (512MB on AWS EC2)
-With HyperContainer, the future of Container-as-a-Service is just around the corner.
-
-
+Since version 0.8, HyperContainer supports [Kubernetes CRI (Container Runtime Interface)][CRI], and has been integrated with [kubernetes frakti][frakti].
+[CRI]:http://blog.kubernetes.io/2016/12/container-runtime-interface-cri-in-kubernetes.html
+[frakti]:https://github.com/kubernetes/frakti
diff --git a/SUMMARY.md b/SUMMARY.md
index dbb5a64..d6893f6 100755
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -8,17 +8,15 @@
* [ Packet ](performance/perf-on-packet.md)
* [Get Started](get_started/README.md)
* [Install](get_started/install.md)
- * [Linux](get_started/install/linux.md)
- * [Mac](get_started/install/mac.md)
+ * [Binary Packages](get_started/install/linux.md)
* [Build from source](get_started/install/build.md)
- * [Pod](get_started/pod.md)
* [Lifecycle](get_started/lifecycle.md)
- * [Get Started on Mac](get_started/darwin.md)
+ * [OCI Image Spec](get_started/oci_image.md)
+* [HyperContainer Internals](internal/README.md)
+ * [Pod in HyperContainer](internal/pod.md)
+ * [HyperContainer Q&A](internal/q_a.md)
* [Reference](reference/README.md)
- * [Podfile](reference/podfile.md)
- * [Containers](reference/containers.md)
- * [Volumes](reference/volumes.md)
- * [Files](reference/files.md)
+ * [Hyperd Config](reference/configuration.md)
* [CLI](reference/cli.md)
* [run](reference/run.md)
* [start](reference/start.md)
@@ -26,28 +24,36 @@
* [attach](reference/attach.md)
* [exec](reference/exec.md)
* [create](reference/create.md)
- * [replace](reference/replace.md)
+ * [kill](reference/kill.md)
* [rm](reference/rm.md)
* [info](reference/info.md)
* [list](reference/list.md)
+ * [ports](reference/ports.md)
* [pull](reference/pull.md)
* [images](reference/images.md)
* [rmi](reference/rmi.md)
* [commit](reference/commit.md)
* [build](reference/build.md)
* [push](reference/push.md)
+ * [save](reference/save.md)
+ * [load](reference/load.md)
* [login](reference/login.md)
* [logout](reference/logout.md)
* [API](reference/api.md)
- * [Config](reference/configuration.md)
+ * [Pod Spec](reference/podfile.md)
+ * [Container Spec](reference/containers.md)
+ * [Volumes](reference/volumes.md)
+ * [Files](reference/files.md)
* [License](license.md)
* [Trouble Shooting](trouble_shooting/README.md)
* [Platform Independent FAQ](trouble_shooting/general.md)
* [Qemu/KVM FAQ](trouble_shooting/qemu.md)
* [Xen FAQ](trouble_shooting/xen.md)
- * [Mac FAQ](trouble_shooting/darwin.md)
* [Release Notes](release_notes/README.md)
* [latest](release_notes/latest.md)
+ * [v0.8 (2017-03-20)](release_notes/v0.8.md)
+ * [v0.7 (2016-10-28)](release_notes/v0.7.md)
+ * [v0.6 (2016-05-25)](release_notes/v0.6.md)
* [v0.5 (2016-02-05)](release_notes/v0.5.md)
* [v0.4 (2015-09-18)](release_notes/v0.4.md)
* [v0.3 (2015-07-29)](release_notes/v0.3.md)
diff --git a/figures/lifecycle.png b/figures/lifecycle.png
new file mode 100644
index 0000000..80f3729
Binary files /dev/null and b/figures/lifecycle.png differ
diff --git a/get_started/darwin.md b/get_started/darwin.md
deleted file mode 100755
index 7591384..0000000
--- a/get_started/darwin.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Get Started on Mac
-
-> *Note*: OS X 10.11.x is not supported yet, we are working on new Hyper Mac to support the OS X Hypervisor Framework. The Mac package is not included in the 0.5.0 release of Hyper.
-
-This page introduces the daily usage of Hyper for Mac. If you meet any problem not described here, see the [trouble shooting page](../trouble_shooting/darwin.md).
-
-Mac OS X has been introduced in [Hyper v0.3](http://docs.hypercontainer.io/release_notes/v0.3.html)
-
-## Install
-
-To install Hyper on Mac OS X, you need first to install VirtualBox 5.0, then download and Install the [hyper-mac.pkg](http://hyper-install.s3.amazonaws.com/hyper-mac.pkg)
-
-
-
-## Command Line
-
-Hyper for Mac supports the following subcommands in current version.
-
- attach Attach to the tty of a specified container in a pod
- build Build an image from a Dockerfile
- commit Create a new image from a container's changes
- create Create a pod into 'pending' status, but without running it
- exec Run a command in a container of a running pod
- images List images
- info Display system-wide information
- list List all pods or containers
- login Register or log in to a Docker registry server
- logout Log out from a Docker registry server
- pull Pull an image from a Docker registry server
- push Push an image or a repository to a Docker registry server
- rm Remove one or more pods
- rmi Remove one or more images
- run Create a pod, and launch a new pod
- start Launch a 'pending' pod
- stop Stop a running pod, it will become 'pending'
-
-All the commands support `-h` flag for further information. Specially, the run command supports `-p` flag to run a pod, there are example pods under `/opt/hyper/examples/`.
-
-## Stop and Start the Service
-
-Hyper for Mac service is managed with launchd, use the following command to start/stop it
-
- sudo launchctl unload /Library/LaunchDaemons/sh.hyper.hyper.plist
- sudo launchctl load /Library/LaunchDaemons/sh.hyper.hyper.plist
-
-And use the following command to check the daemon status.
-
- > sudo launchctl list sh.hyper.hyper
- {
- "LimitLoadToSessionType" = "System";
- "Label" = "sh.hyper.hyper";
- "TimeOut" = 30;
- "OnDemand" = false;
- "LastExitStatus" = 0;
- "PID" = 32396;
- "Program" = "/opt/hyper/bin/hyperd";
- "ProgramArguments" = (
- "/opt/hyper/bin/hyperd";
- "--config=/opt/hyper/etc/hyper/config";
- "-v=1";
- "--nondaemon";
- );
- };
-
-## Update and Re-Install
-
-Hyper for Mac package can be re-installed, re-install won't cause data loss.
-
-## Uninstall
-
-Hyper for Mac package ships an uninstall script at `/opt/hyper/bin/uninstall-hyper.sh`.
-
-- with `--purge` flag, it will delete hyper and all images and containers
-- without the flag, it will keep the images and containers.
diff --git a/get_started/install.md b/get_started/install.md
index 72f14ca..77cc6e3 100755
--- a/get_started/install.md
+++ b/get_started/install.md
@@ -1,7 +1,5 @@
# Install
-## [Linux version](./install/linux.md)
-## [Mac version](./install/mac.md)
+## [Binary packages for Linux distros](./install/linux.md)
## [Build from source](./install/build.md)
-
diff --git a/get_started/install/build.md b/get_started/install/build.md
index 2081f8f..3852d74 100755
--- a/get_started/install/build.md
+++ b/get_started/install/build.md
@@ -7,13 +7,12 @@ Clone hyper in GoPath
> cd ${GOPATH}/src
> mkdir -p github.com/hyperhq
> cd github.com/hyperhq
- > git clone https://github.com/hyperhq/hyper.git hyper
- > git clone https://github.com/hyperhq/runv.git runv
+ > git clone https://github.com/hyperhq/hyperd.git
-And make sure you have `go` (>= 1.4) and `autotools`, develop files of
-`libdevmapper`, `libsqlite3`, then
+And make sure you have `go` (>= 1.5, 1.7 or later is recommended) and `autotools`, develop files of
+`libdevmapper`, `libsqlite3`, `libvirt-devel` then
- > cd hyper
+ > cd hyperd
> ./autogen.sh
> ./configure
> make
@@ -42,9 +41,18 @@ And build with autotools
Then you can find `hyper-initrd.img` in build directory, together with a pre-build `kernel`. You can also find the `kernel_config` in the repo.
+#### Build Qemu
+
+Hyperd could work with vanilla qemu 2.0 or newer, however, we provided our branch with some patches from hyper:
+
+```
+https://github.com/hyperhq/qemu/tree/2.4.1-template
+```
+
+If you build Qemu from source, don't forget enable virtfs (`--enable-virtfs`) during configuration.
+
#### Build Your Own Kernel
-You can reference the [Hyper kernel configuration](https://github.com/hyperhq/hyperstart/blob/master/build/kernel_config),
-and for Qemu/KVM driver, you'd better build new CBFS ROMs with `make cbfs`, which will add the kernel in `build/` and initramfs into a CBFS ROM.
+You can reference the [Hyper kernel configuration](https://github.com/hyperhq/hyperstart/blob/master/build/kernel_config).
-You can find related configuration items in [the config file](../reference/configuration.html).
+You can find related configuration items in [the config file](../../reference/configuration.html).
diff --git a/get_started/install/linux.md b/get_started/install/linux.md
index 44c045d..a42cbe0 100755
--- a/get_started/install/linux.md
+++ b/get_started/install/linux.md
@@ -1,3 +1,5 @@
+# Install with Binary Packages
+
## Requirements
- Hypervisor: at least one of
@@ -6,39 +8,13 @@
## Install
-[the current version](../release_notes/latest.md) supports the following Linux distros:
+[the current version](../../release_notes/latest.md) supports the following Linux distros:
- Ubuntu ( > 14.04 )
-- CentOS/RHEL 7.x
-- Fedora ( > 20 )
+- CentOS/RHEL ( 7.x )
+- Fedora ( > 23 )
- Debian ( > 7.0 )
-### curl-to-bash or tarball
-
-To setup Hyper, simply run (after 0.4, the same package support both
- KVM and Xen)
-
- curl -sSL http://hypercontainer.io/install | bash
-
-Don't like the "curl to bash" methods? Download [tarball here](http://hyper-install.s3.amazonaws.com/hyper-latest.tgz).
-
-For CentOS/RHEL users, please use the pre-build RPMs
-
-If you build Qemu from source, don't forget enable virtfs (`--enable-virtfs`) during configuration.
-
-### RPMs for CentOS/RHEL7
-
-x86_64 binary packages:
-
-> - [hyper-0.5-1.el7.centos.x86_64.rpm](https://s3.amazonaws.com/hyper-install/hyper-0.5-1.el7.centos.x86_64.rpm)
-> - [hyperstart-0.5-1.el7.centos.x86_64.rpm](https://s3.amazonaws.com/hyper-install/hyperstart-0.5-1.el7.centos.x86_64.rpm)
-> - [qemu-hyper-2.4.1-2.el7.centos.x86_64.rpm](https://s3.amazonaws.com/hyper-install/qemu-hyper-2.4.1-2.el7.centos.x86_64.rpm)
-
-## RPMs for Fedora 23
-
-x86_64 binary packages:
-
-> - [hyper-0.5-1.fc23.x86_64.rpm](https://s3.amazonaws.com/hyper-install/hyper-0.5-1.fc23.x86_64.rpm)
-> - [yperstart-0.5-1.fc23.x86_64.rpm](https://s3.amazonaws.com/hyper-install/hyperstart-0.5-1.fc23.x86_64.rpm)
+Download the pre-built packages from [download.hypercontainer.io][download.hypercontainer.io]
-> *Note*: The qemu shipped in Fedora could work well with Hyper, we did not package qemu for Fedora.
+[download.hypercontainer.io]:http://download.hypercontainer.io/
diff --git a/get_started/install/mac.md b/get_started/install/mac.md
deleted file mode 100755
index 6345a1f..0000000
--- a/get_started/install/mac.md
+++ /dev/null
@@ -1,22 +0,0 @@
-> *Note*: OS X 10.11.x is not supported yet, we are working on new Hyper Mac to support the OS X Hypervisor Framework. The Mac package is not included in the 0.5.0 release of Hyper.
-
-## Requirements
-
-- Hypervisor
- - [Mac OS X] VirtualBox 5.0
-
-## Install
-
-To install Hyper on Mac OS X, you need first to install VirtualBox 5.0, then download and Install the [hyper-mac.pkg](http://hyper-install.s3.amazonaws.com/hyper-mac.pkg)
-
-
-
-The Hyper Mac package contains
-
-- `hyperd` Daemon, which could be controled with `launchctl`
-- `hyperctl` command line control tool with
-- An uninstall shell script, located under `/opt/hyper/bin/uninstall-hyper.sh`
-
-> If you need to uninstall hyper and clean all existing images and containers, call the uninstall script with `--purge` flag.
-
-> VirtualBox is an open source hypervisor provided by Oracle.
diff --git a/get_started/lifecycle.md b/get_started/lifecycle.md
index c3e27c8..864a77d 100755
--- a/get_started/lifecycle.md
+++ b/get_started/lifecycle.md
@@ -1,47 +1,47 @@
# Lifecycle
-
-
-In Hyper, a Pod has two states:
-
-- `Created`: a Pod is defined, its storage has been allocated, and the Docker images have been downloaded
-- `Running`: a Pod (with its containers) is launched in a VM instance
+
+In HyperContainer, a Pod is encapsulated in a VM. Since v0.8, HyperContainer simplified the model of Pod and underlying VM (as well as the state machine). The lifecycle of Pod and VM are no longer managed separately.
A Pod can be launched either explicitly:
- [root@user ~:]# hyperctl run -p podfile.json
+ ➜ sudo ./hyperctl run -p podfile.json
Or, implicitly:
- [root@user ~:]# hyperctl run -t ubuntu
-
-In both cases, Pods and VMs are indivisible. Hyper will automatically provision a new VM instance to host the Pod, and the Pod will be `Running`.
-
-However, you can also create a Pod, but without an underlying VM. In such case, the pod stays in `Created` state.
-
- [root@user ~:]# hyperctl create -p podfile.json
-
-There are two options to start the pod:
-
- [root@user ~:]# hyperctl start pod_id
-
-The `START` command will trigger a VM provisioned, and allocate the new VM to the Pod. Alternatively, you can choose to `REPLACE` a running one:
-
- [root@user ~:]# hyperctl replace -o old_pod_id -n new_pod_id
-
-In this case, the VM instance will be de-associated from `old_pod_id` and re-assign to `new_pod_id`. Since the VM is already present, `REPLACE` is a faster option to launch a pod, than `RUN` and `START`.
-
-> Note: `old_pod_id` must be running.
-
-When you `STOP` a Pod, the underlying VM instance will be terminated:
-
- [root@user ~:]# hyperctl stop pod_id
-
-When stopped, the Pod will return to the `Created` state.
-
-To permantly destroy a Pod, you need to `RM` it:
-
- [root@user ~:]# hyperctl rm pod_id
-
-Hyper will (stop if neccessary, then) remove the Pod definition and its storage.
+ ➜ sudo ./hyperctl run -d nginx
+ POD id is nginx-8530075287
+
+In both cases, Pods and VMs are indivisible. Hyper will automatically create a new VM instance to host the Pod, and the Pod will be `Running`. There could be zero, one, or more containers in a Pod. And you can create, start, stop, and remove containers in/from a Pod.
+
+ ➜ sudo ./hyperctl create -c -d nginx-8530075287 busybox
+ Container ID is a8fd34f686e6587979936df880b9e9144fefd895d19560493d2028aa82c47f0c
+ ➜ sudo ./hyperctl list container
+ Container ID Name POD ID Status
+ 6e8c08420389a165682586380fa35432f5922287b9aec34059ed1ff68b3f1623 nginx-8530075287 nginx-8530075287 running
+ a8fd34f686e6587979936df880b9e9144fefd895d19560493d2028aa82c47f0c busybox-2602968228 nginx-8530075287 pending
+ ➜ sudo ./hyperctl start -c busybox-2602968228
+ Successfully started container busybox-2602968228
+ ➜ sudo ./hyperctl list container
+ Container ID Name POD ID Status
+ a8fd34f686e6587979936df880b9e9144fefd895d19560493d2028aa82c47f0c busybox-2602968228 nginx-8530075287 running
+ 6e8c08420389a165682586380fa35432f5922287b9aec34059ed1ff68b3f1623 nginx-8530075287 nginx-8530075287 running
+ ➜ sudo ./hyperctl stop -c busybox-2602968228 nginx-8530075287
+ ➜ sudo ./hyperctl list container
+ Container ID Name POD ID Status
+ 6e8c08420389a165682586380fa35432f5922287b9aec34059ed1ff68b3f1623 nginx-8530075287 nginx-8530075287 succeeded
+ a8fd34f686e6587979936df880b9e9144fefd895d19560493d2028aa82c47f0c busybox-2602968228 nginx-8530075287 succeeded
+ ➜ sudo ./hyperctl rm -c busybox-2602968228 nginx-8530075287
+ container busybox-2602968228 is successfully deleted!
+ container nginx-8530075287 is successfully deleted!
+ ➜ sudo ./hyperctl list container
+ Container ID Name POD ID Status
+ ➜ sudo ./hyperctl list
+ POD ID POD Name VM name Status
+ nginx-8530075287 nginx-8530075287 vm-pqEnBvQVdS running
+
+And you could stop or remove the Pod.
+
+ ➜ sudo ./hyperctl rm nginx-8530075287
+ Pod(nginx-8530075287) is successfully deleted!
diff --git a/get_started/oci_image.md b/get_started/oci_image.md
new file mode 100644
index 0000000..f50343a
--- /dev/null
+++ b/get_started/oci_image.md
@@ -0,0 +1,58 @@
+# Get Started with OCI Image Spec
+
+Since version 0.8, hyperd supported [OCI Image](https://github.com/opencontainers/image-spec). You may save your images to OCI image format with [save](../reference/save.md) command, and load OCI Image with [load](../reference/load.md) command.
+
+Here is a simple example:
+
+```
+# hyperctl images
+REPOSITORY TAG IMAGE ID
+busybox latest 7968321274dc
+centos 7 980e0e4c79ec
+
+//save centos:7 image as refname "hello" and busybox:latest image as refname "world" in mix-oci.tar usging oci image format
+# hyperctl save -o /tmp/mix-oci.tar -f oci -r centos:7=hello -r busybox:latest=world centos:7 busybox:latest
+
+// untar mix-oci.tar and find index.json file
+# cat index.json |jq
+{
+ "schemaVersion": 2,
+ "manifests": [
+ {
+ "mediaType": "application/vnd.oci.image.manifest.v1+json",
+ "digest": "sha256:351c1c2957c21a76d7b74e94afabd6429d4a3d16cbe6ee7e7b1f351e39125490",
+ "size": 346,
+ "annotations": {
+ "org.opencontainers.ref.name": "hello"
+ },
+ "platform": {
+ "architecture": "amd64",
+ "os": "linux"
+ }
+ },
+ {
+ "mediaType": "application/vnd.oci.image.manifest.v1+json",
+ "digest": "sha256:87fe700a194b98ab383582f9981539d9a69d49e1143e91fe0e75c4a92f5de42e",
+ "size": 344,
+ "annotations": {
+ "org.opencontainers.ref.name": "world"
+ },
+ "platform": {
+ "architecture": "amd64",
+ "os": "linux"
+ }
+ }
+ ]
+}
+
+// rm centos:7 and busybox:latest images for loading them from mix-oci.tar
+# hyperctl rmi centos:7 busybox:latest
+
+// load centos and busybox images from mix-oci.tar and retag them as centos:test and busybox:test
+# hyperctl load -i /tmp/oci/mix-oci.tar -r centos:7=hello -r busybox:test=world
+
+# hyperctl images
+REPOSITORY TAG IMAGE ID
+busybox test 7968321274dc
+centos test 980e0e4c79ec
+```
diff --git a/instance/README.md b/instance/README.md
deleted file mode 100755
index 8dae3a3..0000000
--- a/instance/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# HyperVM
-
-HyperVM is the VM instance booted by the minimalist HyperKernel. A HyperVM is loaded with a single [Pod](../pod/README.md), which runs a group of containers.
-
-A Pod could run on top of a VM, or stop on it. A VM does not have persistent status: they will be reclaimed after shutdown.
-
-A running VM has 2 state:
-
-- **Associated** with a Pod, or
-- **Idle**
diff --git a/instance/ephemeral_&_persistent.md b/instance/ephemeral_&_persistent.md
deleted file mode 100755
index 82387d0..0000000
--- a/instance/ephemeral_&_persistent.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Ephemeral & Persistent
-
-Although a HyperVM instance is considered as an ephemeral entity due to its nature of sub-second boot, it certainly could be also used as long-running and durable.
-
-- Ephemeral
-
-
- In a microservice architecture, apps are scheduled to (physical) hosts. Where a new Hyper instance is created, the app is loaded into the instance and remains there until termination or deletion. When an app died (or the instance), the app will be scheduled to another host, with a new instance. If a host died, either all apps on the host can be rescheduled, or all instances on the host can be restarted on other hosts (if shared storage available).
-
-- Persistent
-
-
- For big data application (Hadoop, Spark), new jobs are consistently dispatched to hosts. Instead of creating ephemeral instances for each task, the application could use persistent Hyper instance and "submit" jobs by calling Hyper's REST API to replace the binary in the instance.
diff --git a/internal/README.md b/internal/README.md
new file mode 100644
index 0000000..6815b54
--- /dev/null
+++ b/internal/README.md
@@ -0,0 +1,4 @@
+# HyperContainer Internals
+
+## [Pod in HyperContainer](pod.md)
+## [HyperContainer Q&A](q_a.md)
diff --git a/get_started/pod.md b/internal/pod.md
similarity index 100%
rename from get_started/pod.md
rename to internal/pod.md
diff --git a/internal/q_a.md b/internal/q_a.md
new file mode 100644
index 0000000..6df0c5f
--- /dev/null
+++ b/internal/q_a.md
@@ -0,0 +1,17 @@
+# HyperContainer Q&A
+
+## Isolation and Resource Provision
+
+#### Where will be applied my resource constraints which I given in the POD definition? On container level, VM level or both?
+
+A pod of hypercontainer is run in a VM, and the resource constraints are applied to a pod (vm).
+
+> Source: ([hyperhq/hyperd#538][hyperhq/hyperd#538])
+
+#### Can I scale in/out any kind of resources (e.g. adding more RAM or CPU)?
+
+The memory and cpu are hotplug-able, however, we don't scale these resources now.
+
+> Source: ([hyperhq/hyperd#538][hyperhq/hyperd#538])
+
+[hyperhq/hyperd#538]:https://github.com/hyperhq/hyperd/issues/538
diff --git a/pod/README.md b/pod/README.md
deleted file mode 100755
index 879d2b7..0000000
--- a/pod/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# What is Pod
-
-Pod is a concept originated from [Google](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/pods.md). According to [Google Kuberenetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/pods.md):
-
- In Kubernetes, rather than individual application containers, Pods are the smallest deployable units that can be created, scheduled, and managed.
-
- A Pod (as in a pod of whales or pea pod) corresponds to a colocated group of applications running with a shared context. Within that context, the applications may also have individual cgroup isolations applied. A Pod models an application-specific "logical host" in a containerized environment. It may contain one or more applications which are relatively tightly coupled -- in a pre-container world, they would have executed on the same physical or virtual host.
-
-The key idea behind **Pod** is that in a microservice architecture usually involves some "helper" programs, such as log, monitoring, cron, etc. These helper programs are built to work cooperatively with the app. Therefore, instead of running in multiple isolated containers, these processes should share the namespace, though they are packaged in different images.
-
-## Pod is the first class in Hyper
-
-In Hyper, a pod consists of a colocated group of AppContainer images, deployed as a single unit in one Hyper instance.
-
- [root@user ~:]# hyperctl run -p nginx rails logstash cronjob
-
-Inside of the instance, multiple applications from different images share the namespaces: ***`PID`***, ***`Network`***, ***`IPC`***, ***`UTS`***, ***`User`***. Pod helps to provide a familiar view of a tranditional OS to applications, rather than the philosophy of "*one process per container*":
-
-- Processes can see each other
-- Processes can use all IPC facilities to communicate
-- Processes share the same hostname
-- Processes have access to all NICs attached to the instance, and share the same port range
-- Processes have access to all disk attached to the instance
-
-The exception is ***`Mount`***. Since a Pod may have multiple app images, Hyper applies the ***`Mount`*** namespace to isolate the root filesystem from each other.
-
-Note: Hyper is immune from [Pid 1 problem](https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/), since HyperStart launches the app processes and continues to live in the same namespace with them.
diff --git a/pod/pod_and_vm_states.md b/pod/pod_and_vm_states.md
deleted file mode 100755
index 8ea7966..0000000
--- a/pod/pod_and_vm_states.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-# The Life of Pod
-
-### Pod
-
-A Pod is the atomic unit to schedule, containing one or more containers, which are instances of an Image.
-
-A Pod is specified by a *Pod spec*, and has persistent data after being created, and won't be removed from storage until being removed explicitly.
-
-A Pod has the following states
-
-- **None**: No ID, No storage, Noting at all
-- **Created**: Prepared, but not run
- - Container storage allocated, but
- - for dm, only stay in thin pool, do not make device in `/dev`
- - for aufs, dir created and file putted, do not mount aufs in anywhere
- - Volume only allocated, like container
-- **Running**: Running on a VM, could attach to and exec command in container
- - Container and Volume device inserted to VM, or dirs bound/mounted in correspond path
-
-## Procedures & Commands
-
-### Common Procedures
-
-Common procedures can change the VM or Pod status
-
-- **run-pod** (shorten as **pod**)
- - run a VM, create a Pod, and let the pod run on the VM
- - if has VM-id parameter, could run pod on an existing VM
- - if Pod tty is enabled, and specified in command line, will attach to the tty of a container
-- **run-vm** (shorten as **vm**)
- - run a VM, without any Pod running on it
-- **create-pod** (shorten as **create**)
- - create a pod, let a pod become created but not run it
-- **start-pod** (shorten as **start**)
- - run a created Pod in a VM, create VM if VM id is not provided
-- **stop-pod** (shorten as **stop**)
- - stop a Pod and its VM running on
- - if has "flag", will stop Pod only, leaving VM running
-- **replace-pod** (shorten as **replace**)
- - stop a running Pod, then (create and) start another Pod on the VM
- - create and start is the default behavior, do not create if an existing Pod id provided
-- **attach** attach to tty of a specified container in a Pod
-- **exec**
- - run a command in a container, within a Pod, and attach the current terminal to the stdio of command
- - do not attach if detached flag (`-d`) is provided
-
-
-### Informative Commands
-
-- **info** daemon configuration, like `docker info`
-- **list** list existing VMs, Pods, and Containers
-
-### Shortcut
-
-- **run**, run a container on a VM
-
-### Bridge to docker
-
-- **pull**, pull docker image from remote registry to local
diff --git a/pod/the_life_of_pod.md b/pod/the_life_of_pod.md
deleted file mode 100755
index 1b4d002..0000000
--- a/pod/the_life_of_pod.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# The life of a Pod
-
-Updated: 4/14/2015
-
-This document covers the lifecycle of a Pod. It is not an exhaustive document, but an introduction to the topic.
-
-## Pod Phase
-
-As consistent with the overall [API convention](api-conventions.md#typical-status-properties), phase is a simple, high-level summary of the phase of the lifecycle of a Pod. It is not intended to be a comprehensive rollup of observations of container-level or even pod-level conditions or other state, nor is it intended to be a comprehensive state machine.
-
-The number and meanings of `PodPhase` values are tightly guarded. Other than what is documented here, nothing should be assumed about Pods with a given `PodPhase`.
-
-* Created: The Pod has been accepted by the system, but one or more of the container images have not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while.
-* Running: The Pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting.
-* Succeeded: All containers in the Pod have been terminated with success, and will not be restarted.
-* Failed: All containers in the Pod have been terminated, at least one container has been terminated with failure (exited with non-zero exit status or was terminated by the system).
-
-## Pod Conditions
-
-A Pod containing containers that specify readiness probes will also report the Ready condition. Condition status values may be `True`, `False`, or `Unknown`.
-
-## Container Statuses
-
-More detailed information about the current (and previous) container statuses can be found in `containerStatuses`. The information reported depends on the current ContainerState, which may be Waiting, Running, or Termination (sic).
-
-## RestartPolicy
-
-The RestartPolicy may be `Always`, `OnFailure`, or `Never`. RestartPolicy applies to all containers in the Pod. RestartPolicy only refers to restarts of the containers by the Kubelet on the same node. As discussed in the [Pods document](pods.md#durability-of-pods-or-lack-thereof), once bound to a node, a Pod may never be rebound to another node. This means that some kind of controller is necessary in order for a Pod to survive node failure, even if just a single Pod at a time is desired.
-
-The only controller we currently have is [`ReplicationController`](replication-controller.md). `ReplicationController` is *only* appropriated for Pods with `RestartPolicy = Always`. `ReplicationController` should refuse to instantiate any Pod with a different restart policy.
-
-There is a legitimate need for a controller which keeps Pods with other policies alive. Both of the other policies (`OnFailure` and `Never`) eventually terminate, at which point the controller should stop recreating them. Because of this fundamental distinction, let's hypothesize a new controller, called [`JobController`](https://github.com/GoogleCloudPlatform/kubernetes/issues/1624) for the sake of this document, which can implement this policy.
-
-## Pod lifetime
-
-In general terms, Pods which are created do not disappear until an action destroys them. This might be a human or a `ReplicationController`. The only exception to this rule is when Pods with a `PodPhase` of `Succeeded` or `Failed` for more than some duration (determined by the master) will expire and be automatically reaped.
-
-If a node dies or is disconnected from the rest of the cluster, some entity within the system (call it the NodeController for now) is responsible for applying a policy (e.g. a timeout), and marking any Pod on the lost node as `Failed`.
-
-## Examples
-
- * Pod is `Running`, 1 container, container exits success
- * Log completion event
- * If RestartPolicy is:
- * Always: restart container, Pod stays `Running`
- * OnFailure: Pod becomes `Succeeded`
- * Never: Pod becomes `Succeeded`
-
- * Pod is `Running`, 1 container, container exits failure
- * Log failure event
- * If RestartPolicy is:
- * Always: restart container, Pod stays `Running`
- * OnFailure: restart container, Pod stays `Running`
- * Never: Pod becomes `Failed`
-
- * Pod is `Running`, 2 containers, container 1 exits failure
- * Log failure event
- * If RestartPolicy is:
- * Always: restart container, Pod stays `Running`
- * OnFailure: restart container, Pod stays `Running`
- * Never: Pod stays `Running`
- * When container 2 exits...
- * Log failure event
- * If RestartPolicy is:
- * Always: restart container, Pod stays `Running`
- * OnFailure: restart container, Pod stays `Running`
- * Never: Pod becomes `Failed`
-
- * Pod is `Running`, container becomes OOM
- * Container terminates in failure
- * Log OOM event
- * If RestartPolicy is:
- * Always: restart container, Pod stays `Running`
- * OnFailure: restart container, Pod stays `Running`
- * Never: log failure event, Pod becomes `Failed`
-
- * Pod is `Running`, a disk dies
- * All containers are killed
- * Log appropriate event
- * Pod becomes `Failed`
- * If running under a controller, Pod will be recreated elsewhere
-
- * Pod is `Running`, its node is segmented out
- * NodeController waits for timeout
- * NodeController marks pod `Failed`
- * If running under a controller, Pod will be recreated elsewhere
-
-
-[]()
diff --git a/reference/api.md b/reference/api.md
index 3006a8a..f498767 100755
--- a/reference/api.md
+++ b/reference/api.md
@@ -1,14 +1,13 @@
-# API
-
-This is the API reference of `hyperd` based on [The latest release](../release_notes/latest.md).
+# RESTful API
+This is the REST API reference of `hyperd` based on [The latest release](../release_notes/latest.md).
### 1. Introduction
* By default `hyperd` listens on unix:///var/run/hyper.sock and the client must have root access to interact with the daemon.
* [The current release](../release_notes/latest.md) does not support encrypted connections.
* The Remote API uses an open schema model. In this model, unknown properties in incoming messages will be ignored. Client applications need to take this in consideration to ensure they will not break when talking to newer hyperd daemons.
* Calling `/info` is the same as calling `/${latest}/info`
-* The API tends to be RESTfull, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout, stdin and stderr
+* The API tends to be RESTful, but in a few exceptions, e.g. `attach`, `pull`, the HTTP connection is hijacked to transport stdout, stdin and stderr.
### 2. Endpoints
#### 2.1 Pod
@@ -43,7 +42,7 @@ Stop a Pod
The `stopVM` property can be `yes` or `no`; it will destroy the VM associated with the Pod if its value is `yes`
-##### Destroy Pod
+##### Delete Pod
`DELETE /pod`
Destroy a Pod
@@ -52,7 +51,6 @@ Destroy a Pod
`DELETE /pod?podId=pod-xxxxxxxxxx`
-
##### List Pods
`GET /list`
@@ -62,7 +60,139 @@ List pods
`GET /list?item=pod`
+##### GET Pod info
+
+`GET /pod/info`
+
+Get Pod detail information
+
+**Example request:**
+
+`GET /pod/info?podId=pod-xxxxxxxxxx`
+
+##### Get Pod Stats
+
+`GET /pod/stats`
+
+Get Pod stats info
+
+**Example request:**
+
+`GET /pod/stats?podId=pod-xxxxxxxxxx`
+
+##### Set Pod label
+
+`POST /pod/labels`
+
+Set pod labels
+
+**Example request:**
+
+`POST /pod/labels?podId=pod-xxxxxxxxxx&labels={"ll":"vv"}&override=true`
+
+##### Send Signal to Pod
+
+`POST /pod/kill`
+
+Send kill signal to containers of a Pod
+
+**Example request:**
+
+`POST /pod/kill?podName=pod-xxxxxxxxxx&container=xxxxxxx&signal=9`
+
+##### List Port Mapping Rules
+
+`GET /pod/{pod_id}/portmappings`
+
+Get a list of current port mappings of a pod.
+
+##### Modify Port Mapping Rules
+
+`PUT /pod/{pod_id}/portmappings/{action}`
+
+Update port mapping rules
+
+- `action` could be `add` or `delete`
+
+The request body is an json **array** of `PortMapping`:
+
+```
+{
+ "containerPort": "80",
+ "hostPort": "3000",
+ "protocol": "udp"
+}
+```
+
+Where
+
+- `containerPort` and `hostPort` could be a single port or a range, such as "8000-8080"; and if the `containerPort` is a range, the `hostPort` should be a range in same size;
+- `protocol` could be `tcp` or `udp`.
+
+The request body should be an array even if there is only one rule to be added/deleted.
+
#### 2.2 Container
+##### Create container
+`POST /container/create`
+
+Create a container
+
+**Example request:**
+
+`POST /pod/create`
+
+The body is a [container spec in JSON format](./containers.md).
+
+##### Start container
+
+`POST /container/start`
+
+Start a container
+
+**Example request:**
+
+`POST /container/start?container=xxxxxxxx`
+
+##### Stop container
+
+`POST /container/stop`
+
+Stop a container
+
+**Example request:**
+
+`POST /container/stop?container=xxxxxxxx`
+
+##### Kill container
+
+`POST /container/kill`
+
+Kill a container with a signal
+
+**Example request:**
+
+`POST /container/kill?container=xxxxxxxx&signal=9`
+
+##### Delete container
+
+`POST /container/remove`
+
+Remove a container from Pod
+
+**Example request:**
+
+`POST /container/remove?container=xxxxxxxx`
+
+##### Rename container
+
+`POST /container/rename`
+
+Rename a container
+
+**Example request:**
+
+`POST /container/rename?newName=yyyyyyy&oleName=xxxxxxxx`
+
##### List containers
`GET /list`
@@ -72,6 +202,34 @@ List containers
`GET /list?item=container`
+##### Get container info
+
+`GET /container/info`
+
+Get container info
+
+**Example request:**
+
+`GET /container/info?container=xxxxxxxx`
+
+##### Get container logs
+
+`GET /container/logs`
+
+Get container logs
+
+**Example request:**
+
+`GET /container/logs?container=xxxxxxxx&stdout=true&stderr=true&follow=false×tamp=true&tail=100`
+
+##### Get container or exec exit code
+
+`GET /container/exitcode`
+
+**Example request:**
+
+`GET /container/exitcode?container=xxxxxxxx&exec=eeeeeeeee`
+
##### Create a new image from a container’s changes
`POST /container/commit`
@@ -111,43 +269,55 @@ List containers
}
```
-#### 2.3 Info
-##### System-wide info
-`GET /info`
+#### 2.3 Attach and Exec
-Display system-wide information
+##### Attach to container
+
+`POST /attach`
+
+Attach to a container, will upgrade to TCP stream.
+
+##### TTY resize
+
+`POST /tty/resize`
+
+Change the tty window size of container or exec
**Example request:**
-`GET /info`
+`POST /tty/resize?container=xxxxxxxx&exec=eeeeeeeee&h=25&w=80`
+
+##### Create exec
-#### 2.4 VM
-##### Create VM
-`POST /vm/create`
+`POST /exec/create`
-Create a VM
+Create an exec
**Example request:**
-`POST /vm/create`
+`POST /exec/create?container=xxxxxxxx&tty=true&command=/bin/bash`
+
+##### Start exec
-##### Kill VM
-`DELETE /vm`
+`POST /exec/start`
-Kill a VM
+Start an exec
**Example request:**
-`DELETE /vm?vm=vm-xxxxxxxxxx`
+`POST /exec/start?container=xxxxxxxx&exec=eeeeeeeee`
-##### List VMs
-`GET /list`
+The exec request will upgrade to TCP stream
+
+#### 2.4 Info
+##### System-wide info
+`GET /info`
-List all VMs
+Display system-wide information
**Example request:**
-`GET /list?item=vm`
+`GET /info`
#### 2.5 Images
##### List Images
diff --git a/reference/attach.md b/reference/attach.md
index 8a38e65..21a3656 100755
--- a/reference/attach.md
+++ b/reference/attach.md
@@ -1,9 +1,13 @@
# attach
-Attach a specified container in a Pod to TTY
+Attach to the input/output of a specified container
- Usage:
- hyperctl attach CONTAINER
+```
+Usage:
+ hyperctl attach CONTAINER
- Help Options:
- -h, --help Show this help message
+Attach to the input/output of a specified container
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/cli.md b/reference/cli.md
index 768ed42..a5a4f20 100755
--- a/reference/cli.md
+++ b/reference/cli.md
@@ -2,33 +2,34 @@
```
Usage:
-
- hyperctl [OPTIONS] COMMAND [ARGS...]
+ hyperctl [OPTIONS] COMMAND [ARGS...]
Command:
-
- attach Attach to the tty of a specified container in a Pod
- build Build an image from a Dockerfile
- commit Create a new image from a container's changes
- create Create a Pod into 'pending' status, but without running it
- exec Run a command in a container of a running Pod
- images List images
- info Display system-wide information
- list List all Pods or containers
- login Register or log in to a Docker registry server
- logout Log out from a Docker registry server
- pull Pull an image from a Docker registry server
- push Push an image or a repository to a Docker registry server
- replace (Linux only) replace the Pod in a running VM with a new one
- rm Remove one or more Pods
- rmi Remove one or more images
- run Create a Pod, and launch a new Pod
- start Launch a 'pending' Pod
- stop Stop a running Pod, it will become 'pending'
+ attach Attach to the input/output of a specified container
+ build Build an image from a Dockerfile
+ commit Create a new image from a container's changes
+ create Create a pod or create a container in a pod
+ exec Run a command in a specified container
+ images List images
+ info Display system-wide information
+ list List all pods or containers
+ load Load a image from STDIN or tar archive file
+ login Register or log in to a Docker registry server
+ logout Log out from a Docker registry server
+ pause Pause a running pod
+ ports List or modify port mapping rules of a Pod
+ pull Pull an image from a Docker registry server
+ push Push an image or a repository to a Docker registry server
+ rm Remove one or more pods or containers
+ rmi Remove one or more images
+ run Create a pod, and launch the new pod
+ save Save one or more images to a tar archive (streamed to STDOUT by default)
+ start Start a pod or container
+ stop Stop a running pod or container
+ unpause Unpause a paused pod
Help Options:
-
- -h, --help Show this help message
+ -h, --help Show this help message
Run 'hyperctl COMMAND --help' for more information on a command.
```
diff --git a/reference/configuration.md b/reference/configuration.md
index c568d5f..552b9a3 100755
--- a/reference/configuration.md
+++ b/reference/configuration.md
@@ -1,34 +1,71 @@
-# Configuration
+# Hyperd Configuration
## Configuration file
-The configuration file of Hyper is located under `/etc/hyper.conf`. The file is in INI format:
+The configuration file of Hyper is located under `/etc/hyper/config` by default. The file is in INI format:
- Host = tcp://localhost:1246
- Bios = /var/lib/hyper/bios.bin
- Cbfs = /var/lib/hyper/cbfs.rom
- Kernel = /var/lib/hyper/kernerl-4.4
- Initrd = /var/lib/hyper/initrd.img
- Bridge = hyper0
- BridgeIP = 192.168.123.1/24
+```
+# Root directory for hyperd
+# Root=/var/lib/hyper/
-#### Parameters
+# Specify the hypervisor: libvirt, qemu, qemu-kvm, kvm, xen, xenpv, kvmtool
+# "kvm" is equivalent to "qemu-kvm" which uses qemu with kvm acceleration.
+# "qemu" is equivalent to "qemu-kvm" when the system enables kvm, otherwise
+# the hypervisor is "qemu-tcg" (qemu without kvm acceleration).
+# When Hypervisor is not set, the hyperd will try to probe "qemu-kvm" or "xen"
+# as the containers' hypervisor according to the host, if the host doesn't
+# support any hardware-assisted technology, it will use "qemu-tcg".
+#
+# Hypervisor=qemu
-- `Host`: bind hyperd's socket to the IP and Port, by default hyperd listens on `unix:///var/run/hyper.sock`
-- `Bios`: the BIOS binary file path, by default `/var/lib/hyper/bios-qboot.bin`
-- `Cbfs`: the CBFS ROM file path, by default `/var/lib/hyper/cbfs-qboot.rom`
-- `Kernel`: the path of the HyperKernel, by default `/var/lib/hyper/kernel`
-- `Initrd`: the path of the initrd file, by default `/var/lib/hyper/hyper-initrd.img`
-- `Bridge`: bridge name, default `hyper0`
-- `BridgeIP`: IP range of the bridge, default `192.168.123.0/24`
+# Boot kernel
+Kernel=/var/lib/hyper/kernel
-## CLI usage
+# Boot initrd
+Initrd=/var/lib/hyper/hyper-initrd.img
+
+# Storage driver for hyperd, valid value includes devicemapper, overlay, rawblock, and aufs
+# StorageDriver=overlay
+
+# Bridge device for hyperd, default is hyper0
+# Bridge=
+
+# Bridge ip address for the bridge device
+# BridgeIP=
+
+# If the host IP is provided, a TCP port will be listened for, same as the '--host' option
+# Host=
+
+# This is only useful for hypernetes, to disable the iptables setup by hyperd
+# DisableIptables=false
+
+# Enable vsock support. This only works with libvirt/qemu hypervisor and template disabled
+# EnableVsock=false
+
+# VmFactoryPolicy defines the policies to create factories
+# VmFactoryPolicy = [FactoryConfig,]*FactoryConfig
+# FactoryConfig = {["cache":NUMBER,]["template":(true|false),]"cpu":NUMBER,"memory":NUMBER}
+# Examples:
+# VmFactoryPolicy={"cache":10, "cpu":1, "memory":128}
+# VmFactoryPolicy={"cpu":3, "memory":1024}
+# VmFactoryPolicy={"template":true, "cpu":1, "memory":128}
+# VmFactoryPolicy={"cache":1, "template":true, "cpu":1, "memory":128}
+# VmFactoryPolicy={"cache":10, "template":true, "cpu":1, "memory":128},{"template":true, "cpu":3, "memory":1024}
+# It is recommended to specify the "cache" when VmFactoryPolicy is set,
+# otherwise it is a less efficient factory
+VmFactoryPolicy=
+
+[Log]
+# PodLogPrefix=/var/run/hyper/Pods
+# PodIdInPath=true
+```
+
+## Hyperd command line
Usage:
./hyperd [OPTIONS]
Application Options:
- --nondaemon run as a normal program
-config="" configuration for ./hyperd
—v=0 log level for V logs
—log_dir log directory
diff --git a/reference/containers.md b/reference/containers.md
index 07871f8..642d206 100755
--- a/reference/containers.md
+++ b/reference/containers.md
@@ -1,4 +1,4 @@
-# Containers
+# Container Spec
- `name`: the identifier of a container; a random id will be given if absent
@@ -11,22 +11,24 @@
- `workdir`: the directory running the container command
-- `ports`: the exposed ports of the container
+- *[Deprecated]* `ports`: the exposed ports of the container, the ports now is move to the Pod level
- `containerPort`: the listening port inside container
- `hostPort`: the port exposed in host machine
- `protocol`: `tcp` (default) or `udp`
-- `volumes`: volumes to be mounted in the container.
+- `volumes`: volumes reference to be mounted in the container.
- `path`: the mount point
- - `volume`: the name of the volume to be mounted, defined in [volumes](./volumes.md) section
+ - `volume`: the name of the volume to be mounted, defined in [volumes](./volumes.md) section, or specified in `detail`.
- `readOnly`: if `true`, the mount point will be read only, default `false`
+ - `detail`: the [volume spec](./volumes.md). If the volume is defined in `volumes` section of the pod, the `detail` field could leave null.
-- `files`: files to be present in the container
+- `files`: files reference to be present in the container
- `path`: the file path in the container
- - `filename`: the filename defined in [files](./files.md) section
+ - `filename`: the filename defined in [files](./files.md) section, or specified in `detail`.
- `perm`: the file permission, by default `0755`
+ - `detail`: the [file spec](./files.md). If the file is defined in `files` section of the pod, the `detail` field could leave null.
-- `restartPolicy`: restart the container if exit: `never`, `onFailure`, or `always`
+- `tty`: whether the stdio of the container is a tty device
example:
@@ -42,16 +44,23 @@ example:
"volumes": [{
"path": "/var/log",
"volume": "name",
- "readOnly": false
+ "readOnly": false,
+ "detail": {
+ "name": "prod_log",
+ "source": "/var/log/myweb.img",
+ "format": "raw"
+ }
}],
"files": [{
"path": "/var/lib/xxx/xxxx",
"filename": "name",
- "perm": "0755"
+ "perm": "0755",
+ "detail": {
+ "name": "nginx.conf",
+ "encoding": "raw",
+ "uri": "https://s3.amazonaws/bucket/file.conf",
+ "content": ""
+ }
}],
- "ports":[{
- "containerPort": 80,
- "hostPort": 8000,
- }],
- "restartPolicy": "never"
+ "tty": true
}]
diff --git a/reference/create.md b/reference/create.md
index 2647926..f34885d 100755
--- a/reference/create.md
+++ b/reference/create.md
@@ -1,9 +1,31 @@
# create
-Define a Pod and allocate storage, but without starting it. The Pod will stay in `Created` state.
+Create a pod or create a container in a pod.
- Usage:
- hyperctl create POD_FILE
+```
+Usage:
+ hyperctl create [OPTIONS] [POD_ID] IMAGE [COMMAND] [ARG...]
- Help Options:
- -h, --help Show this help message
+Create a pod, or create a container in the pod specified by the POD_ID
+
+Application Options:
+ -p, --podfile="" read spec from the pod file instead of command line
+ -y, --yaml pod file in Yaml format instead of JSON
+ --name="" Assign a name to the container
+ --workdir="" Working directory inside the container
+ -t, --tty the run command in tty, such as bash shell
+ --cpu=1 CPU number for the VM (default: 1)
+ --memory=128 Memory size (MB) for the VM (default: 128)
+ --env=[] Set environment variables
+ --entrypoint="" Overwrite the default ENTRYPOINT of the image
+ --restart="" Restart policy to apply when a container exits (never, onFailure, always) (default: never)
+ --log-driver="" Logging driver for Pod
+ --log-opt= Log driver options
+ --publish=[] Publish a container's port to the host, format: --publish [tcp/udp:]hostPort:containerPort
+ --label=[] Add labels for Pod, format: --label key=value
+ -v, --volume=[] Mount host file/directory as a data file/volume, format: -v|--volume=[[hostDir:]containerDir[:options]]
+ -c, --container Create container inside a pod
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/exec.md b/reference/exec.md
index 829fe1f..9c021c6 100755
--- a/reference/exec.md
+++ b/reference/exec.md
@@ -2,11 +2,17 @@
Run a command in a container or a Pod, and attach the current terminal to the command stdio.
- Usage:
- hyperctl exec POD_ID:CONTAINER_NAME COMMAND [ARGS...]
+```
+Usage:
+ hyperctl exec [OPTIONS] POD|CONTAINER COMMAND [ARGS...]
- Help Options:
- -h, --help Show this help message
+Run a command in a container or a Pod
- Example:
- hyperctl exec pod-3uhg23po:nginx echo "Hello World"
+Application Options:
+ -d, --detach Not Attach the stdin, stdout and stderr to the process
+ -t, --tty Allocate a pseudo-TTY
+ -m, --vm Execute outside of any containers
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/kill.md b/reference/kill.md
index 80b2ba6..089ea15 100755
--- a/reference/kill.md
+++ b/reference/kill.md
@@ -1,9 +1,11 @@
# kill
-Kill an idle running VM
+Send kill signal to container or Pod
Usage:
- hyperctl kill VM_ID
+ hyperctl kill [OPTIONS] CONTAINER_ID|POD_ID...
Help Options:
- -h, --help Show this help message
+ -h, --help Show this help message
+ -p, --pod kill all containers in a pod
+ -s, --signal="" The signal to kill containers, default is 9
diff --git a/reference/list.md b/reference/list.md
index 47ae8d9..f896be5 100755
--- a/reference/list.md
+++ b/reference/list.md
@@ -1,11 +1,17 @@
# list
-Display the Pod, VM or container information
+Display the Pod or container information
- Usage:
- hyperctl list [OPTIONS] [pod|vm|container]
+```
+Usage:
+ hyperctl list [OPTIONS] [pod|container]
- Help Options:
- -h, --help Show this help message
- -p, --pod podId Only list the contents from specified Pod
- -v, --vm vmId Only list the contents from specified VM
+list all pods or container information
+
+Application Options:
+ -p, --pod="" Only list the specified pod
+ -q, --quiet Quiet mode
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/load.md b/reference/load.md
new file mode 100644
index 0000000..aab5241
--- /dev/null
+++ b/reference/load.md
@@ -0,0 +1,20 @@
+# Load
+
+> OCI Image Spec is supported since v0.8
+
+Load a image from STDIN or tar archive file.
+
+```
+Usage:
+ hyperctl load [OPTIONS]
+
+Load a image from STDIN or tar archive file
+
+Application Options:
+ -i, --input="" Read from a tar archive file, instead of STDIN
+ -n, --name="" Name to use when loading OCI image layout tar archive
+ -r, --references="" References to use when loading an OCI image layout tar archive
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/podfile.md b/reference/podfile.md
index 27b0f18..7796a0c 100755
--- a/reference/podfile.md
+++ b/reference/podfile.md
@@ -1,16 +1,14 @@
-# Podfile
+# Pod Spec
Podfile is in JSON format. A basic sample looks like the following:
{
"id": "myweb",
"hostname": "myname",
- "tty": true,
"resource": {
"vcpu": 1,
"memory": 128
},
-
"containers" : [{
"image": "nginx:latest",
"files": [{
@@ -19,14 +17,17 @@ Podfile is in JSON format. A basic sample looks like the following:
"perm": "0755"
}]
}],
-
"files": [{
"name": "filename",
"encoding": "raw",
"uri": "https://s3.amazonaws/bucket/file.conf",
"content": ""
}],
-
+ "portmappings": [{
+ "containerPort": "80",
+ "hostPort": "3000",
+ "protocol": "udp"
+ }],
"volumes": []
}
@@ -34,8 +35,10 @@ Podfile is in JSON format. A basic sample looks like the following:
- `id`: the identifier (and internal hostname) of the Pod
- `hostname`: the hostname of the Pod
-- `tty`: turn on/off (`true`/`false`) the tty connection to the Pod, default: `true`
- `resources`: specify the number of CPU cores and RAM size allocated to the HyperVM instance
-- `containers`: a group of containers to run in the Pod
-- `files`: files to be present in the containers
-- `volumes`: volumes to mount from the host to the containers
+- `containers`: a group of [containers](./containers.md) to run in the Pod. Since 0.8, we could create a Pod with empty containers list, and add containers later.
+- `portmappings`: the port mapping rules, and the portmappings could be `add`/`remove` during runtime with API or command line tools. The fields:
+ - `containerPort` and `hostPort` could be a single port or a range, such as "8000-8080"; and if the `containerPort` is a range, the `hostPort` should be a range in same size;
+ - `protocol` could be `tcp` or `udp`.
+- `files`: [files](./files.md) to be present in the containers
+- `volumes`: [volumes](./volumes.md) to mount from the host to the containers
diff --git a/reference/ports.md b/reference/ports.md
new file mode 100644
index 0000000..733aa79
--- /dev/null
+++ b/reference/ports.md
@@ -0,0 +1,17 @@
+# ports
+
+List or modify port mapping rules of a Pod
+
+```
+Usage:
+ hyperctl ports ls|add|delete [OPTIONS] POD
+
+List or modify port mapping rules of a Pod
+
+Application Options:
+
+ -p, --publish Publish a container's port to the host (only valid for add and delete)
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/replace.md b/reference/replace.md
deleted file mode 100755
index 21fa4ba..0000000
--- a/reference/replace.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# replace
-
-Deallocate the VM instance from a `Running` Pod A and re-assign to a `Created` Pod B. Pod A will return to `Created` state
-
-(This command is only avaiable on Linux version)
-
- Usage:
- hyperctl replace --oldpod POD_ID --newpod POD_ID [--file POD_FILE]
-
- Application Options:
- -o, --oldpod="" The Pod that will be replaced, must be in 'running' status
- -n, --newpod="" The Pod that will be run, must be in 'created' status
- -f, --file="" The Pod file to use to create and run the new Pod
-
- Help Options:
- -h, --help Show this help message
diff --git a/reference/rm.md b/reference/rm.md
index 4ea6875..ff13e11 100755
--- a/reference/rm.md
+++ b/reference/rm.md
@@ -1,10 +1,17 @@
# rm
-Remove a Pod permantly, cleanup its disk storage.
+Remove one or more pods or containers
+```
+Usage:
+ hyperctl rm [OPTIONS] CONTAINER|POD [CONTAINER|POD...]
- Usage:
- hyperctl rm POD_ID [POD_ID...]
+Remove one or more containers/pods
- Help Options:
- -h, --help Show this help message
+Application Options:
+ -c, --container stop container
+
+Help Options:
+ -h, --help Show this help message
+
+```
diff --git a/reference/run.md b/reference/run.md
index 0f72717..476ee51 100755
--- a/reference/run.md
+++ b/reference/run.md
@@ -1,39 +1,40 @@
# run
-Launch one or multiple Docker images as a Pod, with a new VM instance
-
- Usage:
- hyperctl run [OPTIONS] IMAGE [COMMAND] [ARG...]
-
- Create a pod, and launch a new VM to run the pod
-
- Application Options:
- -p, --podfile="" Create and Run a pod based on the pod file
- -k, --kubernetes="" Create and Run a pod based on the kubernetes pod file
- -y, --yaml Create a pod based on Yaml file
- --name="" Assign a name to the container
- -a, --attach (from podfile) Attach the stdin, stdout and stderr to the container
- -d, --detach (from cmdline) Not Attach the stdin, stdout and stderr to the container
- --workdir="" Working directory inside the container
- -t, --tty the run command in tty, such as bash shell
- --cpu=1 CPU number for the VM
- --memory=128 Memory size (MB) for the VM
- --env=[] Set environment variables
- --entrypoint="" Overwrite the default ENTRYPOINT of the image
- --restart="" Restart policy to apply when a container exits (never, onFailure, always)
- --log-driver="" Logging driver for Pod
- --log-opt= Log driver options
- --rm Automatically remove the pod when it exits
- --publish=[] Publish a container's port to the host, format: --publish [tcp/udp:]hostPort:containerPort
-
- Help Options:
- -h, --help Show this help message
-
- Example:
+Create a pod, and launch the new pod
+
+```
+Usage:
+ hyperctl run [OPTIONS] IMAGE [COMMAND] [ARG...]
+
+Create and start a pod
+
+Application Options:
+ -p, --podfile="" read spec from the pod file instead of command line
+ -y, --yaml pod file in Yaml format instead of JSON
+ --name="" Assign a name to the container
+ --workdir="" Working directory inside the container
+ -t, --tty the run command in tty, such as bash shell
+ --cpu=1 CPU number for the VM (default: 1)
+ --memory=128 Memory size (MB) for the VM (default: 128)
+ --env=[] Set environment variables
+ --entrypoint="" Overwrite the default ENTRYPOINT of the image
+ --restart="" Restart policy to apply when a container exits (never, onFailure, always) (default: never)
+ --log-driver="" Logging driver for Pod
+ --log-opt= Log driver options
+ --publish=[] Publish a container's port to the host, format: --publish [tcp/udp:]hostPort:containerPort
+ --label=[] Add labels for Pod, format: --label key=value
+ -v, --volume=[] Mount host file/directory as a data file/volume, format: -v|--volume=[[hostDir:]containerDir[:options]]
+ -a, --attach (from podfile) Attach the stdin, stdout and stderr to the container
+ -d, --detach (from cmdline) Not Attach the stdin, stdout and stderr to the container
+ --rm Automatically remove the pod when it exits
+
+Help Options:
+ -h, --help Show this help message
+
+Example:
hyperctl run -t ubuntu
hyperctl run -t ubuntu:latest
hyperctl run -t ubuntu /bin/bash
hyperctl run -d nginx
hyperctl run -p mypod.json
-
-
+```
diff --git a/reference/save.md b/reference/save.md
new file mode 100644
index 0000000..8d24bd1
--- /dev/null
+++ b/reference/save.md
@@ -0,0 +1,20 @@
+# Save
+
+> OCI Image Spec is supported since v0.8
+
+Save one or more images to a tar archive (streamed to STDOUT by default).
+
+```
+Usage:
+ hyperctl save [OPTIONS] IMAGE [IMAGE...]
+
+Save one or more images to a tar archive (streamed to STDOUT by default)
+
+Application Options:
+ -o, --output="" Write to a file, instead of STDOUT
+ -f, --format="" Specify the format of the output tar archive
+ -r, --references="" References to use when saving an OCI image layout tar archive
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/start.md b/reference/start.md
index 638a9be..d50433d 100755
--- a/reference/start.md
+++ b/reference/start.md
@@ -1,9 +1,16 @@
# start
-Launch a `Created` Pod, with a new VM instance
+Start a pod or container
- Usage:
- hyperctl start POD_ID
+```
+Usage:
+ hyperctl start [OPTIONS] POD_ID|CONTAINER_ID
- Help Options:
- -h, --help Show this help message
+Launch a created pod or container
+
+Application Options:
+ -c, --container start container
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/stop.md b/reference/stop.md
index abb08d5..c008d6c 100755
--- a/reference/stop.md
+++ b/reference/stop.md
@@ -1,9 +1,16 @@
# stop
-Stop a `Running` Pod, which will return to `Created` state
+Stop a running pod or container
- Usage:
- hyperctl stop POD_ID
+```
+Usage:
+ hyperctl stop [OPTIONS] CONTAINER_ID|POD_ID
- Help Options:
- -h, --help Show this help message
+Stop running container or pod
+
+Application Options:
+ -c, --container stop container
+
+Help Options:
+ -h, --help Show this help message
+```
diff --git a/reference/volumes.md b/reference/volumes.md
index ef76e43..a520d6b 100755
--- a/reference/volumes.md
+++ b/reference/volumes.md
@@ -23,7 +23,7 @@ Similar with Docker, Hyper allows you to mount additional volumes to a HyperVM i
"volumes": [{ # Definition
"name": "prod_log",
"source": "/var/log/myweb.img",
- "driver": "qcow2"
+ "format": "raw"
}],
}
@@ -32,7 +32,7 @@ The `volumes` section is a list of items with the following properties:
- `name`: identifier of the volume
- `source`: the volume path on the host, either directory or file. If absent, a new 10GB volume will be created
-- `driver`: the volume format
+- `format`: the volume format
- block-device-image file: `raw`, `qcow2`, this allows to mount a VM image to HyperVM. Note: the image file must have a `EXT4` fs in it.
- plain file or dir: `vfs`, this options is to mount a file/dir on the host to to HyperVM instance
- empty: leave empty
diff --git a/release_notes/latest.md b/release_notes/latest.md
index ce18977..df87f83 100755
--- a/release_notes/latest.md
+++ b/release_notes/latest.md
@@ -1,26 +1,18 @@
-# Version 0.5 (2016-02-05)
+# Version 1.0 (2017-09-28)
-In version 0.5, Hyper and runV introduced many features, improved stability, and fixed many bugs.
+In release v1.0.0 of HyperContainer, we introduced several significant updates and fixed many bugs to make runV production ready. The featured updates include:
-## Highlight features
+- runV Compatibility:
+ - compatible with the most recent [1.0 of OCI runtime specification](https://github.com/opencontainers/runtime-spec/releases/tag/v1.0.0);
+ - compatible with the [latest CNCF containerd](https://github.com/containerd/containerd);
+ - compatible with the latest Docker (17.06.1-ee and later).
+- New hypervisor architectures support:
+ - *xenpv* driver, with the latest Xen 4.9, we could launch runV with very minimal performance penalty (<5 % in most scenarios) on instance of Google GCE and other IaaS platform;
+ - *kvmtool* driver brings the offical ARM support to runV.
+- Feature update:
+ - Pod level portmappings: allow configure port mappings in pod level, and dynamic update port mapping rules;
+ - Read-only rootfs: allows runV to launch with read-only rootfs;
+ - support vhostuser network card for *qemu* driver, which enables the low latency network for scenarios such as NFV.
+- Many other feature or test improvements, and many bug fix.
-- Optimized the `run` command, for example, now you can use `-t` flag for tty. more flags definition could reference the [run command](../reference/run.md).
-- Support `libvirt` as an hypervisor driver, and with libvirt, you can find Hyper VMs with `virsh`
-- Support service-discovery aux container in Pod and other related features for the integration with Kubernetes.
-- Support Cinder/ceph volume and configured Neutron Networks for the integration with OpenStack.
-- Allow configure storage driver through config file.
-
-## Other improvements
-
-- Allow attach to containers from the very beginning.
-- Improve file insert, now you can insert files from either remote or local machine by specify the URI.
-- Hyper client now return the exit value of the process when `run` or `exec` exit.
-- Configure default `/etc/hosts` and `/etc/resolv.conf` for the user if no hosts or DNS configured.
-- Improve `list` command, now you can list contents with vm or pod as filter.
-- Support `logs` command for container logs.
-- Support registry mirror and insecure registry options.
-- Build RPM packages for CentOS and Fedora with Hyper.
-- Add integration tests.
-- Many stability improvements and bug fixes.
-
-More details on our website: [(http://hypercontainer.io)](http://hypercontainer.io/).
+Thanks the contribution from Huawei, ZJU, ARM, Intel, Alibaba, and other individuals.
diff --git a/release_notes/v0.6.md b/release_notes/v0.6.md
new file mode 100644
index 0000000..cfbf389
--- /dev/null
+++ b/release_notes/v0.6.md
@@ -0,0 +1,15 @@
+# Version 0.6 (2016-05-35)
+
+Since the 0.6 release, HyperContainer repository changes to `hyperd` and the command line tools renamed as `hyperctl`.
+
+In version 0.6, HyperContainer and RunV focused on improving the stability and performance, and fixed many bugs found in the development and operating of [Hyper_ Cloud](https://www.hyper.sh). In the meanwhile, many features were introduced for better user experiences and Docker compatibility.
+
+## Highlight features
+
+- Update the image metadata storage for the compatibility to Docker 1.10+.
+- Support `hyperctl load` command.
+- Support the `user` field in container configuration.
+- Reimplemented the STDIO of containers and improved the `tty` option for running containers.
+- Update Linux kernel to 4.4 and provides some useful kernel modules, such as NetFilter, and users can also add their own kernel modules.
+
+Detail changes are listed in github: [HyperContainer Milestone v0.6.0](https://github.com/hyperhq/hyperd/issues?utf8=%E2%9C%93&q=milestone%3Av0.6.0) and [RunV Milestone v0.6.0](https://github.com/hyperhq/runv/issues?utf8=%E2%9C%93&q=milestone%3Av0.6.0).
diff --git a/release_notes/v0.7.md b/release_notes/v0.7.md
new file mode 100644
index 0000000..b974883
--- /dev/null
+++ b/release_notes/v0.7.md
@@ -0,0 +1,23 @@
+# Version 0.7 (2016-10-28)
+
+In version 0.7, HyperContainer and RunV supports several new architectures, introduced some new features, and kept improving the stability. Here are some highlight features of the release.
+
+## hyperd
+
+- More arch supports: s390x, ppc64le, and arm64.
+- **VM Template**: faster boot performance (130ms) and less memory consumption (save 80MB per pod/VM).
+- Improve gRPC APIs.
+- Improve streaming IO (attach & exec) for containers.
+- Many other fixes and improvements.
+
+## runV
+
+- Support system arch s390x and ppc64le.
+- Support system arch ARM64.
+- Enable VM template for runV and runV-containerd, which improves the boot performance to 130ms and reduces 80MB memory consumption per container.
+- Enable CNI, OVS and improve the networking configurations.
+- Add QoS Control for network interface.
+- Allow one volume to be mounted to multiple mount points of one container.
+- Improve streaming IO for containers.
+- Move dependencies from Godep to vendors.
+- Many other fixes and improvements.
diff --git a/release_notes/v0.8.md b/release_notes/v0.8.md
new file mode 100644
index 0000000..0849c7d
--- /dev/null
+++ b/release_notes/v0.8.md
@@ -0,0 +1,27 @@
+# Version 0.8.1 (2017-05-10)
+
+Bug fix:
+
+- Enable vSock, a communication channel between host and guest.
+- Kubernetes CRI compatibility issues.
+- Container IO stream issues.
+- Fixed the Xen build.
+
+The detail of the issues addressed in 0.8.1 could be found [here][milestone-0.8.1]
+
+# Version 0.8 (2017-03-20)
+
+In this release, several significant updates are introduced, such as **Kubernetes Container Runtime Interface (CRI)** support, **OCI images spec** support:
+
+- Feature: Kubernetes CRI support.
+- Feature: OCI Image Spec support (`hyperctl save -o nginx.tar -f oci `).
+- Interfaces: better GRPC API support.
+- Arch: support ARM64 CPUs with GIC version3, e.g. Cavium ThunderX 64-core CPU.
+- Enhancement: move all the Pod level logic to hyperd, and runV only maintains the sandbox and containers.
+- Enhancement: simplify the model and state machine -- one Pod is one VM.
+- Enhancement: allow add/remove containers to/from a Pod/sandbox.
+- Enhancement: do not stop sandbox without an explicit stop command even if the last container is stopped (To be compatible to Kubernetes CRI).
+
+And many other improvements and updates.
+
+[milestone-0.8.1]:https://github.com/hyperhq/hyperd/milestone/4?closed=1
diff --git a/release_notes/v1.0.md b/release_notes/v1.0.md
new file mode 100644
index 0000000..df87f83
--- /dev/null
+++ b/release_notes/v1.0.md
@@ -0,0 +1,18 @@
+# Version 1.0 (2017-09-28)
+
+In release v1.0.0 of HyperContainer, we introduced several significant updates and fixed many bugs to make runV production ready. The featured updates include:
+
+- runV Compatibility:
+ - compatible with the most recent [1.0 of OCI runtime specification](https://github.com/opencontainers/runtime-spec/releases/tag/v1.0.0);
+ - compatible with the [latest CNCF containerd](https://github.com/containerd/containerd);
+ - compatible with the latest Docker (17.06.1-ee and later).
+- New hypervisor architectures support:
+ - *xenpv* driver, with the latest Xen 4.9, we could launch runV with very minimal performance penalty (<5 % in most scenarios) on instance of Google GCE and other IaaS platform;
+ - *kvmtool* driver brings the offical ARM support to runV.
+- Feature update:
+ - Pod level portmappings: allow configure port mappings in pod level, and dynamic update port mapping rules;
+ - Read-only rootfs: allows runV to launch with read-only rootfs;
+ - support vhostuser network card for *qemu* driver, which enables the low latency network for scenarios such as NFV.
+- Many other feature or test improvements, and many bug fix.
+
+Thanks the contribution from Huawei, ZJU, ARM, Intel, Alibaba, and other individuals.
diff --git a/trouble_shooting/README.md b/trouble_shooting/README.md
index 944aade..9453512 100755
--- a/trouble_shooting/README.md
+++ b/trouble_shooting/README.md
@@ -2,4 +2,4 @@
Hyperd can be run with `-v` option, which will generate more logs for debugging:
- hyperd --nondaemon -v=1
+ hyperd -v=3
diff --git a/trouble_shooting/darwin.md b/trouble_shooting/darwin.md
index 9bf28c7..16987fa 100755
--- a/trouble_shooting/darwin.md
+++ b/trouble_shooting/darwin.md
@@ -23,7 +23,6 @@ For Mac users, the log is located under `/var/log/hyper/`. If you meet any unkno
/opt/hyper/bin/hyperd
--config=/opt/hyper/etc/hyper/config
-v=1
- --nondaemon
EnvironmentVariables