CI/CD notes

Azure 

Azure DevOps Documentation: Microsoft offers comprehensive documentation for Azure DevOps, which includes information on topics such as planning, development, testing, release, and monitoring. You can access the Azure DevOps documentation at the following link: https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops.

Azure Pipelines Documentation: Azure Pipelines is a cloud-based continuous integration and continuous delivery (CI/CD) service that enables you to build, test, and deploy your applications to any platform or cloud. The Azure Pipelines documentation provides information on how to create, configure, and manage pipelines. You can access the Azure Pipelines documentation at the following link: https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops.

Azure Kubernetes Service (AKS) Documentation: AKS is a fully managed Kubernetes service that simplifies the deployment and management of containerized applications. The AKS documentation provides information on how to create and manage Kubernetes clusters on Azure. You can access the AKS documentation at the following link: https://docs.microsoft.com/en-us/azure/aks/?view=azure-devops.

Azure Monitor Documentation: Azure Monitor is a platform monitoring service that provides insights into the performance and health of your applications and infrastructure. The Azure Monitor documentation provides information on how to set up monitoring, create alerts, and analyze data. You can access the Azure Monitor documentation at the following link: https://docs.microsoft.com/en-us/azure/azure-monitor/?view=azure-devops.

Azure Resource Manager (ARM) Templates Documentation: ARM templates are JSON files that define the resources and dependencies needed to deploy an application on Azure. The ARM Templates documentation provides information on how to create and deploy ARM templates. You can access the ARM Templates documentation at the following link: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/?view=azure-devops.

AWS

AWS DevOps Overview: AWS provides an overview of DevOps principles and best practices, as well as how AWS services can be used to implement DevOps workflows. You can access the AWS DevOps overview at the following link: https://aws.amazon.com/devops/what-is-devops/.

AWS CodePipeline Documentation: AWS CodePipeline is a fully managed continuous delivery service that automates your release pipelines for fast and reliable application and infrastructure updates. The AWS CodePipeline documentation provides information on how to create, configure, and manage pipelines. You can access the AWS CodePipeline documentation at the following link: https://docs.aws.amazon.com/codepipeline/index.html.

AWS CodeDeploy Documentation: AWS CodeDeploy is a fully managed deployment service that automates software deployments to a variety of compute services such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-premises servers. The AWS CodeDeploy documentation provides information on how to create, configure, and manage deployments. You can access the AWS CodeDeploy documentation at the following link: https://docs.aws.amazon.com/codedeploy/index.html.

AWS CloudFormation Documentation: AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment. The AWS CloudFormation documentation provides information on how to create, configure, and manage stacks. You can access the AWS CloudFormation documentation at the following link: https://docs.aws.amazon.com/cloudformation/index.html.

AWS CloudWatch Documentation: AWS CloudWatch provides monitoring and observability for your AWS resources and applications. The AWS CloudWatch documentation provides information on how to create and configure alarms, monitor logs, and analyze metrics. You can access the AWS CloudWatch documentation at the following link: https://docs.aws.amazon.com/cloudwatch/index.html.


Software Architecture Document

Introduction

Purpose and scope of the document

Overview of the software system being developed

Goals and objectives of the software architecture

Architectural Overview

High-level overview of the software architecture

Description of the software components and their interactions

Explanation of the architectural styles and patterns being used

Discussion of any trade-offs or decisions made in the architecture design

Design Decisions

Explanation of the key design decisions made in the architecture

Description of any alternative solutions that were considered

Justification for the chosen design decisions

Architectural Views

Detailed views of the software architecture from different perspectives

Examples of architectural diagrams, such as component diagrams, deployment diagrams, and sequence diagrams

Quality Attributes

Discussion of the key quality attributes that the architecture needs to satisfy, such as scalability, maintainability, and performance

Explanation of how the architecture design addresses each quality attribute

Risks and Mitigations

Identification of potential risks and issues that could arise in the software architecture

Explanation of the mitigations or contingency plans to address each risk

Implementation and Deployment

Discussion of the implementation and deployment plan for the software system

Explanation of any specific technology choices or requirements for the implementation and deployment

