Deep Learning in Computer Vision

In recent years, Deep Learning has become a dominant Machine Learning tool for a wide variety of domains. One of its biggest successes has been in Computer Vision where the performance in problems such object and action recognition has been improved dramatically. In this course, we will be reading up on various Computer Vision problems, the state-of-the-art techniques involving different neural architectures and brainstorming about promising new directions.

Please sign up here in the beginning of class.

This class is a graduate seminar course in computer vision. The class will cover a diverse set of topics in Computer Vision and various Neural Network architectures. It will be an interactive course where we will discuss interesting topics on demand and latest research buzz. The goal of the class is to learn about different domains of vision, understand, identify and analyze the main challenges, what works and what doesn’t, as well as to identify interesting new directions for future research.

Prerequisites: Courses in computer vision and/or machine learning (e.g., CSC320, CSC420, CSC411) are highly recommended (otherwise you will need some additional reading), and basic programming skills are required for projects.

 back to top

  • Time and Location

    Winter 2016

    Day: Tuesday
    Time: 9am-11am
    Room: ES B149 (Earth Science Building at 5 Bancroft Avenue)

    Instructor

    Sanja Fidler

    Email: fidler@cs dot toronto dot edu
    Homepage: http://www.cs.toronto.edu/~fidler
    Office hours: by appointment (send email)

When emailing me, please put CSC2523 in the subject line.

Forum

This class uses piazza. On this webpage, we will post announcements and assignments. The students will also be able to post questions and discussions in a forum style manner, either to their instructors or to their peers.

 back to top

We will have an invited speaker for this course:

  • Raquel Urtasun
    Assistant Professor, University of Toronto
    Talk title: Deep Structured Models

as well as several invited lectures / tutorials:

  • Yuri Burda, Postdoctoral Fellow, University of Toronto:    Lecture on Variational Autoencoders
  • Ryan Kiros, PhD student, University of Toronto:    Lecture on Recurrent Neural Networks and Neural Language Models
  • Jimmy Ba, PhD student, University of Toronto:    Lecture on Neural Programming
  • Yukun Zhu, Msc student, University of Toronto:    Lecture on Convolutional Neural Networks
  • Elman Mansimov, Research Assistant, University of Toronto:    Lecture on Image Generation with Neural Networks
  • Emilio Parisotto, Msc student, University of Toronto:    Lecture on Deep Reinforcement Learning
  • Renjie Liao, PhD student, University of Toronto:    Lecture on Highway and Residual Networks
  • Urban Jezernik, PhD student, University of Ljubljana:    Lecture on Music Generation


Each student will need to write two paper reviews each week, present once or twice in class (depending on enrollment), participate in class discussions, and complete a project (done individually or in pairs).

 

The final grade will consist of the following
Participation (attendance, participation in discussions, reviews) 15%
Presentation (presentation of papers in class) 25%
Project (proposal, final report) 60%

 back to top

The first class will present a short overview of neural network architectures, however, the details will be covered when reading on particular topics. Readings will touch on a diverse set of topics in Computer Vision. The course will be interactive — we will add interesting topics on demand and latest research buzz.

 

 back to top

Date Topic Reading / Material Speaker Slides
Jan 12 Admin & Introduction(s) Sanja Fidler admin
Convolutional Neural Networks
Jan 19 Convolutional Neural Nets(tutorial) Resources: Stanford’s cs231 class, VGG’s Practical CNN Tutorial
Code: CNN Tutorial for TensorFlowTutorial for caffe, CNN Tutorial for Theano
Yukun Zhu
(invited)
[pdf]
Image Segmentation Semantic Image Segmentation with Deep Convolutional Nets and Fully Connected CRFs   [PDF] [code]
L-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy, A. L Yuille
Shenlong Wang [pdf]
[code]
Jan 26 Very Deep Networks Highway Networks  [PDF] [code]
Rupesh Kumar Srivastava, Klaus Greff, Jurgen Schmidhuber

Deep Residual Learning for Image Recognition  [PDF]
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun

Renjie Liao
(invited)
[pdf]
Object Detection Rich feature hierarchies for accurate object detection and semantic segmentation   [PDF] [code]
Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik

Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks   [PDF] [code (Matlab)] [code (Python)]
Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun

Kaustav Kundu [pdf]
Feb 2 Stereo
Siamese Networks
Stereo Matching by Training a Convolutional Neural Network to Compare Image Patches  [PDF] [code]
Jure Žbontar, Yann LeCun

Learning to Compare Image Patches via Convolutional Neural Networks  [PDF] [code]
Sergey Zagoruyko, Nikos Komodakis

Wenjie Luo [pdf]
Depth from Single Image Designing Deep Networks for Surface Normal Estimation   [PDF]
Xiaolong Wang, David Fouhey, Abhinav Gupta
Mian Wei [pptx]  [pdf]
Feb 9 Image Generation Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks   [PDF]
Alec Radford, Luke Metz, Soumith Chintala

Generating Images from Captions with Attention   [PDF]
Elman Mansimov, Emilio Parisotto, Jimmy Lei Ba, Ruslan Salakhutdinov

