This tutorial will survey the technologies and techniques used in GitOps, a versioned and immutable declaration of an information system's desired state that's automatically deployed and continuously reconciled.
Attendees will start by creating a small serverless web app using Python, AWS Lambda, and AWS DynamoDB. After deploying the first version by hand, they will re-define the web app as an infrastructure-as-code project using OpenTofu. Attendees will review pre-commit hooks, atomic commits, Conventional Commits, and Semantic Versioning as they build their first continuous integration/continuous delivery (CI/CD) pipeline in GitHub Actions.
To avoid breaking their new production web app, attendees will isolate further development in Git feature branches. They'll follow the red-green-refactor pattern of test-driven development, and they'll make sure that their production deployments reproduce what they tested. At each step, attendees will rely on their build tooling and their CI/CD pipeline to reduce development and operational effort. And at the end of the tutorial, attendees will evaluate different deployment strategies and explore how they might adapt their test scripts to continuously validate their production environments.
You will need a GitHub account.
You will need administrator access to an AWS account. You should know how to use the AWS Management Console.
Caution
This workshop should not exceed the limits of the GitHub free plan or the AWS Free Tier, but make sure to track and remove (or make private) the resources it creates.
It will help (but isn't required) to know how to program in Python and how to write HTML. It might also help to know how HTTP works.
You should be familiar with the Linux command line and with nano or vim. It will help (but isn't required) to know how to use AWS CloudShell.
You should know how to use Git (init/add/commit) with GitHub (clone/push/pull).
Package managers aren't necessarily required, but they make installing everything easier.
-
Windows: Chocolatey, WinGet
-
These require the Command Line Tools for Xcode, available from the Apple Developer web site, or Xcode, available from the Mac App Store.
-
Linux: Use the built-in package manager, e.g. APT on Debian/Ubuntu.
You will need to install and configure the AWS CLI. While not ideal, an IAM user with long-term credentials is easiest to set up. Whatever you do, make sure the credentials you use have administrator access.
Install Git if you haven't already.
Install the GitHub CLI and log into your
account with the command gh auth login. You can use the GitHub CLI
as a Git credential helper
if you choose HTTPS as your preferred protocol for Git operations.
Complete the credential helper setup by running the command gh auth setup-git. Refer to GitHub's
Authentication documentation
for more information.
This workshop specifically uses Python 3.12, the second most recent Python release at the time this was written. For further instructions, refer to Relieving Your Python Packaging Pain.
This workshop also uses OpenTofu, a free/libre/open source software fork of Terraform.
While any OCI-compliant container runtime should work, this workshop is designed around Docker Desktop (on Windows and macOS) or Docker Engine (on Linux).
Install act, which uses Docker
to simulate a GitHub Actions runner. Download the included
.actrc file and save it to your Windows user profile (e.g.,
C:\Users\matthew) or your macOS/Linux home directory (e.g.,
/Users/matthew or /home/matthew).
Download the ubuntu-latest container image ahead of the workshop by
running the command docker pull --platform linux/amd64 ghcr.io/catthehacker/ubuntu:act-latest.
Finally, install your favorite code editor. VSCodium is a community-driven, freely-licensed binary distribution of Microsoft Visual Studio Code.