Monthly Archives: June 2016

AWS CODEDEPLOY

AWS CodeDeploy
(Automated Software Deployment)

AWS CodeDeploy

AWS CodeDeploy is a part of AWS deployment services which includes AWS Elastic Beanstalk, AWS CodePipeline, AWS CloudFormation, and AWS OpsWorks. AWS CodeDeploy combines application deployments to Amazon EC2 instances, on-premises instances or both.

An application may contain deployable content like code, web, configuration files, executables, packages, scripts and much more.

LET’S SEE THE BENEFITS OF AWS CODEDEPLOY

Automated Deployments: AWS CodeDeploy robotizes your application deployments throughout your development, test, and production environments. AWS CodeDeploy scales with your infrastructure so that you can deploy one instance or thousands at a time.

Reduces the downtime: AWS CodeDeploy helps you in maximizing your application availability by performing rolling updates across your Amazon EC2 instances and track the application according to the rules you have configured. A developer can stop and roll back the deployments if there are any errors.

Centralized Control: A developer can launch and track the status of your deployments through the AWS CodeDeploy console. You will receive a report that lists, when each application revision has to be deployed and to which Amazon EC2 instances.

Easy to adopt: AWS CodeDeploy works with any platform and with any application. You can easily reuse your set-up code. AWS CodeDeploy can also be integrated with your software release process or Continuous delivery tool chain.

THE OVERVIEW OF DEPLOYMENT

  • Firstly, a developer has to create a deployable content such as web pages, executable files, and setup scripts on a local development machine or similar environment. Then add an application specification file (AppSpec file).

Benefits of AWS Codedeploy

AppSpec file is a unique file to Aws CodeDeploy. It defines the deployment actions which you wanted to execute. Then a developer assorts the deployable content and the AppSpec file into an archive file, and uploads it to an Amazon S3 bucket or a GitHub repository. This archive file is called an application revision.

  • A developer provides AWS CodeDeploy with the information about the deployment, such as, which Amazon S3 bucket or GitHub repository to pull for the revision and which set of Amazon EC2 instances to be used to deploy its content. AWS CodeDeploy calls a set of Amazon EC2 instances which is called as deployment group.
  • The AWS CodeDeploy agents on each instance polls to determine what and when has to be pulled for the revision from the specified Amazon S3 bucket or Github repository.
  • Lastly, the AWS CodeDeploy agent on each instance pulls the target revision from the specified Amazon S3 bucket, using the instructions which are given in the AppSpec file and deploys the contents of the instance.

AWS CodeDeploy keeps a record of your deployments so that, you can get the information such as deployment status, deployment configuration and much more whenever you want.

LATEST DEVELOPMENTS IN SWIFT PROGRAMMING

Latest Developments in Swift Programming

In our previous articles, we have explained, what Swift programming is, it’s features, and also the difference between Swift and Objective-C. We know the technology is growing at a faster rate, the developments are done at an exponential rate. In this article, we are going to talk about the latest developments in Swift programming language.

We know Swift 2.2 is almost here. It cleans up a number of quirks and added some missing features. So let us talk about the major and the minor changes in Swift so that you can run straight away to it.

Latest Developments in Swift Programming

THE DEVELOPMENTS IN SWIFT PROGRAMMING
++ and – – are deprecated
Swift 2.2 deprecates the ++ and – – operators, which means they still work but a user gets a warning message when he uses them. Deprecation is done for the first time towards removing something entirely, in this case, both of these operators will be removed in Swift 3.0.
In the place of ++ and –, a user needs to use += 1 and -= 1.

You might wonder why two long-standing operators has been removed, when they exist in C, C#, Java, and C++. There are several reasons for this question, but let’s see the major reasons for its removal.

* Writing ++ rather than += 1 is more time saving.
* ++ doesn’t have an obvious meaning to the people who are learning Swift, whereas += at least reads as “add and assign”.

Traditional C-style loops are deprecated

Loops like below will soon be removed from Swift.
for var i = 1; i <= 10; i += 1 {
print(“\(i) green bottles”)
}

These are called C-style loops. They have been from a very long time in languages like C. Although, Swift is a C-like language, it has a number of newer and smarter alternatives to replace this traditional loops.

To replace this traditional loops a user can use any one of the many alternatives. For instance, the above-written code can also be re-written to loop over a range, like this:

var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for number in array {
print(“\(number) green bottles”)

Arrays and slice types now have removeFirst()

The removeLast() has been always helpful while working with arrays. Now we have the missing counterpart to remove the items from the beginning of the array. Swift 2.2 has introduced the new feature removeFirst() method. This removes the first element in an array and returns it to the user.

Renamed debug identifiers: #line, #function, and #file

Swift 2.1 earlier was using “snake case” symbols __File__, __Line__, __Column__, and __Function__, which automatically gets replaced by the compiler as the File name, Line number, Column number, and Function name when they appear.

Swift 2.1 earlier was using “snake case” symbols __File__, __Line__, __Column__, and __Function__, which automatically gets replaced by the compiler as the File name, Line number, Column number, and Function name when they appear.

VAR PARAMETERS HAVE BEEN DEPRECATED

Another deprecation in the list is, var parameters are deprecated because they offer only minimal usefulness.

func printGreeting(var name: String, repeat repeatCount: Int) {
name = name.uppercaseString
for _ in 0 ..< repeatCount {
print(name)
}
}
printGreeting(“Taylor”, repeat: 5)

Now the difference is, the name is now var name and name gets converted to uppercase so that “TAYLOR” will be printed out for five times.

Without the var keyword, the name would have been constant and the upper string line would be failed.

Developments in Swift Programming

TOP 3 MOBILE WEB TESTING TOOLS

Top 3 mobile web testing tools

Mobile applications are becoming more and more important for businesses and consumers who are expecting higher quality applications for mobile devices. You have many tools to create your website as you visualize it, it also became essential that you first test your website thoroughly before sending it live on mobile. The major problem here is that you are dealing with far too many mobile devices and mobile OS and hence, testing your website on each of these devices would turn out to be very onerous and expensive. In order to make your task simpler, there are some useful tools available to help you and ensure that your mobile is absolutely mobile-friendly.
top_3_mobile_web_testing_tools

Here we bring you a list of top 3 tools for testing your website intended to go live on mobile devices:

Google Mobilizer

The constant presence of the mobile phone puts a greater demand on mobile site’s availability and performance. But, as the adoption of the mobile web increases, device propagation, conflicting standards, and limited tools make developing and delivering quality mobile experiences, a challenge for many organizations.

The “Gomez mobile readiness test” is designed to help the organizations to quickly assess their site’s mobile readiness so that they can troubleshoot and improve it.

Just by entering the URL, the Gomez mobile readiness test returns a score between one to five which indicates how well the site complies with mobile web industry standards like W3C’s MobileOK checker. It also provides analysis of the website’s page weight and detailed test report from 30 proven mobile web practices. The Gomez platform identifies business impacting issues by testing and measuring Web applications from the “outside-in” across all users, browsers, devices, and geographies using a global network of over 10,000 locations.

Worldwide 2,500 customers ranging from small to large organizations are using Gomez to increase revenue, build brand loyalty, and decrease costs.

iPhoney

Are you looking for a way to see how your web creations look in iPhone? Then don’t look further, because iPoney gives you a pixel-accurate web browsing environment powered by Safari which you can use while developing web sites for iPhone. It is the perfect 320 by 480-pixel canvas for your iPhone development. Also, it is free of cost.

iPhoney is not an iPhone simulator, but it is designed for web developers who want to create 320 by 480-pixel websites for iPhone.

There are new added features to iphoney 1.2 and it is still open source. What so new in iphoney 1.2?

* View source to see the source code for the webpage you are viewing. It is great for checking iPhone targeted pages.

* Localized for Norwegian, French, and German users.

W3C MobileOK Checker

The World Wide Web Consortium announced the availability of W3C mobileOK checker. It is a free service that performs various tests on a web page to help the developer to determine its level of mobile-friendliness.

MobileOK checker builds on the suite of quality assurance tools already offered by W3C and “it does a nice job by helping the developers to improve their content one step at a time”.
To help and ensure the best user experience across a wide variety of mobile devices, the Mobile Web Best Practices Working Group defined a set of guidelines to follow while creating the web documents.
From there, the working group determined which tests could be automated while creating the mobileOK checker.

Some of the recommendations offered by mobileOK checker includes:

* XHTML Basic 1.1 for mark-up format.
* Images should be small and it should be in the form of GIF or JPEG.
* The whitespace and comments should be removed by adding the cleaning step in the publication process.
* The page size should be under 20KB and the mark-up should be under 10KB.
* If you are using scripts, ensure that scripting support is not required.
* Do not use frames, pop-up’s or applets.
The W3C mobileOK checker is definitely a good place to make your site more mobile friendly.

IS NODE.JS REPLACING JAVA MIDDLEWARE SERVICES?

Is Node.js replacing Java middleware services?

In the history of computing, first in 1995, Java has come into existence, then close on its heels came JavaScript. The names made them seem like adjoined twins which are newly detached, but they are not different. One of them are compiled and statically typed and the other interpreted and dynamically typed. That is only at the beginning of the technical differences between these two fiercely distinct languages after that, it has been shifted on to a collision course of sorts, thanks to Node.js.

The Node.js was spawned, turning the developer’s heads with its speed. Not only it is faster than the JavaScript on the server but it was often faster than Java and other options. It’s small, quick, and endless requests for data have made Node.js more common, as web pages have grown more dynamic.

Node’s event-driven concurrency

Node is scalable, event-driven I/O environment built on top of Google’s V8 JavaScript engine. Google V8 complies JavaScript into the native machine code prior to execution, resulting in extremely fast runtime performance, something is not typically associated with JavaScript. As such, Node.js enables a developer to rapidly build the network apps which are lightning fast and highly concurrent.

Event-driven I/O might sound foreign to a Java developer, but it is not all that new. Rather than the multithreaded programming model which a developer was using in Java platform. Node’s approach to concurrency is single threaded, with the additional kick of an event loop. The Node construct enables non-blocking or asynchronous I/O.

Concurrency really works in Node.js. If suppose you wanted to run the previous scenario on the Java platform, then you would have the choice of complex and time-consuming approaches like from traditional threads to newer libraries in Java NIO. The Java concurrency is powerful and it is difficult to understand. By comparison, Node’s concurrency model is extremely simple, and that makes it accessible to a wider number of developers.

Node.js is ready for enterprise deployment

Node.js appeals to a wide range of the tech community because, it has a reputation for well scaling, being secure, and easy to learn. It’s not hard for a developer to pick-up Node.js and can quickly become productive with it. There are many well-known organizations like PayPal, LinkedIn, Netflix, and The New York Times using Node.js in production.

If you are building your next generation applications especially like API’s for mobile and web integration in IOT or if you are creating something very new that depends on those underlying services, then Node.js is a runtime system that could work for you very well.

Frameworks: We all know Java is all about open source frameworks. That is the main reason for its popularity. Whereas Node is much newer, many people have already done quite a bit of heavy lifting and have shared their code with the world. Below are some of the Node.js frameworks which are equivalently good for mapping the popular Java frameworks.

Web MVC: In the land of Java many people are familiar with Web MVC frameworks like Spring MVC, Struts, Wicket, and JSF. Nevertheless, a good comparable Node.js web framework is Express.js, Meteor.js, Sails.js, Derby, and SocketStream. Many of the developers go with Sails.js due to its permissive license, robust community, and flexibility. In other sense, it is even more than a web framework because it also provides most of the “web server” functionality where most of the Java developers use Tomcat, Jetty etc.

  • Rapid and agile development: With Sails.js it is very easy and quick to get stuff and can used prototype. You can iterate more quickly. It is easy to view and test changes needed which is not possible in the case of Java.
  • Package management tools: Maven is the most popular build management tool for Java. It is very flexible and powerful with a wide variety of plug-ins. NPM is the mainstream package manager for Node.js. It is light, faster and useful.

The Below is the sample code for Node.JS and Java:

Code for Node.JS and Java
Final Word

There are many number of factors to be considered when you are choosing a platform for your enterprise applications or for customers. When any presence has debated the adoption of Java or Node.js for your enterprise development platform, the decision is not that obvious or cannot be made overnight. In the end, the scalability, speed, and enterprise readiness are to be considered while choosing a platform.

AWS CLOUDWATCH VS NAGIOS

AWS CloudWatch Vs Nagios

Nagios is an open-source network monitoring software that monitors systems, networks, and infrastructure. Nagios is designed with the scalability and flexibility in mind. The main aim of Nagios is to monitor the status of network devices and their services and to notify the system administrators when server or network problem occurs. Nagios performs the status check through the use of external “plugins”, which are compiled executables or scripts that can be run from command line to check the status of hosts or services. Users can also create their own plugins to support any peculiar devices or services in their network. Nagios has proven popular among small businesses and also other users include Internet service providers (ISP’s), educational institutions, government agencies, manufacturing companies, and financial institutions.

Benefits:
Comprehensive Monitoring

It provides monitoring of all mission-critical infrastructure components including applications, services, operating systems, network protocols, and network infrastructure.

Proactive Planning

Trending add-ons and capacity add-ons allow the organizations to plan for infrastructure upgrades before outdated systems catch them. Scheduled downtime allows for alert suppression during infrastructure upgrades.

Reporting

It provides historical records of outages, notifications, and alert responses for future analysis.

Intelligent Scheduling

Parallel processing architecture provides quick detection of infrastructure outages and maximum utilization of hardware capabilities.

Route Detection

Intelligent detection of network outages ensures that IT staff can quickly locate the source of problem.

Limitations : 

  • Nagios makes no differentiation among different types of devices such as servers, routers, or switches.
  • Nagios treats every device generically as host.
  • Creating check dependencies is bit burdensome, as you have to refer checks via their service_description field. This means the user has to use either the description like ID or should duplicate the description in all places where the user wants to check.
  • The web interface is mostly read-only.
  • Nagios needs SSH access to monitor remote system internals.

AWS CloudWatch

Amazon CloudWatch is a monitoring service for AWS cloud resources and the applications which the user runs on AWS. CloudWatch enables real-time monitoring of AWS resources such as Amazon EC2 instances, Elastic Load Balancers, and Amazon RDS database instances. Users can access CloudWatch functions through an API, command line tools, AWS SDK (software development kit) or AWS Management Console. The CloudWatch interface provides the frequent statistics that can be viewed in a graph format.

Benefits:
Billing Alarm Metrics

The CloudWatch monitors the charges of AWS bill by sending e-mail alerts when charges exceed a defined threshold.

Limits

Cloud Watch can assign up to five actions per alarm. It can also create 5000 alarms per AWS account. Cloud Watch can also assign up to 10 dimensions per metric.

Monitoring Auto scaling

Auto scaling instances sends metrics to Cloud watch. It offers two kinds of monitoring, basic monitoring which gives aggregated data about each instance every 5 minutes and there is Detailed monitoring which sends metrics every minute.

SNS with Cloud Watch

SNS and Cloud Watch can be integrated to get metrics on each SNS topic. You can monitor the metrics using either the console, CLI, or programmatically using API. Email notifications can be set if specific thresholds are met for an Amazon SNS metric.
Log file monitoring

The Log files can be stored directly on the console.

Limitations :

loudWatch runs on the principle eventually consistent that means, not all the metrics will be available consistently and thus a user may miss some important events.

CloudWatch gives “out of box” metrics for a small subset of services. The user needs to use other softwares to monitor other metrics and then use the AWS API to publish the performance history to CloudWatch.

monitoring tools

While conducting a survey among 235 employees in an AWS summit, the above diagram shows the poll outcome explaining that AWS CloudWatch and Nagios are the most preferred monitoring tools.

AWS CLI IN A DOCKER CONTAINER?

AWS CLI in a Docker Container?

Most of the systems we are using now have Docker on it. Here we will walk you through how to use the container and two of the many useful commands available to the AWS CLI tool.

Starting the Docker container:
It is pretty simple to start the Docker container and get a shell:

AWS CLI

Once you are in the shell, you can use any of the supported commands.  For example, you can copy/upload items to S3, list ec2 instances, and start ec2 instances.

Copy files to S3:

If you have set of files on your local server that you want to copy over to S3, you can use the tool to do that. I’ve written instructions for copying over files in /opt/database to s3://garland.public.bucket/database below.

First, you need to restart the container and map the directory you want to copy over.

Capture

This adds the Docker -v option which maps a path from your local server to inside the container.  The format is /local/path:/inside/cvontainer/path.

WHAT IS AMAZON EC2 CONTAINER SERVICE AND WHY WE USE IT?

What is Amazon EC2 Container Service and why we use it?

Amazon EC2 Container Service (ECS) is highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances.

Why we use Amazon ECS?

Amazon ECS makes it easy to use containers as a building block for your applications by eliminating the need for you to install, operate, and scale your own cluster management infrastructure.

Amazon ECS lets you schedule long-running applications, services, and batch processes using Docker containers.

Amazon ECS is integrated with familiar features like Elastic Load Balancing, EBS volumes, VPC, and IAM. Simple APIs let you integrate and use your own schedulers or connect Amazon ECS into your existing software delivery process.

WHAT IS DOCKER AND WHEN TO USE DOCKER?

What is Docker and When to Use Docker?

Docker is a basic tool that you should start incorporating into your daily development and ops practices.

* Use Docker when you want to distribute/collaborate on your app’s operating system with a team

* Use Docker whenever your app needs to go through multiple phases of development (dev/test/qa/prod, try Drone or Shippable, both do Docker CI/CD)

Use Docker with your Chef Cookbooks and Puppet Manifests (remember, Docker doesn’t do configuration management)

Docker Lifecycle:
docker create creates a container but does not start it.
docker rename allows the container to be renamed.
docker run creates and starts a container in one operation.
docker rm deletes a container.
docker update updates a container’s resource limits.