Elman Mansimov
(invited)
[pdf]
Domain Adaptation, Zero-shot Learning Simultaneous Deep Transfer Across Domains and Tasks   [PDF]
Eric Tzeng, Judy Hoffman, Trevor Darrell

Predicting Deep Zero-Shot Convolutional Neural Networks using Textual Descriptions   [PDF]
Jimmy Ba, Kevin Swersky, Sanja Fidler, Ruslan Salakhutdinov

Lluis Castrejon [pdf]
Recurrent Neural Networks
Feb 23 RNNs and Neural Language Models Unifying Visual-Semantic Embeddings with Multimodal Neural Language Models   [PDF] [code]
Ryan Kiros, Ruslan Salakhutdinov, Richard Zemel

Skip-Thought Vectors   [PDF] [code]
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun, Sanja Fidler

Jamie Kiros
(invited)
Mar 1 Modeling Words Efficient Estimation of Word Representations in Vector Space  [PDF] [code]
Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean
Eleni Triantafillou [pdf]
Describing Videos Sequence to Sequence -- Video to Text   [PDF]
Subhashini Venugopalan, Marcus Rohrbach, Jeff Donahue, Raymond Mooney, Trevor Darrell, Kate Saenko
Erin Grant [pdf]
Image-based QA Ask Your Neurons: A Neural-based Approach to Answering Questions about Images   [PDF]
Mateusz Malinowski, Marcus Rohrbach, Mario Fritz
Yunpeng Li [pdf]
Mar 8 Variational Autoencoders Auto-Encoding Variational Bayes   [PDF]
Diederik P Kingma, Max Welling

Tutorial: Bayesian Reasoning and Deep Learning   [PDF]
Shakir Mohamed

Yura Burda
(invited)
[pdf]
Text-based QA End-To-End Memory Networks   [PDF]
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, Rob Fergus
Marina Samuel [pdf]
Neural Reasoning Recursive Neural Networks Can Learn Logical Semantics   [PDF]
Samuel R. Bowman, Christopher Potts, Christopher D. Manning
Rodrigo Toro Icarte [pdf]
Mar 15 Neural Programming Neural GPUs Learn Algorithms   [PDF]
Lukasz Kaiser, Ilya Sutskever

Neural Programmer-Interpreters   [PDF]
Scott Reed, Nando de Freitas

Neural Programmer: Inducing Latent Programs with Gradient Descent   [PDF]
Arvind Neelakantan, Quoc V. Le, Ilya Sutskever

Jimmy Ba
(invited)
Conversation Models A Neural Conversational Model   [PDF]
Oriol Vinyals, Quoc Le
Caner Berkay Antmen [pdf]
Sentiment Analysis Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank   [PDF]
Richard Socher, Alex Perelygin, Jean Y. Wu, Jason Chuang, Christopher D. Manning, Andrew Y. Ng and Christopher Potts
Zhicong Lu [pdf]
Mar 22 Video Representations Unsupervised Learning of Video Representations using LSTMs  [PDF]
Nitish Srivastava, Elman Mansimov, Ruslan Salakhutdinov
Kamyar Ghasemipour [pdf]
CNN Visualization Explaining and Harnessing Adversarial Examples   [PDF]
Ian J. Goodfellow, Jonathon Shlens, Christian Szegedy
Neill Patterson [pdf]
Mar 29 Direction Following (Robotics) Listen, Attend, and Walk: Neural Mapping of Navigational Instructions to Action Sequences   [PDF]
Hongyuan Mei, Mohit Bansal, Matthew R. Walter
Alan Yusheng Wu [pdf]
Visual Attention Recurrent Models of Visual Attention   [PDF]
Volodymyr Mnih, Nicolas Heess, Alex Graves, Koray Kavukcuoglu
Matthew Shepherd [pdf]
Music A First Look at Music Composition using LSTM Recurrent Neural Networks   [PDF]
Douglas Eck, Jurgen Schmidhuber

Deep Karaoke: Extracting Vocals from Musical Mixtures Using a Convolutional Deep Neural Network   [PDF]
Andrew J.R. Simpson, Gerard Roma, Mark D. Plumbley

Charu Jaiswal [pdf]
Music generation Overview of music generation Urban Jezernik
(invited)
Pose and Attributes PANDA: Pose Aligned Networks for Deep Attribute Modeling  [PDF]
Ning Zhang, Manohar Paluri, Marc'Aurelio Ranzato, Trevor Darrell, Lubomir Bourdev
Sidharth Sahdev [pptx]
Image Style A Neural Algorithm of Artistic Style   [PDF]  [code]
Leon A. Gatys, Alexander S. Ecker, Matthias Bethge
Nancy Iskander [pdf]
Apr 5 Human gaze Where Are They Looking?   [PDF]
Adria Recasens, Aditya Khosla, Carl Vondrick, Antonio Torralba
Abraham Escalante [pdf]
Instance Segmentation Monocular Object Instance Segmentation and Depth Ordering with CNNs   [PDF]
Ziyu Zhang, Alex Schwing, Sanja Fidler, Raquel Urtasun

Instance-Level Segmentation with Deep Densely Connected MRFs  [PDF]
Ziyu Zhang, Sanja Fidler, Raquel Urtasun

Min Bai [pdf]
Scene Understanding Attend, Infer, Repeat: Fast Scene Understanding with Generative Models   [PDF]
S. M. Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, Koray Kavukcuoglu, Geoffrey E. Hinton
Namdar Homayounfar [pdf]
Reinforcement Learning Playing Atari with Deep Reinforcement Learning   [PDF]
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, Martin Riedmiller
Jonathan Chung [pdf]
Medical Imaging Classifying and Segmenting Microscopy Images Using Convolutional Multiple Instance Learning   [PDF]
Oren Z. Kraus, Lei Jimmy Ba, Brendan Frey
Alex Lu [pptx]
Humor We Are Humor Beings: Understanding and Predicting Visual Humor   [PDF]
Arjun Chandrasekaran, Ashwin K Vijayakumar, Stanislaw Antol, Mohit Bansal, Dhruv Batra, C. Lawrence Zitnick, Devi Parikh
Shuai Wang [pdf]

 back to top

Tutorials, related courses:

  •   Introduction to Neural Networks, CSC321 course at University of Toronto
  •   Course on Convolutional Neural Networks, CS231n course at Stanford University
  •   Course on Probabilistic Graphical Models, CSC412 course at University of Toronto, advanced machine learning course

 

Software:

  •   Caffe: Deep learning for image classification
  •   Tensorflow: Open Source Software Library for Machine Intelligence (good software for deep learning)
  •   Theano: Deep learning library
  •   mxnet: Deep Learning library
  •   Torch: Scientific computing framework with wide support for machine learning algorithms
  •   LIBSVM: A Library for Support Vector Machines (Matlab, Python)
  •   scikit: Machine learning in Python

 

Popular datasets:

  •   ImageNet: Large-scale object dataset
  •   Microsoft Coco: Large-scale image recognition, segmentation, and captioning dataset
  •   Mnist: handwritten digits
  •   PASCAL VOC: Object recognition dataset
  •   KITTI: Autonomous driving dataset
  •   NYUv2: Indoor RGB-D dataset
  •   LSUN: Large-scale Scene Understanding challenge
  •   VQA: Visual question answering dataset
  •   Madlibs: Visual Madlibs (question answering)
  •   Flickr30K: Image captioning dataset
  •   Flickr30K Entities: Flick30K with phrase-to-region correspondences
  •   MovieDescription: a dataset for automatic description of movie clips
  •   Action datasets: a list of action recognition datasets
  •   MPI Sintel Dataset: optical flow dataset
  •   BookCorpus: a corpus of 11,000 books

 

Online demos:

 

Main conferences:

  •   NIPS (Neural Information Processing Systems)
  •   ICML (International Conference on Machine Learning)
  •   ICLR (International Conference on Learning Representations)
  •   AISTATS (International Conference on Artificial Intelligence and Statistics)
  •   CVPR (IEEE Conference on Computer Vision and Pattern Recognition)
  •   ICCV (International Conference on Computer Vision)
  •   ECCV (European Conference on Computer Vision)
  •   ACL (Association for Computational Linguistics)
  •   EMNLP (Conference on Empirical Methods in Natural Language Processing)

 

Posted in Business Model, Problem solving, Technology | Leave a comment

Microkernel Architecture Pattern & Applying it to Software Systems

Architectural Patterns always been interesting from designer perspective. MVC, Pipe’n’filter, Layered,3-tier, n-tier, etc. But one very basic architectural concept coming from Civil engineers in practice.

‘’Have common building block with minimal facility as a base, with modular and customizable components to suit customers need will provide flexibility to whole town /architectural planning and also help to save cost for designer ’’

Same concept is employed in late 70s decade, in area of OS research. Idea was quite simple have very monolithic kernel to provide cross platform support. Below is Microkernel Architectural Style (or also a pattern) which represents the idea.

Microkernel

Description

The Microkernel architectural pattern applies to software systems that must be able to adapt to changing system requirements. It separates a minimal functional core from extended functionality and customer-specific parts. The microkernel also serves as a socket for plugging in these extensions and coordinating their collaboration

Context and Problem

The pattern may be applied in the context of complex software systems serving as a platform for other software applications. Such complex systems usually should be extensible and adaptable to emerging technologies, capable of coping with a range of standards and technologies. They also need to possess high performance and scalability qualities; as a result, low memory consumption and low processing demands are required. Taken together, the above requirements are difficult to achieve.

Solution, Consequences and Liabilities

The most important core services of the system should be encapsulated in a microkernel component. The microkernel maintains the system resources and allows other components to interact with each other as well as to access the functionality of the microkernel. It encapsulates a significant part of system-specific dependencies, such as hardware-dependent aspects. The size of the microkernel should be kept to a minimum, therefore, only part of the core functionality can be included in it; the rest of the core functionality is deferred to separate internal servers.

microkernel-architecture

