Skip to content

Instantly share code, notes, and snippets.

@jcvenegas
jcvenegas / install cc-agent in last clear-containers agent
Last active July 19, 2017 16:39
Install cc-agent in clear-containers image
#!/bin/bash
set -x
set -e
version=16020
MOUNT_DIR="$(pwd)/mount_dir"
AGENT_REPO="github.com/clearcontainers/agent"
go get -d github.com/clearcontainers/agent
@jcvenegas
jcvenegas / cc-install.sh
Created October 11, 2017 15:19
Install latest Clear Containers
#!/bin/bash
set -e
export GOPATH=$(mktemp -p "${PWD}" -d gopath-tmp"$(date +%y%m%d-%H%M)"-XXXX)
SHIM=github.com/clearcontainers/shim
PROXY=github.com/clearcontainers/proxy
RUNTIME=github.com/clearcontainers/runtime
AGENT=github.com/clearcontainers/agent
@jcvenegas
jcvenegas / cc-debug.sh
Last active November 1, 2017 16:56
get cc-agent logs from cc-proxy logs
#filter agent logs from cc-proxy logs
| grep "source=qemu" | grep -oP "msg=\".*\"" | sed -e 's,\\\\\\,,g'
# get shim logs
journalctl -q -o cat -a -t cc-shim
@jcvenegas
jcvenegas / setup.md
Last active January 3, 2018 06:55
Configure Clear Containers with cri-containerd

Clear Containres 3.0 and Containerd

Clear Containers is compatible to work with containerd 1.0 and docker 17.10 ( that uses containerd 1.0 )

Install

Install docker 17.10

Docker 17.10+ can be intalled from docker testing repository to do that follow the next instructions:

curl -s https://yum.dockerproject.org/gpg | sudo apt-key add
@jcvenegas
jcvenegas / get_version.sh
Created March 5, 2018 20:29
Get agent version from Clear Contaienrs
#!/bin/bash
set -e
img=""
loop=""
cleanup() {
if [ -n "$img" ];then
sudo umount /mnt || true
fi
@jcvenegas
jcvenegas / How-to-use-cri-containerd.md
Last active May 15, 2018 20:55
How to use Kata Containers and Containerd "cri" plugin

How to use Kata Containers and "cri" (contaienrd plugin)

Requiriments

  • Kuberentes, kubelet 1.10+
  • cri-containerd 1.1.0+
  • Kata Containers 0.2.0+

Run all this

#sed -n '/^```/,/^```/ p'  | sed '/^```/ d' > script.sh
@jcvenegas
jcvenegas / build.sh
Last active May 31, 2018 21:23
build static qemu for kata
#git status
#On branch stable-2.11
#Your branch is up-to-date with 'origin/stable-2.11'.
#nothing to commit, working directory clean
./configure --disable-bluez --disable-brlapi --disable-docs --disable-curses --disable-gtk --disable-opengl --disable-sdl --disable-spice --disable-vte --disable-vnc --disable-vnc-jpeg --disable-vnc-png --disable-vnc-sasl --disable-fdt --disable-glusterfs --disable-libiscsi --disable-libnfs --disable-bzip2 --disable-lzo --disable-snappy --disable-seccomp --disable-tpm --disable-slirp --disable-libusb --disable-usb-redir --disable-tcg --disable-uuid --disable-debug-tcg --disable-qom-cast-debug --disable-tcg-interpreter --disable-tcmalloc --disable-curl --disable-rdma --disable-tools --disable-xen --disable-linux-aio --enable-kvm --enable-vhost-net --enable-virtfs --enable-attr --enable-cap-ng --target-list=x86_64-softmmu --extra-cflags=" -O3 -fno-semantic-interposition -falign-functions=32 -D_FORTIFY_SOURCE=2 -fPIE" --extra-ldflags=" -z noexecstack -z relro -z now" --static --
@jcvenegas
jcvenegas / memory_online.sh
Last active June 5, 2018 14:32
Qemu memoy hotplug
for i in `grep -l offline /sys/devices/system/memory/memory*/state`
do
echo online > $i
done
@jcvenegas
jcvenegas / Dockerfile
Created June 5, 2018 15:59
Build static qemu for kata
from ubuntu:xenial
WORKDIR /root/qemu
RUN apt-get update
RUN apt-get install -y python pkg-config zlib1g-dev libglib2.0-dev git libcap-ng-dev libpixman-1-dev cpio libelf-dev rsync libdw-dev pkg-config flex bison libaudit-dev bc python-dev gawk autoconf automake libtool libltdl-dev libglib2.0-dev libglib2.0-0 libcap-dev
RUN cd .. && git clone https://github.com/qemu/qemu.git
RUN git checkout stable-2.11
RUN git clone https://github.com/qemu/capstone.git capstone
RUN git checkout stable-2.11 && git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb
RUN ./configure --disable-bluez --disable-brlapi --disable-docs --disable-curses --disable-gtk --disable-opengl --disable-sdl --disable-spice --disable-vte --disable-vnc --disable-vnc-jpeg --disable-vnc-png --disable-vnc-sasl --disable-fdt --disable-glusterfs --disable-libiscsi --disable-libnfs --disable-bzip2 --disable-lzo --disable-snappy --disable-seccomp --disable-tpm --disable-slirp --disable-libusb --disable-usb-redir --disable-tcg --disable-u
@jcvenegas
jcvenegas / Release.md
Last active March 27, 2019 18:14
Kata Containers Release