Posts

Showing posts from 2015

How to migrate Parent pom from maven to gradle

Convert Maven parent/super pom to Gradle init file
When you think of moving to gradle for some reason from maven, You need to take care of lot of stuff around it, You can find lot of tools and help to convert maven pom.xml to gradle build.gradle But one of the most important task as an engineer or architect would be to convert your super pom (or parent pom) in to gradle init scripts.

Gradle init script provides same functionality as Maven super/parent pom. The basic difference is that you can call init script

Run timeAs many as of them This gives us flexibility to change the init script on run time but doubt of not tracking the changes.

Search Engine Optimization (SEO) for blog

Search Engine Optimization  Adding right content to you website is very important aspects of making your site more useful and relevant. At same time its important that people read the blog and content. How are you going to do that, You need to make sure your content is right and searchable.

I am going to list out few tips to make your blog/site more searchable and (SEO) Seach Engine optimization.

Things to take care of while writing content and improve search result for blog

The Rise of the Jenkins CI Butler - by Jonathan McAllister

Author of Mastering Jenkins [Packt Publishing] [http://www.masteringjenkins.com]

Kohsuke Kowaguchi designed and developed the Hudson automation system from the ground up while he was working at Oracle in 2006.  Primitive inceptions of the Jenkins platform (then known as Hudson) simply aimed to support continuous integration practices and offer a viable replacement for CruiseControl, which was the popular CI solution at the time. The Hudson platform was initially very Java centric with tight coupling to Maven and Java development paradigms. Little did Kohsuke know that his internal Hudson tool would catapult in notoriety, change names (into Jenkins), spin off to become CloudBees and eventually become the most popular modern Continuous Integration and automation orchestration platform in use in modern history.


The current Jenkins platform provides an easily consumable unified user interface coupled with a highly scalable distributed automation solution that can build, test, and automate…

Maven Errors - Few common Maven error and troubleshooting part 1

In this post i am going to talk about maven build troubleshooting, Here is the list few maven error and its troubleshooting.

Tag Already existIf you see following type of error in your release build after the perform step

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project : Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-tag command failed.
[ERROR] Command output:

[ERROR] fatal: tag '<some tag>' already exists


Preparing for an M&A: 5 Tips for VP of Engineering

A Nice article on how to take care of Merger and acquisition smartly.

http://www.whitesourcesoftware.com/preparing-software-due-diligence-5-tips-vp-engineering/


In house tool vs enterprise tool / open source tool

Tool development and adoptionThe current pace of software development cannot manage its speed without the automation.
Automation is the most important element in order to achieve agility in delivery of the product. Every part of the software development life cycle needs tools to perform their action automatically. These phases could be coding, code review, build & deployment, environment management, resource assignment, notification and many others.
There could be 2 options, which a team can opt for:
Use a third party toolOne can select the tools, which are available in market, either open-sourced or free. You can even buy enterprise solution if needed.Build an in-house toolTool can be built or developed in-house for the consumption as well.Lets take look different aspects of choosing options

Code Review - Write your code right

Writing code is definitely subjected to individual thinking, logics and perspective. How he writes code is completely depend on his technical and logical skills. 2 different people can write same code in entirely different tactic (May be both logics of the code are right in their own way). Even 2 persons can write bad code as well as good code as per standard.
In real world it is most likely possible that one writes the code and same will be read multiple times by many other developers to fix the bugs, improve the features, understand the code. That is why each language has its own style of coding and guideline to make it more meaningful and understandable.
Most of time the Developers struggle to understand the code written by someone else in team. I have even heard people saying that its difficult to read someone else code rather writing same from scratch.

I would like to highlight few compiled techniques in once place to make writing code better.

Git Branching Strategy / Model - GitFlow

There are enough branching strategy available for git flow over the internet.

Here i have compiled few branching strategy which i found in various blogs.


A nice blog on Git based branching method/model
http://nvie.com/posts/a-successful-git-branching-model/


Git Documentation https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows
Git Workflow http://blog.endpoint.com/2014/05/git-workflows-that-work.html
Git Flowhttps://datasift.github.io/gitflow/IntroducingGitFlow.html http://yakiloo.com/getting-started-git-flow/ Simple branchinghttp://drewfradette.ca/a-simpler-successful-git-branching-model/
Another branching Modelhttps://www.wearefine.com/mingle/env-branching-with-git/

SVN mirror for Live back-up - High Availability

Other then taking backup at regular interval, we may want to provide keep live data just to make sure data is highly available.

The best option is to backup Live data as soon as it gets changed.

Here is the trick for the SVN Mirroring.

How to create Repository Only user with correct access as admin can create new repository Identify the repository name and cluster. You must follow the approval process before creating any new repository. Create repository svnadmin create /svnroot/<Repo_name>change the owner of repository to apache(if needed) chown -R apache:apache /svnroot/<Repo_name>Now you need to create Mirror repository on another SVN server, following are the steps to create "Mirror repository".
How to create Mirror Repository Take the hotcopy of the repository from 1st SVN server.svnadmin hotcopy /svnroot/<Repo_name> /tmp/<Repo_name> Remove the hook script if any create a tar file of the repo and scp it to 2nd SVN server.Log in to 2nd serv…

Git repository backup

Git is distributes system, the beauty of the git make is more robust and easy to recover from any last known good working copy.

However, You can not always rely on such copy and you will definitely need proper backup solution to deal with such situation.

There are many ways to take backup of git repositories.
I am listing few here.

You can directly take a tar of the git repo directory as it has the whole bare contents of the repo on server. There is a slight possibility that somebody may be working on repo while taking backup.The following command will give you the bare clone of repo (just like it is in server), then you can take a tar of the location where you have cloned without any issue.
git clone --bare {your backup local repo} {new location where you want to clone}

Maven to gradle Migration

I am not a big fan of gradle but still this time i am taking this topic.

Maven pom file is xml based build file and Gradle is groovy based system. There are many logic involve to make one to one comparison of generic features. I would like take some generic logic and try to detail out on converting those from maven pom file to gradle build file.


Setup Modulesdefine repositoriesupload of artifacts to maven repositoryProfilingjacoco test reportuse of release plugin

Too many open files

If system throws "too many open files" error or something like following during build/compilation
[INFO] java.io.FileNotFoundException: (Too many open files)
This means limit to open files for the user or system has been exceeded.

You can check the limit by running following command

ulimit -a

Solution ->
open file common-session
sudo vi /etc/pam.d/common-session


Add following entry in the file session required        pam_limits.so
open file limits.conf sudo vi /etc/security/limits.conf
make sure both soft and hard limits are set to larger number (as per your need)
*                soft    nofile          500240
*                hard    nofile          500240

Logout and login and run command again ullimit -a
You will see the new limit number.

Thrift compilation error

I was trying to compile and install thrift from https://github.com/apache/thrift.
While compiling the thrift for 6 and 8 version i faced few errors and had to spend lot of time fixing it   (Including searching various solutions on Net).

Let me  detail out few error and solution for it.

Missing thrifty.h 
src/thriftl.ll:50:21: fatal error: thrifty.h: No such file or directory
compilation terminated.
make[3]: *** [libparse_a-thriftl.o] Error 1
make[3]: Leaving directory `/home/abc/thrift/compiler/cpp'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/abc/thrift/compiler/cpp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/abc/thrift'
make: *** [all] Error 2

Solution -> You will have thrifty.hh file instead of thrifty.h. Location of file would be  ./compiler/cpp/thrifty.hh
 cp ./compiler/cpp/thrifty.hh ./compiler/cpp/thrifty.h and start your compilation again, It should work. Non static declaration error struct.c:28:1: error: static declaration of √Ęstrl…

How to download Artifacts from maven repo

To make deployment automated, there may be need to get the artifacts from maven repo.
Release artifacts can be downloaded since we know the version But how to download the latest snapshot artifacts.

here are few http call to get  rid of such issues.

How to download latest Snapshot artifact from nexusmaven repo

If you know the version you can directly get the artifact like this

wget  http://<Your repo name>/service/local/artifact/maven/content?r=snapshots&g=com.&a=app&v=2.0.25-SNAPSHOT&p=war


Setup Build - SCM System from beginning

This topic is specially for users who are new to the Build, SCM and Release Management and need to understand how can they setup the infrastructure and what are their options.

To Build the system to automate the build and deployment process there are few main areas which needs to be covered. Following are our prerequisite.
- Source code   - Builds System -  Deployments - QA Automation
To describe above here are main ingredients

Maven Tips to optimize build timings

Few Maven Tips and tricks to make Maven builds fast and faster and efficiently.
This can help to reduce the build timings drastically and optimize your build timings

Run compilation parallel
mvn -T 2 clean compile
#Above will trigger 2 threads

mvn -T 1C clean install
#Above will trigger 1 thread per CPU, if you have 2 CPU core then 2 threads will be spawned.
#You can even give number in fraction (1.5, 2.5 etc).

Managing open source component

Building any software need lots of efforts including resource, time, money etc. It is really a great pleasure when it goes live or get released. In parallel, fear may come with the doubt of having bugs (even though testing is done). You can fix bugs related to software feature or functionality but the once which can hit badly are
Security vulnerability Licensing risk of open source component.Outdated open source component.
Above checks needs to be done during the development phase and ruled out any discrepancy related to security or legal.
WhiteSource provides one fine platform to solve such issues without putting much effort by developers, So that they can concentrate on core development instead of spending time on finding these issues which can be easily handled by WhiteSource.

WhiteSource is an open source management solution which does
Open source licensing and compliance managementOpen Source security vulnerabilities alerts and managementExecutive dashboards, policy enforcement, an…

Jenkins Error - "Error while accessing rate limit API" for github pull request builder

If Jenkins throws following error for github pull request builder or for any https call Received fatal alert: handshake_failure (Like following)

org.jenkinsci.plugins.ghprb.GhprbGitHub connect
Can't connect to https://<github-enterprise-server>.com/api/v3 using oauth
 org.jenkinsci.plugins.ghprb.GhprbRepository initGhRepository
SEVERE: Error while accessing rate limit API
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Gradle or Maven - A Dilemma

Gradle and Maven (or Both)
The world of build tools evolve from simple compilation (gcc) to make files, then evolution of ant(+ivy) and Maven, now the latest build tool is Gradle. Its always a puzzle which build tool to choose maven, gradle or both (maven and gradle). Sometime its first time project setup or could be migration from existing tool but it always a debate to choose one of the existing one. There have been lot of talks and discussion on Gradle, maven (and/or Gradle vs maven). There are Buzz around that Android/google adopted Gradle as its standard build tools.

Maven Repository tools Comparison

There are several maven repository tools available but biggest players are Artifactory and Nexus (sonatype).  I am taking these 2 repository provider tools for comparison. Artifactory and Nexus SummaryMain purpose of this document is to compare the 2 maven repository providers (Tools). Artifactory Nexus (Sonatype) I am trying to review both repo managers. This is on basis of few points like features, cost, support etc.

Git Repository Corruption - Part1

Git Repo Corruption recovery

The biggest fear of any administrator is the Data corruption. As a Git administrator we do take regular backup, We keep our system HA, We even do disk replication. In short we try every thing to keep data safe and secure.
But still there are chances for the git repository corruption and you have to deal with it in real world.

Here are few repo corruption scenarios and solutions.

Note-> Please make sure you backup everything before touching the repo. There are instruction to fix some of the error. It is always suggested to backup your data before trying to perform any action.