UFO is a tool for building Docker images and deploying containers to AWS ECS. It uses templates to generate similar task definitions for different container types (e.g. web, worker). This allows common settings to be shared. UFO handles building the image, registering task definitions, and updating ECS services in one command. The demo shows generating task definition templates, building a Docker image, and deploying it to ECS with a single 'ufo ship' command.
2. About Me
I’ve done a little bit of everything. Both dev and ops.
@tongueroo - Twitter.
https://medium.com/@tongueroo - Blog.
tongueroo.com - Personal Site.
3. lono - CloudFormation template generator.
jack - Manage ElasticBeanstalk environments.
thor_template - used this to generate this tool.
ufo - ship docker images to ecs. What this talk is about.
These tools are in Ruby.
More: http://tongueroo.com/projects/
Other Tools
4. Why?
Wanted get my hands dirty with ECS.
Wanted more control over the ECS task definition.
Wanted to automated the building of the docker image as
part of building task definition.
Ending up using it on my side projects.
5. ECS Introduction - Terms
Task definition - blueprint for docker container.
Task - Actual running container.
Service - Long running tasks.
Cluster - Logic group of EC2 Container instances.
Container Instance - EC2 instance that is part of an ECS
Cluster.
7. Steps for Deploying on ECS
1.Build and push docker image
2.Build and register task definition
3.Update the ECS service (create the service if needed)
8. Google Search: “deploying to ecs”
silinternational/ecs-deploy - pulls down existing task
definition.
CircleCI deploy.sh example - nice and simple easy to build
from.
Empire - heroku like opensource SaaS from Remind
engineering. A little more than I need but cool project.
Programmer Virtue #1: Laziness ->
Research
9. Wanted more control over the task definition template.
Would be nice if the task definition could be reused for
common and similar processes: web, clock, worker.
More Control
11. UFO Template DSL
UFO will use a ERB template to generate the task
definition for all the processes you need: web, clock,
worker, etc.
Allows sharing of code and settings.
Let’s see what it looks like.
14. ufo ship: whole point of this tool
NOTE: The ECS Cluster and a Container Instance must
already exist. I created Container Instances with the lono
tool.
1. Build and push docker image
2. Build and register task definition
3. Update the ECS service (create the
service automatically if needed)
16. What Happened Review Summary
ufo init - generates the skeleton ufo files.
Mainly ufo/task_definitons.rb and
ufo/templates/main.json.erb - most configurations and
changes go in here.
ufo/settings.yml - is nice to know about a useful setting in
here.
bin/deploy - wrapper script.
17. In ufo/task_definitions.rb there are some helper methods.
helper.full_image_name - this is the generated docker
image name.
helper.dockerfile_port - parsed from the Dockerfile.
env_file - useful helper method to translate a env list to
the json formatted list for an ECS Task definition.
Review tasks_definitions.rb Helpers
18. ufo docker build - only build the docker image
ufo tasks build - only build the task definitions
ufo scale hi-web 1 - scale up and down tasks
Misc ufo commands
19. THE END
Hacker Noon Blog Post - Ufo—Easily Build Docker Images
and Ship Containers to AWS ECS
Setting up CI with UFO, ECS, and CircleCI
GitHub - https://github.com/tongueroo/ufo
Slideshare - http://www.slideshare.net/tongueroo/ufo-
ship-for-aws-ecs-70885296
tongueroo@gmail.com - feel free to contact me
Hinweis der Redaktion
Time Machine.
Infrastructure is Code
Philosophy, Culture, Mindset
Devs should be able to spin up the cluster themselves w/o any ops involvement. Everyone wants their own internal PasS, their own heroku. That's still the ultimate goal.