2.3 Setting up Hasura/local-development

Sourab Mangrulkar
4 min readJun 18, 2017

--

In the previous task we learnt about Git by going through various excellent resources. The final task of week-2 of Hasura-internship is to set up Hasura/local-development. The first 2 tasks of this week are 2.1 & 2.2 .

Procedure to setup local development environment is given here in detail:

I have setup Hasura local development environment successfully. I got a lot of help from the Hasura slack team to complete this task.

Step by step procedure:

Step 1: Install VirtualBox. But first lets understand what VirtualBox is and what is its importance in the Hasura local development environment.

Oracle VM VirtualBox is a free and open-source hypervisor for x86 computers currently being developed by Oracle Corporation. [VirtualBox: Wikipedia].

A hypervisor or virtual machine monitor (VMM) is computer software, firmware or hardware that creates and runs virtual machines. A virtual machine in simple terms is just the emulation of a computer system which provides the functionality of physical computer. A computer on which a hypervisor runs one or more virtual machines is called a host machine, and each virtual machine is called a guest machine. The hypervisor presents the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems.

VirtualBox allows one to load multiple guest Operating Systems under a single host operating-system (host OS). The user can independently configure each Virtual Machine(VM) and run it under a choice of software-based virtualization or hardware assisted virtualization if the underlying host hardware supports this.

For this internship, VirtualBox is being used to set up a local machine called ‘minihasura’ to run a kubernetes cluster on top of which the Hasura project is installed. After setting up Hasura local development environment, the VirtualBox will look as shown below:

virtual machine ‘minihasura’ created in VirtualBox

Step 2: Install Kubectl for Linux.

Steps for installing kubectl in linux
Steps for installing Kubectl in linux

Step 3: Install hasuractl for linux.

curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.2/linux-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

If one runs the command hasuractl in the terminal, one will see information about what hasuractl is, its usage, commands and flags.

hasuractl

Step 4: Create an account on beta.hasura.io if you do not have one.

Step 5: Run the following command:

hasuractl login

You should get the successful login message:

hauractl login

Step 6: Run the following command after successful login. When you run this command for the first time, it will roughly download 1–1.5 GB docker images. This will take considerable amount of time to complete.

hasuractl local start

At the end, one will be provided with the URL to login to the console along with necessary credentials.

Step 7: Run the following command to stop the running hasura platform:

hasuractl local stop

One can start the hasura platform again by running the command hasuractl local start .

The screenshots corresponding to the steps 6 and 7 are given below:

(1)
(2)
(3)
(4)

Step 8: After successfully setting up the local development environment, add the ssh key for enabling git push feature. Run the following command for this step:

hasuractl project add-ssh-key

The output of the above command is as follows:

Adding the SSH key

Credits:

Wikipedia

Next: Data Modelling

--

--