Merge pull request #31 from jcvenegas/ccloudvm-templates

wip: ccloudvm: Add templates for kata containers.
This commit is contained in:
James O. D. Hunt 2018-05-24 16:15:47 +01:00 committed by GitHub
commit 82b65945c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 0 deletions

26
ccloudvm/README.md Normal file
View File

@ -0,0 +1,26 @@
# Test Kata using ccloudvm
* [How to use Kata workloads for `ccloudvm`](#how-to-use-kata-workloads-for-ccloudvm)
* [Create Docker\* and Kata Containers virtualized enviroment](#create-docker-and-kata-containers-virtualized-enviroment)
---
The [ccloudvm](https://github.com/intel/ccloudvm/) tool is a command
to create development and demo environments. The tool sets up these development
environments inside a virtual machine.
## How to use Kata workloads for `ccloudvm`
- Follow the `ccloudvm` [install instructions](https://github.com/intel/ccloudvm/#introduction)
### Create Docker\* and Kata Containers virtualized enviroment
Create a virtual machine with Docker and Kata containers.
```bash
$ ccloudvm create --name YOUR_VM_NAME $PWD/kata-docker-xenial.yaml
$ ccloudvm connect YOUR_VM_NAME
```
You are ready to use Kata with docker in a virtualized enviroment.
See `ccloudvm` [documentation](https://github.com/intel/ccloudvm/#configurable-cloud-vm-ccloudvm) for advanced usage.

View File

@ -0,0 +1,39 @@
---
inherits: docker-xenial
vm:
mem_mib: 8000
cpus: 8
# Share GOPATH with VM
{{with .GoPath}}
mounts:
- tag: hostgo
security_model: passthrough
path: {{.}}
{{end}}
...
---
#Export GOPATH
{{ define "GOPATH" }}{{with .GoPath}}{{$.MountPath "hostgo"}}{{else}}/home/{{.User}}/go{{end}}{{end}}
{{- define "ENV" -}}
{{proxyVars .}}
{{- print " DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true " -}}
{{end}}
#cloud-config
write_files:
# Add kata as default runtime
- content: |
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -D --add-runtime kata-runtime=/usr/bin/kata-runtime
path: /etc/systemd/system/docker.service.d/kata-containers.conf
runcmd:
- {{beginTask . "Install kata"}}
- sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/release/xUbuntu_$(lsb_release -rs)/ /' >> /etc/apt/sources.list.d/kata-containers.list"
- {{proxyVars .}} curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/release/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add -
- sudo -E apt-get update
- sudo -E apt-get -y install kata-runtime
- {{endTaskCheck .}}
...