Artsy Docker Development Toolkit
Hokusai works with Kubernetes and Docker to manage a container driven workflow, from development to testing and deployment.
If you install Docker for Mac, docker-compose
is also installed. Otherwise install with: sudo pip install docker-compose
.
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.
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.
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 .
hokusai --help
hokusai {command} --help
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 projectDockerfile
- i.e. "ruby:2.2" or "ruby:2.2-alpine" - see Docker Hub for valid base images.
hokusai dev
- Boot a development stack as defined inhokusai/development.yml
.hokusai test
- Boot a testing stack as defined inhokusai/test.yml
and exits with the return code of the test command.
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.
hokusai config pull
- Pulls config from the Kubernetes server and writes to thehokusai
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
hokusai secret pull
- Pulls secrets from the Kubernetes server and writes to thehokusai
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
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.
hokusai deploy
- Update the Kubernetes deployment to a given image tag.
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 forrake
tasks, etc).