Internal servers extend the functionalities of the microkernel. Internal servers can for example handle graphics and storage media. Internal servers can have their own processes or they can be shared Dynamic Link Libraries (DLL) loaded inside the kernel.
The external server provides a more complex functionality; they are built on top of the core services provided by the microkernel. Different external servers may be needed in the system in order to provide the functionality for specific application domains. These servers run in separate processes and employ the communication facilities provided by microkernel to receive requests from their clients and to return the results.
The role of the adapter is to provide a transparent interface for clients to communicate with external servers. Adapter hides the system dependencies such as communication facilities from the client. Adapter thus improves the scalability and changeability of the system. The adapter enables the servers and clients to be distributed over a network.

The benefits of the pattern can be mentioned like:

  1. Good portability, since only microkernel need to be modified when porting the system to a new environment.
  2. High flexibility and extensibility, as modifications or extensions can be done by modifying or extending internal servers.
  3. Separation of low-level mechanisms (provided by microkernel and internal servers) and higher-level policies (provided by external servers) improves maintainability and changeability of the system.

There are some concerns about it as well.

  1. The microkernel system requires much more inter-process communication inside one application execution because of the calls to internal and external servers.
  2. The design and implementation of the microkernel -based system is far more complex than of a monolithic system

Known Use

Symbian OS for mobile phones, has Microkernel as core architectural pattern. Symbian OS microkernel contains a scheduler, memory management, and device drivers, but other services like networking, telephony, or file system support are placed in the OS Services Layer or Base Services Layer.
iPhone OS kernel also has its roots derived from early implementation of Microkernel called ‘Mach’ by CMU in early 80’s which core of iPhone OS ‘ predecessors MacOS X and NEXTSTEP.
Below is illustrative example of Mickrokernel architecture from Hydra Operating System. Which is developed by CMU- Carnegie-Mellon University . Purpose was to provide very basic monolithic kernel excluding drives as well. Schematic diagram itself is descriptive.

hydra-os-overview-diagram

Recent Development

Microsoft’s next generation experimental operating system in research code name ‘Singularity’has adopting concept of ‘Microkernel’. More details about concept if you are interested then can be found here

singulatiry-architecture

http://viralpatel.net/blogs/microkernel-architecture-pattern-apply-software-systems/

Posted in ASP.NET MVC, Integration, Programming, Software architecture, Technology | Leave a comment

What’s the difference between Architectural Patterns and Architectural Styles?

An Architectural Pattern is a way of solving a recurring architectural problem. MVC, for instance, solves the problem of separating the UI from the model. Sensor-Controller-Actuator, is a pattern that will help you with the problem of actuating in face of several input senses.

An Architectural Style, on the other hand, is just a name given to a recurrent architectural design. Contrary to a pattern, it doesn’t exist to “solve” a problem.

Pipe&filter doesn’t solve any specific problem, it’s just a way of organizing your code. Client/server, Main program & subroutine and Abstract Data Types / OO, the same.

Also, a single architecture can contain several architectural styles, and each architectural style can make use of several architectural patterns.

 

Frankly, i have always considered both these terms to be synonymous! And layman (relatively speaking) literature definitely treats them as such. Refer MSDN or Wikipedia

However, your question intrigued me a bit so i did a bit more digging and frankly…i couldnt find much except for a reference to A Practical Guide to Enterprise Architecture (The Coad Series), from which i quote :-

An architectural style (Base et al. 1997) and an architectural pattern 
(Buschmann et al. 1996) are essentially synonymous. 

Based on some more googling, this is what i think might be one possible way to differentiate the two

  • An architectural style is a conceptual way of how the system will be created / will work
  • An architectural pattern describes a solution for implementing a style at the level of subsystems or modules and their relationships.

How an architectural pattern will differ from a Design pattern i.e Adapter, observer is basically by the level of Granularity at which they are applied (I know this isnt part of the question but its related, i think)

Source:

https://stackoverflow.com/questions/3958316/whats-the-difference-between-architectural-patterns-and-architectural-styles

Posted in Business Model, C#, Problem solving, Software architecture, Technology, Uncategorized | Leave a comment

AWS Certified Solutions Architect

AWS Certified Solutions Architect – Associate Level dành cho cá nhân đang hoặc muốn làm việc như 1 Solution Architect. Chứng chỉ này xác nhận khả năng của thí sinh để:

  • Xác định và thu thập các yêu cầu để đề ra giải pháp dựa trên hiểu biết và các kỹ năng tốt nhất̀ về kiến trúc.
  • Có khả năng cung cấp các hướng dẫn tốt nhất về kiến trúc cho người phát triển và người quản trị hệ thống trong suốt vòng đời của dự án.

Các kiến thức và kỹ năng cần thiết ở cấp độ này bao gồm các lĩnh vực dưới đây. Mức độ kiến thức được định nghĩa phải có các thành phần chính sau đây:

Kiến thức về AWS

  • Kinh nghiệm thực tiễn với dịch vụ compute, networking, storage, và database AWS.
  • Kinh nghiệm chuyên môn về kiến trúc các hệ thống phân tán quy mô lớn.
  • Hiểu biết về các khái niệm Elasticity và Scalability.
  • Hiểu biết về các công nghệ mạng có liên quan đến AWS.
  • Hiểu biết tốt về tất cả các tính năng và công cụ bảo mật mà AWS cung cấp và mối quan hệ với các dịch vụ truyền thống.
  • Hiệu biết rất vững về cách tương tác với AWS (AWS SDK, AWS API, Command Line Interface, AWS CloudFormation).
  • Kinh nghiệm thực tiễn với các dịch vụ triển khai và quản lý của AWS.

Kiến thức về IT

  • Hiểu biết rất tốt về kiến trúc nhiều tầng (multi-tier): web servers (Apache, Nginx, IIS), caching, application servers, load balancers.
  • RDBMS (MySQL, Oracle, SQL Server), NoSQL
  • Kiến thức về hàng đợi thông điệp (message queuing) và Enterprise Service Bus (EBS).
  • Quen thuộc với loose coupling và stateless systems.
  • Hiểu biết về các mô hình nhất quán (consistency model) khác nhau trong các hệ thống phân tán.
  • Có kinh nghiệm với CDN và các khái niệm về hiệu suất (performance).
  • Kinh nghiệm về mạng với route tables, access control lists, firewalls, NAT, HTTP, DNS, IP và mạng OSI.
  • Kiến thức về RESTful Web Service, XML, JSON.
  • Quen thuộc với vòng đời phát triển phần mềm.
  • Kinh nghiệm làm việc với bảo mật thông tin và ứng dụng bao gồm mã hóa với khóa công khai, SSH, access credentials, và X.509 certificates.

Các khóa đào tạo hoặc các phương pháp tương đương khác sẽ hỗ trợ nhiều cho việc chuẩn bị kỳ thi:

  • Architecting on AWS (aws.amazon.com/training/architect)
  • Kiến thức hoặc đào tạo chuyên sâu về ít nhất 1 ngôn ngữ lập trình cấp cao.
  • AWS Cloud Computing Whitepapers (aws.amazon.com/whitepapers)
    • Tổng quan về Amazon Web Services
    • Tổng quan về Security Processes
    • AWS Risk & Compliance Whitepaper
    • Storage Options in the Cloud
    • Architecting for the AWS Cloud: Best Practices
  • Kinh nghiệm triển khai các hệ thống lai (hybrid) với on-premise và các thành phần AWS.
  • Dùng website của AWS Architecture Center (aws.amazon.com/architecture)

Chú y

    ́: Bảng kế hoạch này bao gồm các phần nội dung quan trọng, mục tiêu thử nghiệm, và các nội dung ví dụ. Các chủ đề và khái niệm ví dụ chỉ nhằm để làm rõ các mục tiêu thử nghiệm; chúng không nên được hiểu như là 1 danh sách toàn diện của tất cả các nội dung trong kỳ thi này.
    Bảng dưới đây liệt kê tỷ lệ của từng lĩnh vực kiến thức trong kỳ thi.
Domain % of Examination
1.0 Designing highly available, cost effective, fault tolerant, scalable systems 60%
2.0 Implementation/Deployment 10%
3.0 Data Security 20%
4.0 Troubleshooting 10%
TOTAL 100%

Các giới hạn trả lời

Thí sinh lựa chọn từ bốn (4) hoặc nhiều hơn các tùy chọn trả lời mà cho là tốt nhất để hoàn thành câu hỏi. Bỏ qua hoặc trả lời sai xem như là chưa hoàn thành kiến thức hoặc kỹ năng cần thiết.

Dạng thức thi được sử dùng là:

  • Multiple-choice: thí sinh chọn 1 lựa chọn tốt nhất để trả lời cho câu hỏi hoặc câu khẳng định. Các tùy chọn có thể được nhúng vào hình đồ họa để thí sinh có thể “points and clicks”.
  • Multiple-response: thí sinh chọn nhiều hơn 1 lựa chọn để trả lời cho cẩu hỏi hoặc câu khẳng định.
  • Sample Directions: đọc câu hỏi hoặc câu khẳng định và từ các tùy chọn trả lời, chỉ chọn 1 đáp án đại diện cho câu trả lời tốt nhất.

Các giới hạn nội dung

1.     Domain 1.0: Designing highly available, cost efficient, fault tolerant, scalable systems

1.1   Xác định và nhận xét kiến trúc điện toán đám mây, như các thành phần cơ bản và các thiết kế hiệu quả.

Nội dung bao gồm:

  • Cách thiết kế các dịch vụ cloud
  • Lập kế hoạch và thiết kế
  • Giám sát
  • Quen thuộc với:
  • Best practices
  • Phát triển Client Specifications gồm pricing/cost (e.g. on Demand vs. Reserved vs. Spot, RTO and RPO DR Design)
  • Các quyết định kiến trúc (high availability vs. cost, Amazon Relational Databas Service (RDS) vs. cài đặt CSDL của riêng bạn trên Amazon Elastic Compute Cloud (EC2)).
  • Tích hợp với các môi trường phát triển hiện có và xây dựng kiến trúc có khả năng mở rộng.
  • Elasticity và scalability.

2.     Domain 2.0: Implementation/Deployment

