Skip to content

OAODEV/herd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

herd

Herd Enables Rapid Deployment. A devops management tool.

install

pip install git+https://github.com/OAODEV/herd.git

Using herd requires that a config file be placed at ~/.herdconfig ... the format of the file is as follows.

[Build]
host=[DOCKER REGISTRY]
base_path=[PATH FOR BUILDS ON SERVER]
​
[Security]
gnupg_home=[LOCAL PATH GNUPG]
remote_secret_store=[GPG KEY HOST]
my_fingerprint=[REDACTED]
deploy_fingerprints=[REDACTED], [REDACTED]
​
[Release]
# store_db=sqlite:////tmp/test.db
store_db=postgresql://[USER]:[PASSWORD]@[DB HOST]:[DB PORT]/[DB NAME]
​
[Deploy]
config_stage_path=/mnt/ramdisk

The manual k8s process

Taking a service from git to k8s

The full path from writing code to an accessable service running in k8s follows these steps

  • Create work branch
  • Write tests and code that passes them
  • Fetch and merge collaborators' tests and code
  • Check that build is not broken?
  • Check that tests still pass
  • Push changes to github
  • CircleCI (CCI) builds the commit and pushes the build to our registry
  • For a full description of how to set up CCI to work with herd, review this wiki entry.
  • Write k8s resources for the build. This is the configuration step. This may include the following...
  • [Pods] (http://kubernetes.io/v1.0/docs/user-guide/pods.html) (example)
    • In general, users shouldn't need to create pods directly. They should almost always use controllers - unless you need to mount a read-write volume
  • Replication Controllers (example)
  • Services (example)
  • Secrets (and Here's a script for generating secret.yaml from a name=value environment file.)
  • Persistant Disks and Volumes (this Pod example uses Volumes)
  • Repo with more examples
  • Create the resources in the qa-sandbox cluster (using gcloud and kubectl command line tools)
  • command line tool installation instructions
  • kubectl docs
    • example: to add the replication controller: kubectl create -f path/to/foo-replication-controller.yml and to add the service: kubectl create -f path/to/foo-service.yml
  • k8s pulls the builds from our registry and runs them
  • To view information about the service you just set up, including the external IP:
    • kubectl describe services foo

A good walkthrough of k8s concepts. You may need to run this command in order to get your kubectl command configured. gcloud container clusters get-credentials <cluster name>

The herd process

Herd abstracts the manual process to the level of abstraction where we want to be making human decisions. For example we don't want running the unit tests to be a human decision, we want code integration to be a human decision.

The commands below are in order of an example workflow.

Commands

herd [--version] [--help | -h] <command> [<args>]

pull

Updates references to remote branches, and pulls changes from both mainline and the current working branch.

herd pull

localtest

Run the unit test command in the local environment from the project root. This is fast and does not run tests inside a container.

herd localtest

unittest

Run the unit test suite against a build made as if the current state of the project root were being integrated. Answers the question, “Will this code pass the unittest portion of the automated build process”. This is run by integrate.

herd unittest

integrate

Executes the CI pipeline for the most recent commit of the local repo (pull, make, unit test, push commit and build). After unit testing Circle CI will build and test the commit.

herd integrate

Examine the output of this command before moving forward. If there are no errors, locate the build in CircleCI. Under "DEPENDENCIES", locate the cell that says $ echo "The build name is in here!!!" r.iadops.com/$herd_service_name:$herd_build_tag Open that cell and the <build name> will be located within it with the variables replaced with the actual values of your herd service name and build tag.

configure

Creates a release object ready for deployment by creating a record in the release store (more info in app/tests/test.conf).

herd configure <build name> <config path>

The config format has changed, it's now docker's config format which is one key=value pair per line with no headers.

Configure will print out the info for the newly created release. The id is what should be used as <release id> in the deploy command below.

releases

Lists some recent releases.

herd releases

This is a bandaid and temporary solution for the problem of identifying what releases are available for deployment.

deploy

Execute a release on a host. If the port portion of the host string is omitted, herd will try to use the same port that the service in the release exposes.

herd deploy <release id> <host[:port]>

About

Herd Enables Rapid Deployment. An operations management tool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages