Continuous Intergration
Continuous integration (CI) is the automated process of integrating code from potentially multiple sources in order to build and test it: Unit, Servicers/API, Functional/GUI (UI interaction tests…like Capybara?). Continuous Integration is a development practice that ensures your application is always in a “good” state.
Gets triggered by source code commits
Runs any tests for frontend or backend code
Builds any artifacts (production js files, rails assets)
Publishes the artifacts (test results to dashboard, or assets to S3)
Triggers a deploy (in Opsworks)
Many CI systems are configured by a config file in the source code repo
Can build multiple branches and only deploy specific branches to specific environments
Continuous Delivery/Deployment
Continuous Delivery is an automated way to deploy your application to an environment. This can involve a number of automated or manual steps, including more integration testing, performance testing, or manual testing. The level of automation involved depends on your needs.
This includes setting up brand new environment and getting the code from the repository to the creation of fully tested and verified distribution.
Your software is deployable throughout its life-cycle
Your team prioritizes keeping the software deployable over working on new features
Anybody can get fast, automated feedback on the production readiness of their systems any time somebody makes a change to them
You can perform push-button deployments of any version of the software to any environment on demand
Continuous Deployment means that every change goes through the pipeline and automatically gets put into production, resulting in many production deployments every day.
Continuous Delivery just means that you are able to do frequent deployments but may choose not to do it, usually due to businesses preferring a slower rate of deployment. In order to do Continuous Deployment you must be doing Continuous Delivery.
Describe CI/CD pipeline
Your CI pipeline is usually triggered when code is checked into an integration branch by a developer. Unit tests are run to ensure basic functionality is correct, and then, binaries are built. The binaries created could be a JAR or Zip file or even a Docker container.
The CD can be triggered after a successful build, or it can be timed. Typically, for dev environments, your CD pipeline will be triggered by every successful build. Deployment to production can be an automatic process or can require manual sign off.
What is the point of CI/CD?
Instead of writing an entire app and investing a lot of time debugging , CI/CD automates the process as we develop. Saves lots of time. Speeds up onboarding too!
Describe CI/CD bet practices?
It should run the tests after every commit.
A single Process
Remember: when declaring variables, we are allocating a small space in RAM*
Processes as a tree
1
Processes - As a tree
Processes - Interation
Processes - Interaction
Networking
#Networking: *OSI Stack - common internet stack: 7 layers*
This is the network layer. It gives us our IP address.
Networking: UrL
What is a continuous integration server?
Jenkins: an open source tool written in Java with plugins built for CI. Plugins allow integrations at various DevOps stages.
What is a continuous integration server?
Jenkins: an open source tool written in Java with plugins (over 1000) built for CI. Plugins allow integrations at various DevOps stages.
What is a continuous integration server?
Jenkins: an open source tool written in Java with plugins (over 1000) built for CI. Plugins allow integrations at various DevOps stages.
Its the most widely accepted tool because of its flexibility and abundance of plugins
What is a continuous integration server?
Jenkins: an open source tool written in Java with plugins (over 1000) built for CI. Plugins allow integrations at various DevOps stages.
Its the most widely accepted tool because of its flexibility and abundance of plugins. These plugins can help meet the individual needs of individual devs.
When devs make a change to the source code in the repo, the Jenkins server pulls the code and tries to make a build.
Build application is now deployed onto the test server for testing.
Now devs will be constantly notified of results.
What are shortcomings of using a single Jenkins server?
1) if you need IE tests, we need to run a Windows machine.
2) another build job may require another Linux box
Solution!
Jenkins distributed architecture.
What are shortcomings of using a single Jenkins server?
1) if you need IE tests, we need to run a Windows machine.
2) another build job may require another Linux box
Solution!
Jenkins distributed architecture.
Jenkins master distributes workload to the slaves.
Slaves provide the required environment
AWS
Regions
EC2 - Instances
Instance is the primary location to look at the state of the machines you’re using.
There are machines optimized by memory consumpton
IAM role
EC2 - KeyPairs
SSH = secure shell that uses encryption;
EC2 uses SSH keys to grant you access to the instances you create
On new instance creation, you’ll be asked to select a key
You can upload an existing public key, to which you have the private (~/.ssh/id_rsa.pub)
Or allow AWS to create a new one, and download the private key
generate by typing into the CLI: open ssl genrsl
EC2 -VPCs
RDS (Relational DB Service):
EC2 - Volumes (EBS)
EC2 - Load Balancers
EC2 - Security Groups