2.1   Xác định các kỹ thuật và phương pháp thích hợp dùng Amazon EC2, Amazon S3, Elastic Beanstalk, CloudFormation, Amazon Virtual Private Cloud (VPC), và AWS Identity and Access Management (IAM) để viết mã và cài đặt 1 giải pháp cloud.

Nội dung bao gồm:

  • Cấu hình Amazon Machine Image (AMI)
  • Vận hành và mở rộng dịch vụ quản lý trong private cloud
  • Cấu hình hợp lý trong private và public cloud
  • Khởi chạy các instances trong nhiều geographical regions.

3.     Domain 3.0: Data Security

3.1   Nhận diện và cài đặt các thủ tục bảo vệ cho việc triển khai và duy trì cloud được tối ưu

Nội dung bao gồm:

  • Cloud Security Best Practices
    • Cách xây dựng và dùng threat model
    • Cách xây dựng và dùng data flow diagram để quản lý rủi ro (risk management)
      • Use cases
      • Abuse Cases (Negative use cases)
  • Security Architecture with AWS
    • Shared Security Responsibility Model
    • AWS Platform Compliance
    • AWS security attributes (customer workloads down to physical layer)
    • Security Services
    • AWS Identity and Access Management (IAM)
    • Amazon Virtual Private Cloud (VPC)
    • CIA và AAA models, ingress vs. egress filtering, and which AWS services and features fit
    • “Core” Amazon EC2 and S3 security feature sets
    • Incorporating common conventional security products (Firewall, IDS:HIDS/NIDS, SIEM, VPN)
    • Design Pattern
    • DDOS mitigation
    • Encryption solutions
    • Complex access controls (building sophisticated security groups, ACLs, etc.)
    • Amazon CloudWatch for the security architect

3.2   Nhận diện các kỹ thuật khắc phục thảm họa nguy hiểm và cách cài đặt chúng

Nội dung bao gồm:

  • Disaster Recovery
    • Recovery time objective
    • Recovery point objective
    • Amazon Elastic Block Store
  • AWS Import/Export
  • AWS Storage Gateway
  • Amazon Route53
  • Testing the recovered data

4.     Domain 4.0: Troubleshooting

Nội dung bao gồm:

  • Xử lý sự cố về các thông tin và câu hỏi nói chung

http://awslagi.com/noi-dung-thi-aws/

Posted in Integration, Java, Software architecture | Leave a comment

Solution architecture: Dev-Test deployment for testing microservice solutions

This architecture represents how to configure your infrastructure for development and testing of a microservices-based system.

This solution is built on the Azure managed services: Visual Studio Team Services, Service Fabric and SQL Database. These services run in a high-availability environment, patched and supported, allowing you to focus on your solution instead of the environment they run in.

Dev-Test deployment for testing microservice solutionsA diagram showing the solution architecture of a dev-test deployment for testing microservice solutions, built on the Azure managed services Visual Studio Team Services, Service Fabric, and SQL Database.ARM Infrastructure andService Fabric Code DeploymentS1S2S3S1S2S3S1S2S1S2S1S2S1S2S3Visual StudioTeam ServicesBuild andRelease AgentDevelopment Resource GroupQA Resource GroupProd Resource GroupDevelopmentDatabaseQADatabaseProductionDatabaseDevelopment Host 1QA Host 1QA Host 2QA Host 2Production Host 1

Implementation guidance

Products Documentation

Visual Studio Team Services

Visual Studio Team Services manage the development process.

Microsoft Release Management

The Microsoft Release Management build and release agents deploy the Azure Resource Manager template and associated code to the various environments.

Visual Studio Team Services resource groups

Visual Studio Team Services resource groups are used to define all the services required to deploy the solution into a dev-test or production environment.

Service Fabric

Service Fabric orchestrates all of the microservices used in the solution. In development, code is deployed directly from the development tools, while in test and production environments the code is deployed through the build and release agent using Resource Manager templates.

SQL Database

Azure SQL Database maintains data for the website. Copies are deployed in the dev, test, and production environments.
Posted in ASP.NET MVC, C#, Education and Training, Software architecture | Leave a comment

STARTING AND STOPPING EC2 INSTANCES USING A LAMBDA

From http://blog.conygre.com/2016/11/18/starting-and-stopping-ec2-instances-using-a-lambda-and-cut-your-aws-bill-in-half/

CUTTING YOUR AWS EC2 BILL WITH LAMBDA FUNCTIONS

When running a large training program for an investment bank, we needed over 30 EC2 instances, but only between certain hours of the day. This simple Lambda Function, cut our AWS bill by around 65% on the normal cost of running those instances all day every day.

As a CTO and Cofounder of a food delivery business, I was able to cut our AWS bill substantially by running our servers in the evening when deliveries were taking place. Again, a simple Lambda function could cut the bill as we would no longer be running them all the time.

How many of your servers are really needed all the time? If you want to shave your AWS bill, then Lambda’s make it easy to schedule the starting and stopping of your instances.

HOW TO CREATE THE LAMBDA FUNCTION

