week 6 Flashcards
(36 cards)
AWS regions & availability zones
- spans 77 Availability Zones within 24 geographic regions around the world,
- AWS Regions: geographical location with a collection of availability zones mapped to physical data centers in that region
- AWS Availability Zones: logical data center in a region available for use by any AWS customer
EC2 autoscaling
helps you maintain application availability and allows you to automatically add or remove EC2 instances according to conditions you define
benefits:
- Improve Fault Tolerance
- Increase Application Availability
- Lower Costs
groups: collections of EC2 instances with similar charcteristics
launch configuration: template used by auto scaling group to launch EC2 instances
Git flow & Branching
branching: a reference to commit, branch itself represents the HEAD of a series of commits
- default branch name in Git is master, which commonly represents the official, working version of your project
- a strategy that allows developers to take a snapshot of the master branch and test a new feature without corrupting the project in production. If the tests are successful, that feature can be merged back to the master branch and pushed to production.
virtual machines
simulate a physical server so that multiple “servers” can run on a single machine
Pros:
near total isolation
Provides virtualization, virtualizing the entire OS
Ensures an application runs reliably regardless of Host
Cons:
considered “bulky”, expensive in the context of resources
containers
bundle together applications with their supporting libraries and dependencies, allowing them to run isolated from one another
Pros:
- considered “light weight”, because they don’t require spinning up a whole guest OS
- they can enable layers of isolation or partial isolation– depending on how they are implemented
- provide a virtualized view of certain resources.
- Package an application in an isolated environment
- Ensure an application runs reliably regardless of Host
Cons:
- having layers of isolation
- if you have need of very strict and complete isolation the ability to have layers can be a con
containerization
helps to ensure the application or set of processes can run reliably regardless of the host environment
managing containers
- list containers
- run command in running container
- view container logs
- list port mappings between containers ports and hosts
- stop a container
- pause and unpause container
- start container
- remove container
- remove volume
docker architecture
- Docker CLI (Command Line Interface) client: what Docker developers typically use for interactions with the Docker daemon, prefaced by the docker command
- Docker Daemon: long running process on the docker host that does all the heavy lifting of managing Docker objects- containers, images, etc.
- Rest API: underlying commands used by the CLI and other applications to interact with the Docker Daemon
- Docker registries: provide a centralized place to store images, allowing you to easily share images between docker hosts.
- Docker objects: are managed by the docker daemon. include images and containers. Images are the templates that outline all dependencies for a particular container and it’s primary process. Meanwhile the container is the runnable instance of a set of processes and their dependencies.
dockerfile
Defines everything needed for an image. It outlines the starting point, dependencies and commands that make up all the processes needed for an image and in turn a container.
docker volumes
a way to persist data for a container
They facillitate:
- sharing data between many different containers
- decoupling of host and container
- storing data remotely
- moving data between hosts or backing up data between hosts
docker best practices
- lightweight containers and images
- less in working directory means faster the process and lighterweight the image
- least number of ultimate layers for an image possible
- use volumes for persistent data
- use secrets for sensitive data and config files for configurations that are not sensitive
dockerfile commands
FROM image name: specifies the parent image from which the new image should be based
RUN: used to set up image
ADD : adds files from build context or url to the image
COPY : adds files from the build context to the image
EXPOSE: outlines the ports that the are being listened on by processes in the container
VOLUME [“/nameofdir”]: indicates what directory to connect a volume to when running the docker container
WORKDIR : sets the working directory in the image and eventual container of commands that follow
CMD: used to run the app, processes etc. needed inside of your container
building an image
create image with build: “> docker build anyflags PATH”
create image with commit: “> docker commit flags CONTAINER imagename”
image management: “docker images”
creating containers
> docker create imagename - creates a container that is in the “created” state
docker run flags imagename - pulls the image from the registry, then creates and runs the container
docker compose
the tool that makes creating and managing multi-container applications easier.
file components: version services: image, build, ports, environment, env_file, restart volumes networks
DevOps
- Software Development (dev) Operations (ops)
- set of practices and methodologies designed to combine the development, deployment and maintenance of code into a streamlined process
steps:
- Source code Control: Producing (writing) code and pushing to a repository
- Building and Testing Automation: Test basic functionality of code (Generally unit testing) and create a new, working build
- Deploying to Staging: Deployment of working build to a temporary environment
- Acceptance Testing: Undergo other more complex tests (systems, integration) within temporary environment
- Deployment of Build: Migrate working build to Production environment accessible by end users
Agile
approach to SDLC that is based on iterative development; wherein, requirements, solutions and systems evolve throughout the production of software, and collaboration between cross-functional teams. Due to its flexibility Agile is considered the standard for development.
Benefits of Agile:
- Client Collaboration is generally regarded positively
- Agile team cultures tend to stay more self-organized and motivated
- Overall quality of product is usually higher due to iterative nature
- Less risk in development process due to incremental nature of development
Risks/Considerations:
- Not as useful for smaller development projects
- Generally there are higher costs associated with an Agile workflow
- Development time can bloat if managed improperly or requirements are not clear during each step of the development
Requires more experienced members during the planning and management of projects
continuous integration
process of regularly and consistently merging code into a central repository and reviewing new code to ensure that it integrates well within the previously established code base.
benefits:
- Ensures the entire team works on the most up to date code
- Detects broken builds quickly
- Reduces risk in development when a large codebase has already been established.
- test code easily
continuous deployment
process of releasing software in which changes are tested for stability and correctness automatically
Costs/Risks of Continuous Deployment:
- Establishing a Continuous Deployment pipeline requires a more substantial investment in the engineering, and the testing culture.
- Documentation of processes is required to communicate to development, production and testing teams.
- Ongoing maintenance of deployment pipeline is required to ensure work continues running smoothly, increasing production costs.
- Feature flags (communication of completed features and progress) are required for coordination between departments.
Benefits of Continuous Deployment:
- Even faster development process, without the need to pause for deployment.
- New releases are less risky, as small changes can be easily recognized and fixed, allowing for better and quicker feedback.
- Increased communication and regular streams of improvements are generally regarded highly by customers.
continuous delivery
paradigm in which the building, management and testing of produced software is automated such that deployments can be performed at the push of a button.
Benefits of Continuous Delivery:
- Reduced Risk in Deployment
- Predictable Progress
- Frequent Feedback
Costs/Considerations of Continuous Delivery:
- Requires a strong foundation with Continuous Integration culture, and test suite coverage
- The Final deployment must still be automated which is an additional cost, Though the trigger to begin the process is manual this can still cause slowdown for the development.
- Communication of incomplete features and backlog must be maintained rigorously to communicate expectations to client and development team
Jenkins
- self-contained, open source automation server, which can be used to automate the building, testing and deployment of software
Disadvantages of Jenkins: - Requires custom jenkinsfile syntax for pipeline configuration Advantages of Jenkins: - Completely Open Source - Free - Supports all Operating systems - Supports all source code repositories
Jenkins projects/jobs and builds
Each job is a repeatable set of steps that automate a task, such as building, testing, and deploying your software. When a job is triggered, Jenkins creates a build of the project.
Maven review
- dependency manager and build automation tool for java projects.
default maven lifecycle is:
Validate => project is correct and all necessary information is available
Compile => compiles project source code
Test => tests all compiled code
Package => packages all compiled code to WAR/JAR file
Integration => performs all integration tests on WAR/JAR
Verify => runs checks on the results of integration tests
Install => installs WAR/JAR to local repository
Deploy => copies final WAR/JAR to the remote repositor
Sonar
- Sonar Cloud: A cloud based code review solution which can be configured to review code within a cloud repositoy, such as Github.
- Sonar Qube: Code review tool built to work on a centralized server or integrated into a development pipeline. minimum req jdk 11
- Sonar Lint: integrated with IDE