Run your Development Environment on Cloud

The changing scenarios and demanding environments along with rising CAPEX costs of the environment as well as upgrade requests for hardware demand a much more robust and simpler environment which follows the OPEX mode and even facilitates the more productive possibility of WFX. What if we had a Browser based IDE which has collaboration and team chats along with support for almost all leading languages, coupled with managed revision control, practically unlimited storage, build, test automation and deploy pipeline which goes with the pay as you go model ?

The combination that I wanted to suggest is a set of services from AWS.

  • Cloud9 IDE
  • AWS CodeCommit (Managed Git)
  • AWS CodePipeline
  • AWS CodeBuild
  • Amazon Elastic File System
  • AWS DeviceFarm (for hybrid application testing)

The above list is a minimal environment without any bloat and will work much more efficiently from any entry-level or decent smartphone even 5 years old. But with the assistance of an AWS DevOps Professional, integrate with ActiveDirectory authentication and group permissions, along with more cost effective storage and further infrastructure as code “code snippets” could be used along with the pipeline not to forget the manual stages and conditional stages in the pipeline. Also additional features like pre-commit validations for lint checking or software composition analysis for tracking and documenting licencing or legal standards could be added to the pipeline or version control. Will see in detail about each of the services extracted from their respective pages.

Continue reading “Run your Development Environment on Cloud”

CloudFront with multiple origins

A while ago I had bragged about how this site is published – heavily customized WordPress deployed on S3. Though I had left out some of the indigenous parts which I would like to explain in this article. The main aspect explained would be the convergence of multiple origins with CloudFront and configuring behaviours for different cache settings.

Continue reading “CloudFront with multiple origins”

php-mf in AWS Lambda running serverless

A bit outdated, though this sample implementation was committed to my git hub repository along with examples.

Nothing big to explain, rather the php-mf is a routing framework where the routes are defined in index.php or any included files. Normal PHP statement “include” can be used or the MF directive MF::addon can be used to include further routing. All these could be packaged into a lambda. This uses a couple of layers, one the php7.3 public layer, another one is the AWS PHP SDK which was built and published by me. These are available only on the ap-south-1 region as I think. So if you need on a different region, please make sure you deploy the layers correctly before attempting to deploy this module.

Publish Lambda Layers across Regions

This could even be classified as re:Inventing the wheel but was a quick hack workaround that I found at the early stages where we required a set of node.js libraries and custom modules across multiple regions, in fact, I needed this in only 5 regions. Since these libraries and modules could have frequent updates, I wanted the latest package to be updated and published as a new layer version to each region and concerned developers be notified about the new layer version as well as the changelog. Well, to make the long story short, I was at that time familiar with subversion, and the project code was committed to an svn repository. This could have biased me to use the following solution at that time period, rather now my preference would be either “Multi-Region Deployment” using cloud formation or “CodeCommit and CodePipeline with SNS” instead of S3 triggers.

The architecture is simple and was deployed manually at that time. Sorry to say that I no longer have any access to the aws account, as it is a discarded community project and the account is closed at this time. Thought about posting the idea over here since there was a discussion or rather query about this in a community forum.

Continue reading “Publish Lambda Layers across Regions”

Cloud advantage in farming

Well recently just getting too much free time, my interests have started to take a turn towards kitchen farming. Research around hydroponic tower gardens and finally attempting to build one has given a real morale boost.

This one is a picture in the very early stage, where a 1m 4.5″ PVC pipe can house about 24 x 2″ net pots. Should have stopped at 22 skipping the topmost 2 nos, which was a hindrance when the fountain was installed. Finally managed to cap it with a circular food container, which was salvaged from our kitchen. The water reservoir was an old 20lit water can, and pump bought off amazon, which could lift up to 1.8m.

This pump was chosen to be installed in the bottom tank.

Well now I am waiting for some seeds which I have ordered and would be trying to plant those. Oh okay, this is not what I wanted to write about, and the real content is upcoming.

I wanted to dig into possibilities of minimal usage of cloud and services into managing some part of farming. Though real manual farming is a passion not for me but my brother. With the thoughts and ideas, started to check if some one else had gone in the same direction, which landed me on YT with a handful of ideas, from which a two part video from Great Scott hit the nail right on head.

Just adding the first part as an embedded video, if the original person tears it down, I will attempt to narrate the whole thing, till then there is no point in wrting these and not giving the due credit for the original publisher.

I know there is more to this, and the latter part will come up when I will do this on a realtime. Might be tough for me as the GreenHouse kits are not availabe towards this end, and I dont have my private space as I am living in an apartment with shared common area.