PART 1 CREATE THE IAM ROLE WITH PERMISSION TO ACCESS EC2

Any Lambda expression will run with a set of permissions. Those permissions are configured as an IAM role. If you don’t have an IAM role already with permission to access EC2 you will need to create one first.

  1. In the AWS Administration Console, visit the IAM service.
  2. In the left pane of the IAM service, click Roles.
  3. Then click, Create New Role.
  4. At the Set Role Name dialog, enter a name, something like Ec2AccessRole.
  5. At the Select Role Type dialog, click Select by the EC2 Role option.
  6. You are now presented with a list of policies. Locate and select the EC2FullAccess and click Next Step.
  7. At the Review screen, click Create Role.

PART 2 CREATE THE LAMBDA FUNCTION

  1. In the AWS Administration Console, visit the Lambda service.
  2. Click the Create new Lambda Function button.
  3. At the Select Blueprint dialog, select the first option Blank Function.
  4. At the Configure Triggers dialog, click the grey checked box and at the drop down, select CloudWatch Events Schedule.
  5. In the Configure Triggers form, enter a suitable name for your trigger, something like: StartServersAt8AM
  6. In the Configure Triggers form, enter a suitable description, something like: Start instances at 8am.
  7. In the Configure Triggers form, enter a Schedule Expression. These are in the form of Cron, which is a scheduling command found on Unix boxes. It has a standard format for times and dates which is used by AWS. So for example,  to start at 8AM Monday to Friday the expression would be: cron(00 08 ? * MON-FRI *). An excellent utility to help you can be found here: http://www.cronmaker.com/. This simple Web site will give you the required cron expression for the time you require.  IMPORTANT: Note that the time must be in UTC!
  8. Check the Enable trigger checkbox and click Next.

PART 3 CREATE THE CODE FOR THE FUNCTION

Now you will need to set up the actual Function itself to start the servers. This will be written in Python.

  1. At the Configure Function dialog, enter a name, something like startMyServers.
  2. At the Configure Function dialog, enter a description, something like Start the servers.
  3. At the Configure Function dialog, set the Runtime to Python.
  4. In the code box below, enter the following code. In our example, we are setting it to start servers with a specific Tag on them. You could change this to be anything you like. Some way of identifying the servers you wish to start and stop.

import boto3
import logging

ec2 = boto3.resource('ec2')

def lambda_handler(event, context):

    filters = [{
            'Name': 'tag:Role', // you might change this tag name. Our servers had a tag called Role
            'Values': ['MyRoleTagValue'] // this was the value of the tag called Role. You can change this also. Just make sure you add the Tag called Role to your own instances
        },
        {
            'Name': 'instance-state-name', 
            'Values': ['stopped']
        }
    ]
    
    instances = ec2.instances.filter(Filters=filters)
    
    stoppedInstances = [instance.id for instance in instances]
    
    
    if len(stoppedInstances) > 0:
        startingUp = ec2.instances.filter(InstanceIds=stoppedInstances).start()
    
  1. In the Lambda function handler and role section, select Choose an Existing Role.
  2. In the drop down that appears, select the role created in Part 1. We suggested the name of Ec2AccessRole.
  3. The remaining fields can be left as they are. Click Next.
  4. At the Review dialog, click Create Function.

That’s it! You’re done. To create one that stops the servers, the process is pretty much the same. Create another Lambda, but just change the code slightly to check for started instances, and then call stop() on them instead of start. A simple example of the code is below.


import boto3
ec2 = boto3.resource('ec2')

def lambda_handler(event, context):
    filters = [{
            'Name': 'tag:MyTag',
            'Values': ['MyTagValue']
        },
        {
            'Name': 'instance-state-name', 
            'Values': ['running']
        }
    ]
    
    instances = ec2.instances.filter(Filters=filters)

    runningInstances = [instance.id for instance in instances]
    
    if len(runningInstances) > 0:
        shuttingDown = ec2.instances.filter(InstanceIds=runningInstances).stop()

 

Posted in Business Model, Knowledge, Programming, Software architecture | Leave a comment

Running Serverless ASP.NET Core Web APIs with Amazon Lambda

https://aws.amazon.com/blogs/developer/running-serverless-asp-net-core-web-apis-with-amazon-lambda/

One of the coolest things we demoed at our recent AWS re:Invent talk about .NET Core support for AWS Lambda was how to run an ASP.NET Core Web API with Lambda. We did this with the NuGet package Amazon.Lambda.AspNetCoreServer (which is currently in preview) and Amazon API Gateway. Today we’ve released a new AWS Serverless blueprint that you’ll see in Visual Studio or with our Yeoman generator that makes it easy to set up an ASP.NET Core Web API project as a Lambda project.

Blueprint Picker

How Does It Work?

Depending on your platform, a typically deployed ASP.NET Core application is fronted by either IIS or NGINX, which forwards requests to the ASP.NET Core web server named Kestrel. Kestrel marshals the request into the ASP.NET Core hosting framework.

Normal Flow

When running an ASP.NET Core application as an AWS Serverless application, IIS is replaced with API Gateway and Kestrel is replaced with a Lambda function contained in the Amazon.Lambda.AspNetCoreServer package which marshals the request into the ASP.NET Core hosting framework.

