Skip to content

ashkan18/hokusai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOKUSAI

Artsy Docker Development Toolkit

About

Hokusai works with Kubernetes and Docker to manage a container driven workflow, from development to testing and deployment.

Requirements

  1. Docker

  2. Docker Compose

If you install Docker for Mac, docker-compose is also installed. Otherwise install with: sudo pip install docker-compose.

  1. AWS CLI

Install with: pip install awscli. Set the $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY environment variables. You should have permissions to evaluate the aws ecr get-login comamnd for your ECR region and push access to your ECR repositories.

  1. kubectl

Install the kubectl binary and kubectl configuration in ~/.kube/config for your Kubernetes cluster - make sure the version of the kubectl binary matches your cluster.

Setup

Ensure docker, docker-compose, kubectl and aws are installed to your PATH.

Ensure Python-development headers are installed. On Debian run

sudo apt-get install python-dev

Now package Hokusai with

pip install .

And hokusai should now be installed on your PATH.

Now run

hokusai check --interactive

to ensure everything is set up correctly.

To upgrade to the latest changes in this repo, just run

pip install --upgrade .

Use

hokusai --help
hokusai {command} --help

Initializing a project

Run

hokusai init

This writes hokusai project config to hokusai/config.yml, creates test, development and production yaml files alongside it, and adds a Dockerfile to the current directory.

Required options:

  • --aws-account-id: Your AWS account ID - can be found in your AWS account console.
  • --framework: Either "rack" or "nodejs".
  • --base-image: The base docker image for the project Dockerfile - i.e. "ruby:2.2" or "ruby:2.2-alpine" - see Docker Hub for valid base images.

Development

  • hokusai dev - Boot a development stack as defined in hokusai/development.yml.
  • hokusai test - Boot a testing stack as defined in hokusai/test.yml and exits with the return code of the test command.

Working with Images

  • hokusai build - Build the latest docker image for the project.
  • hokusai pull - Pull images for your project from your AWS ECR repo.
  • hokusai push - Push a locally built image to your AWS ECR repo.
  • hokusai images - List all project images in your local docker registry.

Working with ConfigMaps

  • hokusai config pull - Pulls config from the Kubernetes server and writes to the hokusai directory.
  • hokusai config push - Pushes config from the hokusai directory to the Kubernetes server. Config is created for the project as the Kubernetes ConfigMap object {project}-config

Working with Secrets

  • hokusai secret pull - Pulls secrets from the Kubernetes server and writes to the hokusai directory.
  • hokusai secret push - Pushes secrets from the hokusai directory to the Kubernetes server. Secrets are created for the project as the Kubernetes Secret object {project}-secrets

Working with Stacks

  • hokusai stack up - Launch a stack for a given Kubernetes context.
  • hokusai stack down - Delete a stack defined for a given Kubernetes context.
  • hokusai stack status - Print the stack status.

Deployment

  • hokusai deploy - Update the Kubernetes deployment to a given image tag.

Running a console

  • hokusai console - Launch a container and attach a shell session.
  • hokusai run - Launch a container and run a given command. It exits with the status code of the command run in the container (useful for rake tasks, etc).

About

Artsy Docker Development Toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%