Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft

823 vues

Publié le

It worked on my machine!" How many times have you heard (or even said) this sentence? Keeping consistent environments across your development, test, and production systems can be a complex task. Enter containers! Containers offer a way to develop and test your application in the same environment in which it runs in production. Developers can use tools such as Docker Compose for local testing of complex applications; Jenkins and AWS CodePipeline for building and orchestration; and Amazon ECS to manage and scale their containers. Come to this session to learn how to build containers into your continuous deployment workflow, accelerating the testing and building phases and leading to more frequent software releases. Attendees will learn to use Docker containers to develop their applications and test locally with Docker Compose (or Amazon ECS local), integrate containers in building, deploy complex applications on Amazon ECS, and orchestrate continuous development workflows with CodePipeline.

Publié dans : Technologie
  • Identifiez-vous pour voir les commentaires

  • Soyez le premier à aimer ceci

TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft

  1. 1. TurboCharge Your Continuous Delivery Pipeline with Containers Yaniv Donenfeld, Solutions Architect Amazon Web Services
  2. 2. What to expect from the session • Best practices for containers in continuous delivery solutions • Toolset to implement such solutions • Demos
  3. 3. Why use containers? • Process isolation • Portable • Fast • Efficient
  4. 4. Why use containers for continuous delivery? • Roll out features as quickly as possible • Predictable and reproducible environment • Fast feedback
  5. 5. Demo application architecture Nginx Proxy Ruby on Rails web app PostgreSQL on RDS
  6. 6. Amazon EC2 Container Service • Highly scalable container management service • Easily manage clusters for any scale • Flexible container placement • Integrated with other AWS services • Extensible • Amazon ECS concepts • Cluster and container instances • Task definition and task
  7. 7. Development and deployment workflow Orchestration layer Code repository Build environment Test environment Deployment environment Source
  8. 8. Stage 1 - Source
  9. 9. Development environment Code repository Source
  10. 10. AWS CodeCommit • Private Git repository • Fully managed • Secure • Highly available and scalable • Alternatives • GitHub • Bitbucket
  11. 11. Docker and Docker Toolbox • Docker (Linux > 3.10) or Docker Toolbox (OS X, Windows) • Define app environment with Dockerfile
  12. 12. Dockerfile FROM ruby:2.2.2 RUN apt-get update -qq && apt-get install -y build- essential libpq-dev RUN mkdir -p /opt/web WORKDIR /tmp ADD Gemfile /tmp/ ADD Gemfile.lock /tmp/ RUN bundle install ADD . /opt/web WORKDIR /opt/web
  13. 13. Docker Compose Define and run multi-container applications: 1. Define app environment with Dockerfile 2. Define services that make up your app in docker-compose.yml 3. Run docker-compose up to start and run entire app
  14. 14. docker-compose.yml proxy: build: ./proxy ports: - "80:80" links: - web web: build: ./web command: bundle exec rails server -b environment: - SECRET_KEY_BASE=secretkey expose: - "3000"
  15. 15. Amazon ECS CLI • Easily create Amazon ECS clusters & supporting resources such as EC2 instances • Run Docker Compose configuration files on Amazon ECS
  16. 16. Amazon ECS CLI > ecs-cli configure > ecs-cli compose build > ecs-cli compose up --local
  17. 17. It’s Dem-o-clock!
  18. 18. Stage 2 - Build
  19. 19. Build environment Build environment
  20. 20. Partners
  21. 21. Jenkins • Extensible • Flexible builds • Ant or Maven based projects • Docker images • Optionally runs in Docker container
  22. 22. CloudBees Docker Build and Publish plugin
  23. 23. Amazon EC2 Container Registry • Private Docker Repository • v2 Docker Registry • AWS Identity and Access Management (IAM) and AWS Auth integration • Low latency push, pulls, and inspection • Alternatives: • DockerHub • Docker Trusted Registry
  24. 24. Stage 3 - Test
  25. 25. Test environment Test environment
  26. 26. rspec and capybara-webkit require 'rails_helper.rb' feature 'Signing in' do scenario 'can sign in' do visit '/users/sign_in' within("#new_user") do fill_in 'Email', :with => 'test@test.com' fill_in 'Password', :with => 'password' end click_button 'Log in' expect(page).to have_content('Signed in successfully.') end end
  27. 27. Jenkins • Run tests directly via Docker run • Run tests in a Docker slave on Amazon ECS
  28. 28. CloudBees Jenkins ECS plugin
  29. 29. Jenkins slave Dockerfile FROM jenkinsci/jnlp-slave USER root RUN apt-get update -qq && apt-get install -y -qq git curl wget build-essential […] RUN apt-get install -y qt5-default libqt5webkit5-dev RUN apt-get install -y xvfb x11-xkb-utils xfonts-100dpi xfonts- 75dpi xfonts-scalable xfonts-cyrillic x11-apps ENV RUBY_VERSION 2.2.2 RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc && mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git && cd /src/ruby-build && ./install.sh && cd / && rm -rf /src/ruby-build && ruby-build $RUBY_VERSION
  30. 30. Jenkins slave Dockerfile RUN gem update --system && gem install bundler # Install Gems WORKDIR /tmp ADD Gemfile /tmp/ ADD Gemfile.lock /tmp/ RUN bundle install USER jenkins
  31. 31. It’s Dem-o-clock!
  32. 32. Stage 4 - Deploy
  33. 33. Deployment environment Deployment environment
  34. 34. Amazon ECS CLI > ecs-cli up > ecs-cli compose up > ecs-cli ps
  35. 35. AWS Elastic Beanstalk • Deploy and manage applications without worrying about the infrastructure • AWS Elastic Beanstalk manages your database, Elastic Load Balancing (ELB), Amazon ECS cluster, monitoring, and logging • Docker support • Single container (on Amazon EC2) • Multi container (on Amazon ECS)
  36. 36. Putting it all together
  37. 37. Putting it all together Orchestration layer
  38. 38. AWS CodePipeline Model and automate your software release processes • Rapid delivery • Configurable workflow • Customizable • Highly integrated
  39. 39. It’s Dem-o-clock!
  40. 40. Takeaways • Use Amazon ECS CLI to run application • Run Jenkins jobs in containers • Let AWS CodePipeline orchestrate your pipeline
  41. 41. Yaniv Donenfeld TurboCharge Your Continuous Delivery Pipeline with Containers donenfel@amazon.com