/devops-skills-with-GitHub

All of the tools for building devops workflows

Primary LanguagePythonCreative Commons Zero v1.0 UniversalCC0-1.0

CI Codespaces Prebuilds

[codebuild

devops-skills-with-GitHub

All of the tools for building devops workflows

Part2: Automating Text and Filesystem

  • dive into pathlib

Part 3: Build containerized Microservice

/docs get to swagger

fastapi

#change

Docker

docker build . docker image ls #find image docker run -p 127.0.0.1:8080:8080 93fa55efa692

Cloud9 + ECR + App Runner

continuous-delivery

  • Clone repo into Cloud9 (pick a machine with decent size CPU and RAM if possible, but students should use micro)
  • Add ssh keys to GitHub
  • resize to bigger disk
  • Create virtualenv and add to bashrc and source python3 -m venv ~/.venv && echo 'source ~/.venv/bin/activate' >> ~/.bashrc && source ~/.bashrc
  • cd into checkout and run make install
  • Preview running FastAPI app after running: python main.py

Screen Shot 2022-09-28 at 12 32 52 PM

  • Create ECR repository by right-click in Cloud9

Screen Shot 2022-09-28 at 12 34 44 PM

  • Navigate to ECR repo created or whatever you named it and follow "push" instructions

    Screen Shot 2022-09-28 at 12 36 45 PM
  • Navigate to AWS App Runner and Setup Continuous Delivery using ECR

    Screen Shot 2022-09-28 at 12 41 21 PM
  • Setup AWS Code Build to push container after each build (which triggers auto-deploy)

    Screen Shot 2022-09-28 at 12 50 19 PM

See following buildspec.yml and Makefile

Things to Cover

  • Linting Dockerfile and also dealing with containers

Tips

  • Great way to find a package version: pip freeze | grep ipython