Skip to content

chenliu0831/ctk-api

 
 

Repository files navigation

CTK-API Cookbook

Build Status

This cookbook deploys the individual services that make up the DualSpark Cutthroat Kitchen Microservice API platform.

Requirements

cookbooks

  • build-essential - Installs C compiler / build tools
  • supervisor - Installs supervisor and provides resources to configure services
  • python - Installs Python, pip and virtualenv. Includes LWRPs for managing Python packages with pip and virtualenv isolated Python environments.

Attributes

ctk-api::default

Key Type Description Default
['apt']['compile_time_update'] Boolean force the default recipe to run apt-get update at compile time true
['build-essential']['compile_time'] Boolean Execute resources at compile time true
['python']['install_method'] String method to install python with package
['python']['version'] String the version of the package to install/upgrade. If no version is given latest is assumed. 2.7.10
['python']['checksum'] String sha256 checksum for source package of python install if/when installed from source. eda8ce6eec03e74991abb5384170e7c65fcd7522e409b8e83d7e6372add0f12a
['ctk-api']['package_name'] String Name of the python package to install/td> ctk-episode-api
['ctk-api']['package_version'] String Version of the python package to install 0.1.0
['ctk-api']['package_location'] String Package location template for downlodaing and installing python package from URL https://s3-us-west-2.amazonaws.com/packages.dualspark.com/dev/ctk-api-episode/#{node['ctk-api']['package_name']}-#{node['ctk-api']['package_version']}.tar.gz
['ctk-api']['name'] String Name of this API episode
['ctk-api']['single_uri_base'] String Base uri from which this API is hosted /#{node['ctk-api']['name']}
['ctk-api']['list_uri_base'] String Base uri for list actions and post for creating new objects /#{node['ctk-api']['name']}s
['ctk-api']['healthcheck_base'] String Uri for the health check action for this api /healthcheck

Usage

ctk-api::default

Just include ctk-api in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[ctk-api]"
  ]
}

Building Images on AWS


To build images on AWS, you'll need to run the following command before you run Packer against the imagebuild.packer.json file to bundle all of the cookbooks together:

bundle exec berks vendor

Fairly soon the need to do this will go away given that there's now a PR in to handle preCommand hooks for the chef-solo provisioner in Packer: https://github.com/maoo/packer/commit/aa58996caa7569eb3f8365f5da149ce4d9d90613

To run the actual packer build, run the following command:

packer build imagebuild.packer.json

This process assumes you've set your AWS keys in an AWS credentials file. Otherwise, you can pass these variables in via Packer user varibles.

packer build \
    -var 'aws_access_key=foo' \
    -var 'aws_secret_key=bar' \
    imagebuild.packer.json

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors:

About

Chef test-kitchen setup for testing deploy for CTK-API components

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 93.5%
  • Shell 6.5%