corectl

module
v0.7.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2016 License: Apache-2.0

README

CoreOS over macOS made simple

read this first

  • You must be running macOS Yosemite, 10.10.3, or later on a 2010, or later, Macintosh (i.e. one with a CPU that supports EPT) for everything to work.
  • if you are still using any version of VirtualBox older than 4.3.30 then corectl will crash your system either if VirtualBox is running, or had been run previously after the last reboot (see xhyve's issues #5 and #9 for the full context). So, if for some reason, you are unable to update VirtualBox to the latest, either of the 4.x or 5.x streams, and were using it in your current session please make sure to restart your Mac before attempting to run corectl.

step by step instructions

install corectl

installing a release build (prefered for end users)
via homebrew's
❯❯❯ brew install corectl
downloading from GitHub

just go to our releases page and download the tarball with the binaries to your system, and then unpack its' contents placing them somewhere in some directory in your ${PATH} (/usr/local/bin/ is usually a good choice)

build it locally (for power users)
❯❯❯ mkdir -p ${GOPATH}/src/github.com/TheNewNormal/
❯❯❯ cd ${GOPATH}/src/github.com/TheNewNormal/
❯❯❯ git clone git@github.com:TheNewNormal/corectl.git
❯❯❯ cd corectl
❯❯❯ make

the built binaries will then appear inside ${GOPATH}/src/github.com/TheNewNormal/corectl/bin

start the corectl server daemon (corectld)

this is a required step starting with corectl's 0.7.0 release

❯❯❯ /usr/local/bin/corectld

kickstart a CoreOS VM

the following command will fetch the latest CoreOS Alpha image available, if not already available locally, verify its integrity, and then boot it.

❯❯❯ corectl run

In your terminal you will shortly after something along...

❯❯❯  corectl run                                                                                                                                                                                                     ⏎ v0.7.x ✭ ✚ ✱
---> 'B4AF19D1-DDEE-4A16-8058-1A7C3579F203' started successfuly with address 192.168.64.210 and PID 76202
---> 'B4AF19D1-DDEE-4A16-8058-1A7C3579F203' boot logs can be found at '/Users/am/.coreos/running/B4AF19D1-DDEE-4A16-8058-1A7C3579F203/log'
---> 'B4AF19D1-DDEE-4A16-8058-1A7C3579F203' console can be found at '/Users/am/.coreos/running/B4AF19D1-DDEE-4A16-8058-1A7C3579F203/tty'

Accessing the newly craeted CoreOS instance is just a few more clicks away...

❯❯❯  corectl ssh B4AF19D1-DDEE-4A16-8058-1A7C3579F203

usage (straight from the online help)

corectld
CoreOS over macOS made simple. <http://github.com/TheNewNormal/corectl>
Copyright (c) 2015-2016, António Meireles

Usage:
    corectld [flags]
    corectld [command]

Available Commands:
    start       Starts corectld
    status      Shows corectld status
    stop        Stops corectld
    version     Shows version information

Flags:
  -d, --debug   adds additional verbosity, and options, directed at debugging purposes and power users

Use "corectld [command] --help" for more information about a command.

All flags can also be set via upper-case environment variables prefixed with "COREOS_"
For example, "--debug" => "COREOS_DEBUG"
corectl
CoreOS over macOS made simple. <http://github.com/TheNewNormal/corectl>
Copyright (c) 2015-2016, António Meireles

Usage:
    corectl [flags]
    corectl [command]

Available Commands:
    kill        Halts one or more running CoreOS instances
    load        Loads CoreOS instances defined in an instrumentation file.
    ls          Lists the CoreOS images available locally
    ps          Lists running CoreOS instances
    pull        Pulls a CoreOS image from upstream
    put         copy file to inside VM
    query       Display information about the running CoreOS instances
    rm          Remove(s) CoreOS image(s) from the local filesystem
    run         Boots a new CoreOS instance
    ssh         Attach to or run commands inside a running CoreOS instance
    version     Shows version information

Flags:
  -d, --debug   adds additional verbosity, and options, directed at debugging purposes and power users

Use "corectl [command] --help" for more information about a command.

All flags can also be set via upper-case environment variables prefixed with "COREOS_"
For example, "--debug" => "COREOS_DEBUG"

here you can find the full auto-generated documentation.

simple usage recipe: a docker and rkt playground

create a volume to store your persistent data
❯❯❯ dd if=/dev/zero of=var_lib_docker.img  bs=1G count=16

will become /var/lib/{docker|rkt}. in this example case we created a volume with 16GB.

format it
❯❯❯ /usr/local/Cellar/e2fsprogs/1.42.12/sbin/mke2fs -b 1024 -i 1024 -t ext4 -m0 -F var_lib_docker.img

requires homebrew's e2fsprogs package installed.

❯❯❯ brew install e2fsprogs

label it
❯❯❯ /usr/local/Cellar/e2fsprogs/1.42.12/sbin/e2label var_lib_docker.img rkthdd

here, we labeled our volume rkthdd which is the signature that our recipe expects.

by relying in labels for volume identification we get around the issues we'd have otherwise if we were depending on the actual volume name (/dev/vd...) as those would have to be hardcoded (an issue, if one is mix and matching multiple recipes all dealing with different volumes...)

start your docker and rkt playground.
❯❯❯ UUID=deadbeef-dead-dead-dead-deaddeafbeef \
  corectl run --volume absolute_or_relative_path/to/persistent.img \
  --cloud_config cloud-init/docker-only-with-persistent-storage.txt \
  --cpus 2 --memory 2048 --name containerland

this will start a VM named containerland with the volume we created previously attached, 2 virtual cores and 2GB of RAM. The provided cloud-config will format the given volume (if it wasn't yet) and bind mount both ``/var/lib/rktand/var/lib/docker` on top of it. docker will also become available through socket activation.

above we passed arguments to the VM both via environment variables and command flags. both ways are fully supported, just use whatever suits your needs better.

now...
❯❯❯ corectl ps
Server:
  Version:	0.7.0
  Go Version:	go1.6.2
  Built:		Mon Jul 04 10:05:51 WEST 2016
  OS/Arch:	darwin/amd64

  Pid:		76155
  Uptime:	37 minutes ago

Activity:
Active VMs:	1
Total Memory:	2048
Total vCores:	2

UUID:		A163767A-78DC-41F9-AA66-E57B6C6CAB1A
  Name:		containerland
  Version:	1097.0.0
  Channel:	alpha
  vCPUs:	3
  Memory (MB):	2048
  Pid:		76807
  Uptime:	25 minutes ago
  Sees World:	true
  cloud-config:	/Users/am/code/corectl/src/github.com/TheNewNormal/corectl/examples/cloud-init/docker-only-with-persistent-storage.txt
  Network:
    eth0:	192.168.64.2
  Volumes:
  /dev/vda	/Users/am/code/corectl/persistentData/var_lib_docker.img
❯❯❯ docker -H 192.168.64.220:2375 images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
centos              latest              05188b417f30        2 days ago          196.8 MB
busybox             latest              2b8fd9751c4c        10 days ago         1.093 MB
fedora              latest              f9873d530588        13 days ago         204.4 MB

or ...

  ❯❯❯ corectl ssh containerland
  CoreOS stable (1097.0.0)
  Last login: Mon Jul  4 09:17:26 2016 from 192.168.64.1
  Update Strategy: No Reboots

or ...

❯❯❯ corectl ssh containerland "sudo rkt list"
UUID	APP	IMAGE NAME	STATE	CREATED	STARTED	NETWORKS
have fun!

projects using corectl

acknowledgements

contributing

corectl is an open source project release under the Apache License, Version 2.0, ence contributions and sugestions are gladly welcomed!

Directories

Path Synopsis
Godeps
_workspace/src/github.com/alecthomas/units
Package units provides helpful unit multipliers and functions for Go.
Package units provides helpful unit multipliers and functions for Go.
_workspace/src/github.com/braintree/manners
Package manners provides a wrapper for a standard net/http server that ensures all active HTTP client have completed their current request before the server shuts down.
Package manners provides a wrapper for a standard net/http server that ensures all active HTTP client have completed their current request before the server shuts down.
_workspace/src/github.com/bugsnag/osext
Extensions to the standard "os" package.
Extensions to the standard "os" package.
_workspace/src/github.com/coreos/go-semver/semver
Semantic Versions http://semver.org
Semantic Versions http://semver.org
_workspace/src/github.com/deis/pkg/prettyprint
Package prettyprint contains tools for formatting text.
Package prettyprint contains tools for formatting text.
_workspace/src/github.com/deoxxa/gocpio
Package cpio implements access to cpio archives.
Package cpio implements access to cpio archives.
_workspace/src/github.com/dustin/go-humanize
Package humanize converts boring ugly numbers to human-friendly strings and back.
Package humanize converts boring ugly numbers to human-friendly strings and back.
_workspace/src/github.com/everdev/mack
Mack is a Golang wrapper for AppleScript.
Mack is a Golang wrapper for AppleScript.
_workspace/src/github.com/fsnotify/fsnotify
Package fsnotify provides a platform-independent interface for file system notifications.
Package fsnotify provides a platform-independent interface for file system notifications.
_workspace/src/github.com/go-yaml/yaml
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
_workspace/src/github.com/google/go-github/github
Package github provides a client for using the GitHub API.
Package github provides a client for using the GitHub API.
_workspace/src/github.com/google/go-querystring/query
Package query implements encoding of structs into URL query parameters.
Package query implements encoding of structs into URL query parameters.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package mux implements a request router and dispatcher.
Package mux implements a request router and dispatcher.
_workspace/src/github.com/gorilla/rpc
Package gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests.
Package gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests.
_workspace/src/github.com/gorilla/rpc/json
Package gorilla/rpc/json provides a codec for JSON-RPC over HTTP services.
Package gorilla/rpc/json provides a codec for JSON-RPC over HTTP services.
_workspace/src/github.com/gorilla/rpc/protorpc
Package gorilla/rpc/protorpc provides a codec for ProtoRPC over HTTP services.
Package gorilla/rpc/protorpc provides a codec for ProtoRPC over HTTP services.
_workspace/src/github.com/gorilla/rpc/v2
Package gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests.
Package gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests.
_workspace/src/github.com/gorilla/rpc/v2/json
Package gorilla/rpc/json provides a codec for JSON-RPC over HTTP services.
Package gorilla/rpc/json provides a codec for JSON-RPC over HTTP services.
_workspace/src/github.com/gorilla/rpc/v2/protorpc
Package gorilla/rpc/protorpc provides a codec for ProtoRPC over HTTP services.
Package gorilla/rpc/protorpc provides a codec for ProtoRPC over HTTP services.
_workspace/src/github.com/hashicorp/hcl
Package hcl decodes HCL into usable Go structures.
Package hcl decodes HCL into usable Go structures.
_workspace/src/github.com/hashicorp/hcl/hcl/ast
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/hashicorp/hcl/hcl/parser
Package parser implements a parser for HCL (HashiCorp Configuration Language)
Package parser implements a parser for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/hashicorp/hcl/hcl/printer
Package printer implements printing of AST nodes to HCL format.
Package printer implements printing of AST nodes to HCL format.
_workspace/src/github.com/hashicorp/hcl/hcl/scanner
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
_workspace/src/github.com/hashicorp/hcl/hcl/token
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/keybase/go-ps
Package ps provides an API for finding and listing processes in a platform-agnostic way.
Package ps provides an API for finding and listing processes in a platform-agnostic way.
_workspace/src/github.com/kr/fs
Package fs provides filesystem-related functions.
Package fs provides filesystem-related functions.
_workspace/src/github.com/magiconair/properties
Package properties provides functions for reading and writing ISO-8859-1 and UTF-8 encoded .properties files and has support for recursive property expansion.
Package properties provides functions for reading and writing ISO-8859-1 and UTF-8 encoded .properties files and has support for recursive property expansion.
_workspace/src/github.com/mitchellh/mapstructure
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
_workspace/src/github.com/pkg/errors
Package errors provides simple error handling primitives.
Package errors provides simple error handling primitives.
_workspace/src/github.com/pkg/sftp
Package sftp implements the SSH File Transfer Protocol as described in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt
Package sftp implements the SSH File Transfer Protocol as described in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt
_workspace/src/github.com/pkg/sftp/examples/buffered-read-benchmark
buffered-read-benchmark benchmarks the peformance of reading from /dev/zero on the server to a []byte on the client via io.Copy.
buffered-read-benchmark benchmarks the peformance of reading from /dev/zero on the server to a []byte on the client via io.Copy.
_workspace/src/github.com/pkg/sftp/examples/buffered-write-benchmark
buffered-write-benchmark benchmarks the peformance of writing a single large []byte on the client to /dev/null on the server via io.Copy.
buffered-write-benchmark benchmarks the peformance of writing a single large []byte on the client to /dev/null on the server via io.Copy.
_workspace/src/github.com/pkg/sftp/examples/sftp-server
An example SFTP server implementation using the golang SSH package.
An example SFTP server implementation using the golang SSH package.
_workspace/src/github.com/pkg/sftp/examples/streaming-read-benchmark
streaming-read-benchmark benchmarks the peformance of reading from /dev/zero on the server to /dev/null on the client via io.Copy.
streaming-read-benchmark benchmarks the peformance of reading from /dev/zero on the server to /dev/null on the client via io.Copy.
_workspace/src/github.com/pkg/sftp/examples/streaming-write-benchmark
streaming-write-benchmark benchmarks the peformance of writing from /dev/zero on the client to /dev/null on the server via io.Copy.
streaming-write-benchmark benchmarks the peformance of writing from /dev/zero on the client to /dev/null on the server via io.Copy.
_workspace/src/github.com/russross/blackfriday
Blackfriday markdown processor.
Blackfriday markdown processor.
_workspace/src/github.com/satori/go.uuid
Package uuid provides implementation of Universally Unique Identifier (UUID).
Package uuid provides implementation of Universally Unique Identifier (UUID).
_workspace/src/github.com/shurcooL/httpfs/vfsutil
Package vfsutil implements some I/O utility functions for http.FileSystem.
Package vfsutil implements some I/O utility functions for http.FileSystem.
_workspace/src/github.com/shurcooL/sanitized_anchor_name
Package sanitized_anchor_name provides a func to create sanitized anchor names.
Package sanitized_anchor_name provides a func to create sanitized anchor names.
_workspace/src/github.com/shurcooL/vfsgen
Package vfsgen takes an http.FileSystem (likely at `go generate` time) and generates Go code that statically implements the provided http.FileSystem.
Package vfsgen takes an http.FileSystem (likely at `go generate` time) and generates Go code that statically implements the provided http.FileSystem.
_workspace/src/github.com/shurcooL/vfsgen/cmd/vfsgendev
vfsgendev is a convenience tool for using vfsgen in a common development configuration.
vfsgendev is a convenience tool for using vfsgen in a common development configuration.
_workspace/src/github.com/shurcooL/vfsgen/test
Package test contains tests for virtual filesystem implementation generated by vfsgen.
Package test contains tests for virtual filesystem implementation generated by vfsgen.
_workspace/src/github.com/spf13/cobra
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
_workspace/src/github.com/spf13/pflag
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
_workspace/src/github.com/spf13/viper/remote
Package remote integrates the remote features of Viper.
Package remote integrates the remote features of Viper.
_workspace/src/github.com/vincent-petithory/dataurl
Package dataurl parses Data URL Schemes according to RFC 2397 (http://tools.ietf.org/html/rfc2397).
Package dataurl parses Data URL Schemes according to RFC 2397 (http://tools.ietf.org/html/rfc2397).
_workspace/src/golang.org/x/crypto/cast5
Package cast5 implements CAST5, as defined in RFC 2144.
Package cast5 implements CAST5, as defined in RFC 2144.
_workspace/src/golang.org/x/crypto/curve25519
Package curve25519 provides an implementation of scalar multiplication on the elliptic curve known as curve25519.
Package curve25519 provides an implementation of scalar multiplication on the elliptic curve known as curve25519.
_workspace/src/golang.org/x/crypto/ed25519
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
_workspace/src/golang.org/x/crypto/openpgp
Package openpgp implements high level operations on OpenPGP messages.
Package openpgp implements high level operations on OpenPGP messages.
_workspace/src/golang.org/x/crypto/openpgp/armor
Package armor implements OpenPGP ASCII Armor, see RFC 4880.
Package armor implements OpenPGP ASCII Armor, see RFC 4880.
_workspace/src/golang.org/x/crypto/openpgp/clearsign
Package clearsign generates and processes OpenPGP, clear-signed data.
Package clearsign generates and processes OpenPGP, clear-signed data.
_workspace/src/golang.org/x/crypto/openpgp/elgamal
Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v.
Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v.
_workspace/src/golang.org/x/crypto/openpgp/errors
Package errors contains common error types for the OpenPGP packages.
Package errors contains common error types for the OpenPGP packages.
_workspace/src/golang.org/x/crypto/openpgp/packet
Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880.
Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880.
_workspace/src/golang.org/x/crypto/openpgp/s2k
Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.
Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.
_workspace/src/golang.org/x/crypto/ssh
Package ssh implements an SSH client and server.
Package ssh implements an SSH client and server.
_workspace/src/golang.org/x/crypto/ssh/agent
Package agent implements the ssh-agent protocol, and provides both a client and a server.
Package agent implements the ssh-agent protocol, and provides both a client and a server.
_workspace/src/golang.org/x/crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
_workspace/src/golang.org/x/crypto/ssh/test
This package contains integration tests for the golang.org/x/crypto/ssh package.
This package contains integration tests for the golang.org/x/crypto/ssh package.
_workspace/src/golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.
_workspace/src/golang.org/x/tools/godoc/vfs
Package vfs defines types for abstract file system access and provides an implementation accessing the file system of the underlying OS.
Package vfs defines types for abstract file system access and provides an implementation accessing the file system of the underlying OS.
_workspace/src/golang.org/x/tools/godoc/vfs/gatefs
Package gatefs provides an implementation of the FileSystem interface that wraps another FileSystem and limits its concurrency.
Package gatefs provides an implementation of the FileSystem interface that wraps another FileSystem and limits its concurrency.
_workspace/src/golang.org/x/tools/godoc/vfs/httpfs
Package httpfs implements http.FileSystem using a godoc vfs.FileSystem.
Package httpfs implements http.FileSystem using a godoc vfs.FileSystem.
_workspace/src/golang.org/x/tools/godoc/vfs/mapfs
Package mapfs file provides an implementation of the FileSystem interface based on the contents of a map[string]string.
Package mapfs file provides an implementation of the FileSystem interface based on the contents of a map[string]string.
_workspace/src/golang.org/x/tools/godoc/vfs/zipfs
Package zipfs file provides an implementation of the FileSystem interface based on the contents of a .zip file.
Package zipfs file provides an implementation of the FileSystem interface based on the contents of a .zip file.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
cmd
components
host/darwin/misc/uuid2ip
Package uuid2ip is a simple interface to interact with xhyve's networking
Package uuid2ip is a simple interface to interact with xhyve's networking

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL