Week 7 Session 3 Instruction Documentation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

Week 8 Session 3

Part-I: Introduction (10 Min)


Greet candidates attending the session.

Scenario: discussion
TechCo, an innovative startup dedicated to transforming healthcare through technology, embarked on a mission to develop a
cutting-edge telemedicine platform called "HealHub." This story chronicles TechCo's journey as they embraced DevOps
principles and harnessed the power of AWS services to accelerate their development process, enhance the quality of
healthcare solutions, and ultimately improve patient care.

Before adopting DevOps practices, TechCo faced several challenges. Their development cycles were often lengthy, hindering
their ability to quickly deliver new features and updates. Manual testing processes consumed significant time and resources,
leading to bottlenecks and delays. Additionally, their existing infrastructure had limited scalability, posing a challenge in
meeting the increasing demand for telemedicine services.

TechCo envisioned HealHub as a secure and user-friendly telemedicine platform that would seamlessly connect patients and
healthcare providers remotely. They aimed to provide a convenient and efficient healthcare experience, empowering
individuals to access medical consultations and services from the comfort of their homes.

To overcome their challenges and bring HealHub to life, TechCo embraced DevOps principles, leveraging AWS services to
streamline their development process. They adopted continuous integration and continuous deployment (CI/CD) pipelines,
allowing for automated builds, tests, and deployments. This enabled them to rapidly iterate on features, reduce development
cycles, and ensure faster time to market.

With AWS's scalable infrastructure, TechCo could handle the increasing user load and seamlessly accommodate a growing user
base. AWS Elastic Beanstalk provided an easy and efficient way to deploy and manage their HealHub application, while Amazon
EC2 instances ensured reliable and scalable computing resources.

TechCo also implemented automated testing frameworks, leveraging AWS CodePipeline and AWS CodeBuild. These services
enabled them to automatically build and test their application code, significantly reducing manual effort and improving overall
software quality.

By embracing DevOps practices and leveraging AWS services, TechCo successfully transformed their development process and
brought HealHub to fruition. The telemedicine platform empowered patients to connect with healthcare providers remotely,
facilitating timely consultations, diagnoses, and treatments. With streamlined development cycles, automated testing, and
scalable infrastructure, TechCo was able to iterate on HealHub's features, continuously enhance the platform, and ultimately
revolutionize the way healthcare is delivered .

Goals and Objectives:


1. CodePipeline: Streamline and automate the software release process.
2. CodeCommit: Provide a secure and scalable version control system for source code management.
3. CodeBuild: Automate the build and testing process of applications.
4. CodeDeploy: Automate application deployments to various environments.
5. Monitoring using CloudWatch: Monitor the health, performance, and availability of applications and infrastructure.

Technical Requirements and Prerequisites for Participants:

1. CodePipeline:
 Basic understanding of version control systems and CI/CD concepts.
 Familiarity with AWS services and console navigation.
 Knowledge of build and deployment processes.
2. CodeCommit:
 Understanding of Git version control system.
 Proficiency in using Git commands and workflows.
 Knowledge of AWS IAM for user access management.
3. CodeBuild:
 Understanding of build configurations and build tools (e.g., Maven, Gradle, npm).
 Knowledge of scripting languages (e.g., Bash, PowerShell) for custom build steps.
 Familiarity with testing frameworks and unit testing concepts.
4. CodeDeploy:
 Knowledge of application deployment concepts.
 Understanding of deployment strategies (e.g., blue/green, canary).
 Familiarity with server configuration and management.
5. Monitoring using CloudWatch:
 Understanding of system monitoring and key performance indicators (KPIs).
 Knowledge of AWS services and how to set up monitoring for different resources.
 Familiarity with log analysis and troubleshooting techniques.

Part-II: Focused Teaching (40 min)


Version Control with CodeCommit

Demo-1
Install git on your local machine

Install git on a Windows machine

Click on the yellow mark to download the git

Once it is downloaded, click on Open and Install

Now git is ready on your local machine

To verify:

C:\..> git –version


IAM User Permission
Create a AWS CLI user with the following permissions:

Provide HTTPs Git Credentials for Aws CodeCommit

Go to Security Credentials Tab

Scroll down to HTTPS Git credentials for AWS CodeCommit

Click on Generate Credentials

Download credentials

You will have credentials the below-given format:


In your case, username and password will be different.

Next, Create CodeCommit Repository:

To clone the repository on the local machine, copy https URL

Open CodeCommit & create repository:

Select Clone HTTPS from healhubrepo


Run git clone <httpd codecommit repository URL>

Note: Provide credentials when it is asked.

Copy the content of the website in the local directory of the local machine

Note: You can take any template or a simple file to demonstrate.

At present Codecommit repository is empty


Run git status

You will find the content is not tracked

Run git add -A

Run git status


You will find the content is now has been tracked

Now you need to commit the changes

git config --global user.name "Your Name"

git config –global user.email “xxxxxxxx@mail.com”

Run git commit -m “Uploading the content”

Now you will see the content has been committed

Now you need to push the content into the codecommit repository

Run git push


And to verify the code has been uploaded, open Aws CodeCommit repository and will find the content has been
uploaded

Repository is done here

Collaborating using branches, pull requests, and code reviews


Command to see the existing branch

Creating branch2
Branch has been created

Open the branch, you will find the same content copied in the master branch.

Now you are in branch2.

Open & make some changes in the index.html file.


Change has made in line 55 (Note: You can also take a simple plane text file to demonstrate)

Modified code in green color in branch2 index.html

Now commit changes.

Index.html has been modified in branch2.

Now you need to create pull request and merge changes in the master branch’s index.html
Scroll down on the same page, and see the differences

Click on Create Pull Request button

Now click on Merge


Unselect “Delete source branch branch2 after merging”, we don’t need to delete content from branch2, and now
click on Merge Pull Request button.

To verify the merge go to the master branch, open the index.html file, and track line number 55 and observe the
changes.

Demo 2
Continuous Integration with CodeBuild:
Creating a Codecommit Repository and upload application code
Note: Use the link of github public repository to download code for the lab https://github.com/sanjay1869/HealHub.git
Creating and uploading buildspec.yml file
version: 0.2
phases:
install:
runtime-versions:
nodejs: latest
commands:
- echo "installing something"
pre_build:
commands:
- echo "we are in the pre build phase"
build:
commands:
- echo "we are in the build block"
- echo "we will run some tests"
- grep -Fq "HealHubProject" index.html
post_build:
commands:
- echo "we are in the post build phase"

Creating CodeBuild Project


Now Create Build Project

Click on Start Build button

Part-III: Doubt Resolution (15 min)


Clarify the common doubts learners might face.
Part-IV: Demonstration (60 min)

Demo 3
Deployment and CodePipeLIne

Create CodePipeLine

Add Source Provider, Repository Name and Branch Name:


Add Build Stage

Add Deploy Stage:


Note: Create in advance Application and Environment in Elastic Beanstalk if you are deploying it using Elastic
Beanstalk.

Review and Create Pipeline

Goto Elastic Beanstalk now: You will find the application has been deployed in an Instance using Elastic Beanstalk

Access the URL: http://healhub.us-east-2.elasticbeanstalk.com/

Note: In your case, URL will differ.


Demo 4
Creating a PipleLine using CodeCommit and CodeDeploy

Creating a new PipeLine

Adding Source Stage:


Skip Build Stage

Finally, configure deploy stage:

Review and Create Pipeline


Now the application has been deployed in Elastic Beanstalk if you need, you can also configure Load Balancer and
Auto Scaling in Elastic Beanstalk Configuration.

Need to test pipeline is properly working or not, open index.html file in codecommit repository, edit line number
38, change background-color: green; and commit the changes in the repository.

After new seconds, open the url again


Monitor Log Events in CloudWatch Service under HealHubProject log group

You might also like