Conclusion

Summary of the key points in the software architecture document

Discussion of any future plans or considerations for the architecture


Writing Skills

 I. Những loại Essay

1. Descriptive: Essay thiên về dạng miêu tả

ex: Mô tả ngôi trường bàn đang học/ Mô tả 2 loại thú cưng của bạn

2. Definition: Dạng định nghĩa

ex: Định nghĩa như thế nào về global warming

3. Illustration: Dạng minh hoạ

ex: Minh hoạ cho 1 thành ngữ nào đó

4. Comparison/Contrast

ex: So sánh cuộc sống ở nông thông với thành phố

5. Cause and effect

ex: Nguyên nhân/ hệ quả của chơi game

6. Narrative: Văn tường thuật

ex: Văn tường thuật 1 buổi meeting (có trình tự về thời gian)

7. Process analysis: Phân tích quá trình

8. Classification: phân loại

ex: Phân loại các tiểu thuyết

9. Argumentative: tranh luận

ex: Có nên cấm xe ba gác chạy trong thành phố/ Có nên hút thuốc lá ở nơi công cộng

10. Research: Nghiên cứu

ex: Khóa luận cho thạc sĩ, tiến sĩ.

11. Critical Analysis: Phân tích bình giảng

II. Structure của 1 essay:

Một đoạn essay thường có 3 đoạn

Introduction

Body

- Paragraph 1

- Paragraph 2

- Paragraph 3

Conclusion

1. Introduction:

Trong viết sẽ có 1 dạng gọi là Hook

- Hook: Một câu (sentence) thu hút người đọc, dẫn nhập vào 1 vấn đề gần sát chủ đề mình đưa ra

- Extend -> Topic: Mở rộng ý ra

=> Dẫn đến câu Thesis(Topic) thể hiện rõ chủ đề của bài này.

Thesis là quan trọng nhất, phải làm nổi bật nó lên để người ta hiểu bài mình muốn nói gì (Thường phần 1 gồm 3-4 câu thôi)

2. Body

Đưa ra các ý tưởng

- Ý tưởng của việc tự học

 + Idea 1: Advantage

 + Idea 2: Disadvantage

- Cho trẻ vừa học vừa làm, được không?

 + Idea 1: Paragraph 

 + Idea 2: Paragraph 

 + Idea 3: Paragraph 

- Paragraph: Phải có câu topic sentence: Câu chốt của 1 đoạn văn, nêu bật lên ý tưởng của paragraph.

+ Thesis: Ảnh hưởng đến cả essay

+ Topic sentence: Ảnh hưởng đến các paragraph

- Topic sentence: Supporting - Sentences mini - Conclusion (Kết đoạn đầu, dẫn nhập qua đoạn sau)

3. Conclusion

Tổng kết lại những gì đã nói trong bài này

III. Implement

1. Introduction

- Tell a story

- Ask a question: Bố mẹ có phải là những người giáo viên tốt nhất không?

- Tell a statistics

- Cite a quotation: Đưa ra 1 trích dẫn

ex: There is a saying that "A friend in need is a friend in need"/ "A friend walk in whereas everyone walk out"

  -> Tuy nhiên không phải lúc nào mình cũng có câu thành ngữ đúng để  dẫn chủ đề mình cần.

- Genetalization: Khái quát hoá vấn đề

- Common knowledge

ex: Ngày nay intenet là 1 công cụ khá phổ biến mà tất cả ai cũng biết

