Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Migrating to Python 3 using Docker for your CI/CD pipeline (even if you can't use it in production) by Cobus Bernard

Pycon ZA
October 10, 2019

Migrating to Python 3 using Docker for your CI/CD pipeline (even if you can't use it in production) by Cobus Bernard

When moving from Python 2 to 3, it is hard to make sure that you application will work as planned without having to also worry about your build and deployment pipeline. You may also be in a position where you are unable to run Docker in production. In this talk, I will show you how to use Docker for your CI/CD pipeline and how to approach the move to Python 3 using containers to minimise the risk and complexity of the move. We will look at how Docker simplifies the build and test process by running all the steps inside containers by starting with a Python 2 repo in Github, adding Dockerfiles, using CodePipeline to build/test and then deploy to an instance using Docker to transport the application, but not run it. We will then branch the project and start a mock conversion to Python 3 using the same containers, and ultimately deploy to the instance. In the middle of this, we will look at changing the build process to add virtual environments to the production instance as we need to be able to use different versions of Python. The session will include a demo of how to create all the infrastructure with code to help attendees automate their own workflows.

Pycon ZA

October 10, 2019
Tweet

More Decks by Pycon ZA

Other Decks in Programming

Transcript

  1. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Migrating to Python 3 using Docker in your CI/CD pipeline (even if you can’t in production) Cobus Bernard Senior Technical Evangelist AWS @cobusbernard
  2. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Agenda • Docker benefits • How to sneak it in responsibly add it to your CI/CD Pipeline • Demo!
  3. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Global Infrastructure • 22 Regions with 69 Availability Zones • 3 Regions coming soon: Cape Town Jakarta and Milan • 100Gbps redundant network • 99.99% SLA
  4. Use code to model applications and infrastructure Infrastructure as code

    goals Infrastructure as code 1. Make infrastructure changes repeatable and predictable 2. Release infrastructure changes using the same tools as code changes 3. Replicate production environment in a staging environment to enable continuous testing
  5. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cobus Bernard @cobusbernard