Just for the works, I would consider the following, taking a different path, to use sensors for soil and room humidity and temperature, control air flow with exhaust fan with shutter as well as mist spray irrigation system within the greenhouse, one minute montioring with 5Mp digital cameras and image analysis. Also better housing for the power and control unit to adapt with our climate conditions here. Possible location is at our farmhouse.

Architecting SaaS Applications on AWS

During my career in different organizations, though I had the opportunity to architect multiple SaaS applications and most of them on AWS, I was not aware that I was already following most of the best practices. Only recently when I had a chance to view the Architecting Next Generation SaaS Applications on AWS by Tod Golding in AWS re:Invent 2016, I came to know the reality.

From the SaaS models which Tod had referred to, I had gone through the Silo, Bridge and Pool over several projects and had been bitten by most of the cons when using Silo I had experienced the maximum complication on the Agile deployment. Since I learned everything from my own experiences at that time, automated deployments or what is known as Continuous Integration and Continuous Deployment using standard tools was not known to me. And mostly I used to re-invent the wheel, using shell, Perl or PHP scripts. Skewed releases across tenant installations were mostly the nightmares.

Continue reading “Architecting SaaS Applications on AWS”

Refactored a Complicated Lambda to use Layers and split it up

Till recently, in fact, till last week, was not too worried about writing all code into single code folder, and mapping multiple AWS::Serverless::Function into individual named handlers. Till I stumbled on this article, where I started wondering how my folder structure and sam templates were going into the stack. A detailed inspection was not required, though this was the time when I used the GUI ( after a long time ). But the outcome showed how pathetic the condition was.

The lambda console with the filter “aws:cloudformation:stack-name: <stack>”

Well, it is clear that the whole mess is being uploaded into all the function code. What does this mean – holy grail, any one small change here or there, would update all the functions – last modified is the same, all functions will have the node_modules and other artifacts like templates and custom modules.

Continue reading “Refactored a Complicated Lambda to use Layers and split it up”

Anything with Cloudformation

As part of the DevOps Masters Program on Simplilearn, had to configure a jenkins pipeline. For the same, even though they do provide a lab environment, I feel at home with AWS and cli. I myself being part of the AWS Community Builders, should normally prefer this approach.

For the particular project, the infrastructure was visualized by me as two AWS::EC2 pre deployed one for Jenkins master node, and the other for java+tomcat to deploy a sample app. The Jenkins would be configured with Cloud Plugin configured to manage EC2 nodes for build and test and finally deploy to the tomcat using remote deployment using war. Making the long story short lets jump straight into the steps. Agree that I completed the Project Run in about a couple of hours and creating such a template and running through aws-sam was purely on academic interest. Download the template file: cf-template-ec2-jenkins-tomcat-ubuntu-bionic.yaml

Continue reading “Anything with Cloudformation”

Wild walk with #sam and #aws

Mostly these days, I am working with IaC using aws sam cli which gives me a kind of satisfaction – its cumbersome for me to go into the myriad of web gui and continuously clicking. By creating templates and running them from cli has been my choice for too long.

Getting straight into the job, will summarize the initial requirements and the architecture, then move on to additions.

Required Output

Host a Static Site on S3, deliver it globally through Cloud Front CDN with SSL over HTTPS. Once deployed the Route53 tables should be updated. The deployment should use aws sam cli and IaC.

Though there is not much complication in the architecture, while deploying this during the first pandemic wave, after multiple attempts I found that the cloudfront should be created in specific region such that the SSL certificate can be attached.

Continue reading “Wild walk with #sam and #aws”

Case Study – WIP Reporting and Timeline video on Completion

Requirements (My hallucinations):

Design and architect a highly available, large user base system which is going to be used by the National Highways, the regular employees updating photos of WIP on different stages and when work completed, archive all images after creating a timeline video. WIP sequence should keep the most latest photo thumbnail linked to a project blog page, with a gallery linking to the last photo per day.  Post-processing of completed work can take even up to a week giving more importance to the lowest cost possible. The system should be capable of handling hundreds of thousands of high-quality mobile photographs per day. Runtime costs should be as low as possible. For each WIP a minimum of one photograph in six hours is desired. 

Solution on AWS (My views):

Application to be developed in some kind of single-page-app with progressive-web-app support, javascript and CSS libraries. This can be hosted on the AWS S3 bucket with Cloud Front default origin pointed here. The standard secure approach of HTTPS (Redirect HTTP to HTTPS), OAI and custom domain with a certificate from ACM is recommended. The dynamic part uses Cognito User Pool, Amazon API Gateway (regional), Lambda, STS etc. API Gateway stage should be the behaviour point for the route.

Continue reading “Case Study – WIP Reporting and Timeline video on Completion”