Contributing to the IML Backend

Software Contributor Documentation Table of Contents

backend

General

Prerequisites

On the Local machine, i.e., not the vagrant virtual machine.

For the desciption that follows, it will be assumed that the Vagrant file and virtual machine information reside in the directory:

~/vagrant-projects/vhpc 

Contributing to the IML Backend

Clone the desired Backend repository, for example, the main backend repository:

intel-manager-for-lustre

cd ~/vagrant-projects/vhpc
git clone git@github.com:intel-hpdd/intel-manager-for-lustre.git

Create a branch, always work on a branch.

cd intel-manager-for-lustre
git checkout -b  my-fix

Validate that the correct branch has been selected.

git branch

Work on the branch.

Use VS Code and open ~/vagrant-projects/vhpc/intel-manager-for-lustre

As an Example, make a small python code change.

The code that will be changed will modify the description displayed when rebooting a server. See the form below and observe the line that states:

Initiate a reboot on host oss2.lfs.local

server_reboot_1

In VS Code, locate and edit the following file: host.py

intel-manager-for-lustre 
  > chroma-manager
    > chroma_core
      > models
        > host.py

Search for "Initiate a reboot"

On the line containing “Initiate a reboot”, add Hello World:

Change this line:

def description(self):
        return "Initiate a reboot on host %s" % self.host

To look like this line:

def description(self):
        return "Initiate a Hello World reboot on host %s" % self.host

Save the file: host.py

Using the python code change in your cloned repo

In a seperate terminal, log into the adm node

Log in as root

Stop the IML running services

Go to the cloned intel-manager-for-lustre repo on the /vagrant mount point where the code edits were made.

cd /vagrant/intel-manager-for-lustre

Preserve the original files that came with the initial IML install.

cd /usr/share/chroma-manager/chroma_core/models

mv host.py host.py-orig
mv host.pyc host.pyc-orig
mv host.pyo host.pyo-orig
ln -s /vagrant/intel-manager-for-lustre/chroma-manager/chroma_core/models/host.py host.py 

Start the IML services

In a browser, go to the IML location

Verify that the small change worked.

Be sure to follow the instructions for adding servers in: Install IML on a Vagrant Virtual Cluster.

It is possible that the browser cache may require refreshing for the change to take place.

server_actions

server_reboot_1


Congratulations! You just made a change to the IML Backend code.


The process outlined above is the basic technique for modifying the Backend IML code.

A note about starting and stopping chroma-config

Pushing the code change to github

On your local machine, i.e., not the vagrant VM:

Ensure you are on the proper branch

Otherwise, change to the my-fix branch

Add and Commit the change.

Add the following comment:

This is a test fix for the backend

 - Changed a server description

Push to github


Top of page