Chiliseed Hub is a service that manages pre-defined, production ready architectures for deploying containerized applications to AWS. Each piece of infrastructure is managed by a corresponding executor. Ultimately, the Hub combines all the pieces to provide a cohesive architecture, according to best practices.
Be sure to check out our demo to see just how simple it is to get started.
- We've deployed many projects and defined the same infrastructure time and time again.
- There are many ready terraform configurations out there, open sourced for everyone to use, but they still require knowledge of what exactly is needed and how to configure it.
- Sometimes terraform is not enough.
This project aims to provide ready-made architecture, incorporating best practices, so that we won't need to reinvent the wheel every time.
ECS based architecture
- Latest docker engine
- Latest docker compose
- Download
docker-compose.public.yml
to your machine - Check secret key by running in terminal:
base64 /dev/urandom | head -c50
- Export to environment
export SECRET_KEY=<value from step 2>
- Run
docker-compose up -d
from a directory containing the docker compose you downloaded Install chiliseed cli:
- On Mac:
brew install chiliseed/homebrew-tools/chiliseed
- On Linux:
curl -O https://github.com/chiliseed/cli/releases/download/0.1.2/chiliseed_0.1.2.x86_64-linux.tar.gz tar -xvzf chiliseed-0.1.2.x86_64-linux.tar.gz mv chiliseed /usr/local/bin/
NOTE You might need to install
openssl-sys
(Debian/Ubuntusudo apt-get install pkg-config libssl-dev
)
The following terms will be repeated everywhere so be sure to familiarize yourself with them:
Name | Description | Related infra parts |
---|---|---|
Environment | The most basic encapsulating unit, describes and manages global components that will relate to all your deployed apps. e.g. staging/production/dev. | VPC, subnets, NAT gateway, Route 53 hosted zone |
Project | Umbrella for deployed components. Your code-base that might be comprised of one or more services. | ALB, key pair, ECS cluster, ASG for EC2 |
Service | The actual unit of work, api service, background worker. Your code that needs to do some business logic. | ECS service, ECR, alb listeners/target groups, ACM, service discovery |
Resource | These are your databases/caches/s3 buckets. | RDS, ElasiCache, S3 |
Once you have Chiliseed Hub running, you will need a set of AWS credentials and at least one user in the Hub.
To get AWS credentials, you will first have to sign up here for an AWS account.
Once you have an account, go ahead and create a new user for Chiliseed, assign it to the Admins group and select programmatic access. This is required in order to allow the Hub to modify the infrastructure on your behalf. Remember the keys, as you will need to provide them to the system.
Each environment can have different set of AWS keys. This allows the Hub to maintain staging in account A and production in account B.
Chiliseed Hub has a built-in command to create new users:
docker-compose exec api python manage.py create_user <email> <password> <organization-name>
You can also assign the user admin privileges by providing the --is-superuser=True
flag.
Whoever will be operating the Hub should have admin privileges.
With a set of AWS and Chiliseed credentials at hand, you can now start creating and deploying to the cloud.
To simplify your work with Chiliseed, export your Chiliseed user credentials to your env:
export CHILISEED_USERNAME=<email> export CHILISEED_PASSWORD=<password> export AWS_ACCESS_KEY_ID=<aws access key id> export AWS_SECRET_ACCESS_KEY=<aws access secret>
NOTE if you don't provide specific AWS credentials, chiliseed will attempt to pull them from default configuration locations.
Create an environment:
chiliseed environment create staging example.com
Create a project:
chiliseed project create <project name, e.g. hub>
Create a service:
chiliseed service create
Create environment variables for your service:
chiliseed env_vars create <key> <value>
Create postgres RDS:
chiliseed db create
Connect service to the RDS:
chiliseed db list
Copy the identifier of the db you want to connect to the service.
chiliseed service add-db <db-identifier>
Create an S3 bucket for your service:
chiliseed service add-statics
Deploy your service (run this from inside the root directory of the service code base):
chiliseed service deploy
- Clone the repo to your local machine,
cd
into the directory containing the code. cp .env.template .env
- Edit the values in
.env
- Download and install the
ddc-shob
tool: https://github.com/chiliseed/django-compose-shob (readme has instructions for installation) - To build and start the project run:
ddc-shob start
- Create a user for yourself:
`ddc-shob manage-py create_user [email protected] 'Aa123ewq!' Demoer --is-superuser=True
`
This project is licensed under the Apache License Version 2 - see _LICENSE.md for more details.