Setting up GITLAB Runner on GITLAB Instance

The good thing about being into dev-ops is that you get to learn a lot. Sometimes it’s more sort of revision than being able to JUST ACCOMPLISH A TASK. I have used GITLAB quite a few times but never installed it myself for the staging environment. Here’s a quick start guide with on how to setup GitLab with CI/CD runner on an AWS instance.

Setup GITLAB

  • For those interested they can refer to the following doc : Setting Up GitLab

  • In short take an AMI for GitLab on m2.large instance on AWS. And rest is just plug and play on click of a button.

  • Once GitLab for CI/CD you have to configure the RUNNER.

  • SSH into your system where your GitLab is running.

  • Add GitLab offical repo :

    For Debian/Ubuntu/Mint

    curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

    For RHEL/CentOS/Fedora

    curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash

  • Install the latest version of GitLab Runner, or skip to the next step to install a specific version:

    For Debian/Ubuntu/Mint

    sudo apt-get install gitlab-runner

    For RHEL/CentOS/Fedora

    sudo yum install gitlab-runner

Register the runner

  • To register runner type

    sudo gitlab-runner register

  • Enter your GitLab instance URL:

    Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) https://gitlabs.yoururlwheregitlabisconfigured.com

  • Enter Token for your runner

    Please enter the gitlab-ci token for this runner xxx

  • NOTE : You will find this runner in your admin settings>token. Be very careful in putting the token.

  • Enter a description for the Runner

    Please enter the gitlab-ci description for this runner [hostame] my-runner

  • Enter the tags associated with the Runner, you can change this later in GitLab’s UI:

    Please enter the gitlab-ci tags for this runner (comma separated): my-tag,another-tag

  • After couple of more options of configuration :

  • Enter the runner exectuor [ssh, docker etc.] [Preference : choose docker]

    Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell: docker

  • If you chose Docker as your executor, you’ll be asked for the default image to be used for projects that do not define one in .gitlab-ci.yml:

    Please enter the Docker image (eg. ruby:2.1): alpine:latest

  • Once completed you’ll have your runner up and running.

  • In case you are configuring the runner ONLY then in that case you have to download the docker package for your distro.

  • In order to have execute the runner everytime a code change is pushed please include .gitlab-ci.yml in your project.

Sample gitlab-ci.yml

<br /># Official framework image. Look for the different tagged releases at:

# https://hub.docker.com/r/library/python

image: python:latest

# Pick zero or more services to be used on all builds.

# Only needed when using a docker container to run your tests in.

# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service

services: - mysql:latest

# This folder is cached between builds

# http://docs.gitlab.com/ce/ci/yaml/README.html#cache

cache: paths: - ~/.cache/pip/

# This is a basic example for a gem or script which doesn't use

# services such as redis or postgres

before_script: 
- python -V 
- pip install -r requirements/development.txt 
test: variables: DATABASE_URL: "mysql://root:root@localhost:5432/$MYSQL_DB" 
script:
    - flake8 
    - py.test    
  • For environment variables go to repo-settings and put your env variables/secret there.

    Jira Integration :

    ref docs : ![Jira Integration][2]

    Slack Integration

    ref docs : ![Slack Integration][3]

    THAT’S ALL FOLKS

Year 2017 : Lookback

For 2018 my promise was to revamp my blog so that I can start blogging once again. And voila! I did it. 2017 was full of ups and downs for me and I’ll start with the very beginning.

2017 started on a high when we were in talks with a company for acquisition but then eventually it failed as the party backed out at the very last minute. Fast forward -> our product VCA [Video Content Analysis] was still in novice stage and we were trying to make it big. After showing couple of demos to some of the big clients we were unable to impress them let alone to get them talk about funding.

March of 2017 saw us working on the prototype for our new product which we named as “ANY TIME WI-FI” and after near about one month of R&D we delievered the project to one of the largest beverage maker in the country at a nominal cost. It went through lot of hiccups but finally we delievered it. Personally, I learnt a lot from the same project.