Hook ( việc học trên Internet cũng khá phổ biến

2. Body

3. Conclusion

- Ask an open question

- End with a warning

- Call for action

- Suggest the result/ consequence

  + Opinion: Đưa quan điểm cá nhân là gì thì đưa vào đây

  + Dicuss:  - Thảo luận, KHÔNG được phép đưa OPINION vào đây, nên đưa suggest action/warning

                   - Summary lại những gì mình viết ở trên, không được đưa ra bất cứ opinion nào vào

 - Future plans

- Supporting idea: Quan trọng nói trước, ít quan trọng nói sau

ex:  - Advantage/ Disadvantage of Internet

       - Học song ngữ

     Hook: Biết song ngữ là 1 lợi thế với tất cả mọi người "Is now considered"

     Với tiến bộ của KH-CN, trẻ em tiếp xúc sớm với Internet (Đưa ra ý có nên học ngoại ngứ từ lúc sớm hay không?)

     Idea 1: Advantage

              + A power tool

              + Foundation for languages curious about life

              + Travel -> broaden one's mind 

           => Chốt lại 1 result/consequence

         be considered     / in detail

    Idea 2: Disadvantage - drawback = negative side; on the other hand, be regarded

              + Not fully developed

IV. Skills

1. Sentence structure

- S + V + bổ ngữ/định nghĩa

- Phrase: Cụm danh từ

- Clause: Mệnh đề

   + Relative clause

   + Noun clause

   + Adverbial clause

- Punctuation: dấu câu

- Sentence structure

- Sentence transformation: Chuyển đổi câu

2. Template

 - S + be + Adv (Place/time) / phrase

 Ex: My friend is here/in the library

S + be + Adj: Tính chất cho chủ từ

Ex: The Pohie's smooth is quite good today

- S + be + complement: định nghĩa

Ex: Mr. Jame has been a teacher for 40 years

- S + linking vert + Noun

Ex: At an early age, Joan became a Buddhist

- S + V + Adv (action verb)

Ex: In a few weeks, my cousin will arrive

       I have learned English continuously since 9 PM

- Tân ngữ trực tiếp

Ex: The archer shot an arrow into the target

- Smithers gave the employees a raise

- S + V + O + Adj 

  (make/keep/find)

Ex: We try our best to make our parents happy.

- S + V + O + bổ ngữ

Ex: Most people consider Jacob a loyal friend 

Automate data extraction within encryption

 

Title

The Partnership Manager wants to receive the weekly file related to updated metadata and has to encrypt the file when sending.

Context

What was the problem at hand?
Our system has a lot of information on the customer, so When we send the file out, there has more at-risk security like tampering or unauthorized access.

What other choices were considered?
There are several algorithms:

  • Rivest Shamir Adelman(RSA)

  • Digital Signature Standard(DSA)

  • Elliptic curve cryptography(ECC)

Reason

Why was the ECC chosen over everything else?

  • First of all, we can see this statistics table



  • This algorithm has had FIPS-Certified (Federal Information Processing Standard)

  • We can able to save the memory of the key when using ECC if we use ECC for the AES-256 session, then a 512-bit ECC key is required while a 15360-bit RSA key is required.

  • Package reference https://www.nuget.org/packages/Ecc

Advantage

  • Internet-based applications, for example, online Banking or business where a large volume of online transactions or web server requests is on demand.

  • Constraint devices like mobile devices have low computational power and low memory storage.

  • Cryptographic tokens are portable, small, and lightweight and they have the low processing power

Sequence diagram


DevOps roadmaps


Công thức bánh trung thu

 1. Bánh dẻo
* Nước đường: 60gram
* Bột: 33 gram
* Nhân: 50 gram

- Nước đường:
+ 250 gr đường
+ 250 gr nước nóng
+ 1 tý cream or tear
- Nhân đậu xanh
+ 100 gr đậu xanh
+ 45 gr đường
+ 40 -45 gr dầu ăn
+ 5gr bột mỳ
+ 2 gr trà xanh
+ 40ml nước

Dummy vs. Stub vs. Spy vs. Fake vs. Mock

 a) Dummy is simple of all. It’s a placeholder required to pass the unit test. Unit in the context (SUT) doesn’t exercise this placeholder. Dummy can be something as simple as passing ‘null’ or a void implementation with exceptions to ensure it’s never leveraged.

[TestMethod]
public void PlayerRollDieWithMaxFaceValue()
{
var dummyBoard = new Mock<IBoard>();
var player = new Player(dummyBoard.Object, new Die() ); //null too would have been just fine
player.RollDie();
Assert.AreEqual(6, player.UnitsToMove);
}

While the above test would work just fine, it won’t throw any exceptions if RollDie implementation is invoking Board Object. To ensure that Board object isn’t exercised at  all you can leverage strict mock. Strict Mock with throw an exception if no expectation is set for member.