Serverless Flow

The Blueprint

The blueprint creates a project that’s very similar to the one you would get if you selected the .NET Core ASP.NET Core Web Application and chose the Web API template. The key difference is instead of having a Program.cs file that contains a Main function bootstrapping the ASP.NET Core framework, the blueprint has LambdaEntryPoint.cs that bootstraps the ASP.NET Core framework.

C#

public class LambdaEntryPoint : Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction
{
    protected override void Init(IWebHostBuilder builder)
    {
        builder
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseStartup()
            .UseApiGateway();
    }
}

The actual Lambda function comes from the base class. The function handler for the Lambda function is set in the AWS CloudFormation template named serverless.template, which will be in the format <assembly-name>::<namespace>.LambdaEntryPoint::FunctionHandlerAsync.

The blueprint also has LocalEntryPoint.cs that works in the same way as the original Program.cs file, enabling you to run and develop your application locally and then deploy it to Lambda.

The remainder of the project’s files are the usual ones you would find in an ASP.NET Core application. The blueprint contains two Web API controllers. The first is the example ValuesController, which is found in the starter ASP.NET Core Web API project. The other controller is S3ProxyController, which demonstrates how to use HTTP GET, PUT, and DELETE requests to a controller and uses the AWS SDK for .NET to make the calls to an Amazon S3 bucket. The name of the S3 bucket to use is obtained from the Configuration object, which means you can set the bucket in the appsettings.json file for local development.

JavaScript

{
  ...

  "AppS3Bucket": "ExampleBucketName"
}

The Configuration object is built by using environment variables.

C#

public Startup(IHostingEnvironment env)
{
    var builder = new ConfigurationBuilder()
        .SetBasePath(env.ContentRootPath)
        .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
        .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

    builder.AddEnvironmentVariables();
    Configuration = builder.Build();
}

When the application is deployed, serverless.template is used to create the bucket and then pass the bucket’s name to the Lambda function as an environment variable.

JavaScript

...

"Get" : {
  "Type" : "AWS::Serverless::Function",
  "Properties": {
    "Handler": "AspNetCoreWithLambda::AspNetCoreWithLambda.LambdaEntryPoint::FunctionHandlerAsync",
    "Runtime": "dotnetcore1.0",
    "CodeUri": "",
    "MemorySize": 256,
    "Timeout": 30,
    "Role": null,
    "Policies": [ "AWSLambdaFullAccess" ],
    "Environment" : {
      "Variables" : {
        "AppS3Bucket" : { "Fn::If" : ["CreateS3Bucket", {"Ref":"Bucket"}, { "Ref" : "BucketName" } ] }
      }
    },
    "Events": {
      "PutResource": {
        "Type": "Api",
        "Properties": {
          "Path": "/{proxy+}",
          "Method": "ANY"
        }
      }
    }
  }
},

...

Logging

ASP.NET Core introduced a new logging framework. To help integrate with the logging framework, we’ve also released the NuGet package Amazon.Lambda.Logging.AspNetCore. This logging provider allows any code that uses the ILogger interface to record log messages to the associated Amazon CloudWatch log group for the Lambda function. When used outside of a Lambda function, the log messages are written to the console.

The blueprint enables the provider in Startup.cs, where other services are configured.

JavaScript

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    loggerFactory.AddLambdaLogger(Configuration.GetLambdaLoggerOptions());
    app.UseMvc();
}

This following snippet shows the call GetLambdaLoggerOptions from the Configuration object, which grabs the configuration of what messages to write to CloudWatch Logs. The appsettings.json file in the blueprint configures logging so that messages coming from classes under the Microsoft namespace are written if they’re informational level and above. For all other log messages, write debug level messages and above.

JavaScript

{
  "Lambda.Logging": {
    "LogLevel": {
      "Default": "Debug",
      "Microsoft": "Information"
    }
  },

  ...
}

For more information about this package, see the GitHub repository.

Deployment

Deploying the ASP.NET Core Web API works exactly as we showed you in the previous post about the AWS Serverless projects.

Deploy from Solution Explorer

Once deployed, a single Lambda function and an API Gateway REST API are configured to send all requests to the Lambda function. Then the Lambda function uses the ASP.NET Core framework to route to the correct Web API controller. You can test the deployment by accessing the two controllers using the AWS Serverless URL found in the CloudFormation stack view.

  • <aws-serverless-url>/api/values – Example controller
  • <aws-serverless-url>/api/s3proxy – S3 Proxy controller.

Feedback

We’re very excited about running ASP.NET Core applications on AWS Lambda. As you can imagine, the option of running the ASP.NET Core framework on top of Lambda opens lots of possibilities. The Amazon.Lambda.AspNetCoreServer package is in preview while we explore those possibilities. I highly encourage .NET developers to check out this blueprint and the Amazon.Lambda.AspNetCoreServer package and let us know on our GitHub repository or our new Gitter channel what you think and how we can continue to improve the library.

Posted in C#, Problem solving, Programming, Software architecture | Leave a comment