Later on I got an offer from Radiowalla [http://radiowalla.in] which were looking to exploit the same technology I was working with in the retail sector. Finally I joined Radiowalla in April but the real work started mid of July. As things were happening in my professional life, my personal life was on a roller-coaster ride itself.

I moved out of my flat and started living with Aadi and Veer [founders of Neuron [https://neuronme.com]] and boy! we used to have epic fun everyday. 4 bachelors living together and having time of their lives.

In middle of all this I started dating this beautiful girl and things just look that they were “meant” to be. Skipping that part 😛

In August Radiowalla gave me an offer to move to Bangalore since their head-office was located there and they wanted the dev team to work in close co-hesion with the rest of the guys. Finally on 7th of August we [Me and my colleague Sudhanshu] landed at Bangalore Airport. And somewhere I knew it’s going to be LEGEN—WAIT FOR IT–DARY.

Meanwhile, I got to know that I scored well in my masters exams and cleared my master by an aggregate of 82%.

It’s been nearly 5 months now and most of the time I have travelled around Bangalore and went to ‘n’ number of client meeting aside from the coding work I do. All in all good fun.

Oh! I nearly forgot Radiowalla’s team. Trust me in my 3 years of professional experience I haven’t seen such a dynamic team. Radiowalla office to be honest is all about Work Hard and Party Harder! [Though things do get boring at times :P] . Music loving people… Long chats over breaks …. overall I just think this is JUST the right place for me with few other scope for improvement.

Also, I travelled a bit this year.  Some of the places I went to are as follows :

  •  Mcleodganj
  • Kullu
  • Manali
  • Coorg
  • Nainital [ Going every year since 2009]
  • Chopta
  • Manipur
  • Shillong

I specially remember my Manipur trip since I went there to give lecture to 2nd and 3rd year students on Basics of Cloud Technology and in return I got to see their beautiful campus and nearby areas.

As the year was coming to an end. I got re-united with my Santa Workshop family [ref : http://aniketmaithani.net/lesson/santa-workshop-detailed-experience/]

I am associated with DeePositive foundation since 2014. For those who don’t know much about it please check the link :https://www.facebook.com/pg/DeePositive.Foundation

All in all it was year full of fun, masti, heartbreaks [yeah that thing didn’t last long, but I am keeping my fingers crossed] and obviously a lot of learning.

Pics at the bottom.

 

Till the next time. Adios!

2017 : First Road Trip

Study Time

OFFICE FRIEND 😛

NANI BE THUGLIFE

Fun Times

Trip to Nainital

ABSTRACT PHOTOGRAPHY 😛

PARTY TIME 😀

SURPRISE TRIP TO DELHI

COORG <3

Meeting this guy after so long <3 Diwali Bash

Chasing the sun

Mumbai -to- Pune

Sakshi’s play 😀

Foodie In Me

Santa Family

I Look Bonkers

41’st B’day

Morning Flights!! 😛

5 Reasons to attend Pycon India 2016

5 Reasons to ATTEND PYCON INDIA  !

Updating my reason(s) this year as to Why one should attend Pycon India

1. MEET THE GEEKS !

We all sit in our rooms/offices and hardly see the light of the day. Pycon India is more than a conference. It’s a “festival” for geeks if I may put it so. You meet lots of people from different parts of India and to be honest the whole 3 day event is like CRAZY!

2. Ultimate Masti

Pycon India is a volunteer driven event. You can get a good experience of various geeky stuff. Right from cutting LAN wires, setting up servers and wifi-access points to cleaning up the entire place.

1 [NOC team taking rest]

3. The Impromptu Coding Session

You get to take part in the Impromptu Coding Session. Don’t get surprised if you see people sitting in a corner with their laptops on and continuously staring at their screens. That’s how we roll at Pycon India.

2 Screen Shot 2016-07-05 at 6.05.36 PM

4. Make Friends and Memories

You’ll definitely make some of the best memories and friends at Pycon. Here are some of the snapshot(s) from previous year(s).

775257_10204830150977555_6028124386757267426_o 9 7 5

5. BECAUSE THIS TIME IT’S DELHI!!!

Well how can you say NO to an awesome place like Delhi. Street Foods, crowd, funny slangs and above all, the jovial nature of the people of Delhi.

Skyline_at_Rajiv_Chowk

[Image Source : Wikipedia]

And in case you’re still looking for a reason maybe you should checkout out our Facebook Page [https://www.facebook.com/PyConIndia/] and let us know what will drive you to attend this Pycon.

P.s The ticket sale is ON and you can buy ticket from Explara. [https://in.explara.com/e/pycon-india-2016]

Also keep checking @PyconIndia on twitter for further updates.