[TestMethod]
public void PlayerRollDieWithMaxFaceValueStrictTest()
{
var dummyBoard = new Mock<IBoard>(MockBehavior.Strict); //Ensure Board class is never invoked
var player = new Player( dummyBoard.Object, new Die() );
player.RollDie();
Assert.AreEqual( 6, player.UnitsToMove );
}

b) Fake is used to simplify a dependency so that unit test can pass easily. There is very thin line between Fake and Stub which is best described here as – “a Test Stub acts as a control point to inject indirect inputs into the SUT the Fake Object does not. It merely provides a way for the interactions to occur in a self-consistent manner. These interactions (between the SUT and the Fake Object) will typically be many and the values passed in as arguments of earlier method calls will often be returned as results of later method calls“. A common place where you would use fake is database access. Below sample shows the same by creating a FakeProductRepository instead of using live database.

public interface IProductRepository
{
void AddProduct(IProduct product);
IProduct GetProduct(int productId);
}

public class FakeProductRepository : IProductRepository
{
List<IProduct>
_products = new List<IProduct>();
public void AddProduct(IProduct product)
{
//...
}
public IProduct GetProduct(int productId)
{
//...
}
}

[TestMethod]
public void BillingManagerCalcuateTax()
{
var fakeProductRepository = new FakeProductRepository();
BillingManager billingManager = new BillingManager(fakeProductRepository);
//...
}

Fakes can be also be implemented by moq using callbacks.

c) Stub is used to provide indirect inputs to the SUT coming from its collaborators / dependencies. These inputs could be in form of objects, exceptions or primitive values. Unlike Fake, stubs are exercised by SUT. Going back to the Die example, we can use a Stub to return a fixed face value. This could simply our tests by taking out the randomness associated with rolling a Die.

[TestMethod]
public void PlayerRollDieWithMaxFaceValue()
{
var stubDie = new Mock<IDie>();
stubDie.Setup(d => d.GetFaceValue()).Returns(6).Verifiable();
IDie die = stubDie.Object;
Assert.AreEqual(6, die.GetFaceValue()); //Excercise the return value
}

d) Mock – Like Indirect Inputs that flow back to SUT from its collaborators, there are also Indirect Outputs. Indirect outputs are tricky to test as they don’t return to SUT and are encapsulated by collaborator. Hence it becomes quite difficult to assert on them from a SUT standpoint. This is where behavior verification kicks in. Using behavior verification we can set expectations for SUT to exhibit the right behavior during its interactions with collaborators. Classic example of this is logging. When a SUT invokes logger it might quite difficult for us to assert on the actual log store (file, database, etc.). But what we can do is assert that logger is invoked by SUT. Below is an example that shows a typical mock in action

[TestMethod]
public void ModuleThrowExceptionInvokesLogger()
{
var mock = new Mock<ILogger>();
Module module = new Module();
ILogger logger = mock.Object;
module.SetLogger(logger);
module.ThrowException("Catch me if you can");
mock.Verify( m => m.Log( "Catch me if you can" ) );
}

e) Spy – Spy is a variation of behavior verification. Instead of setting up behavior expectations, Spy records calls made to the collaborator. SUT then can later assert the recordings of Spy. Below is variation of Logger shown for Mock. Focus on this test is to count the number of times Log is invoked on Logger. It’s doesn’t care about the inputs passed to Log, it just records the Log calls and asserts them. Complex Spy objects can also leverage callback features of moq framework.

[TestMethod]
public void ModuleThrowExceptionInvokesLoggerOnlyOnce()
{
var spyLogger = new Mock<ILogger>();
Module module = new Module();
ILogger logger = spyLogger.Object;
module.SetLogger( logger );
module.ThrowException( "Catch me if you can" );
module.ThrowException( "Catch me if you can" );
spyLogger.Verify( m => m.Log( It.IsAny<string>()), Times.Exactly(2) );
}

The OCR Service to extract the Text Data

Optical character recognition, or OCR, is a key tool for people who want to build or collect text data. OCR uses machine learning to extract...