Thanks to Outreachy, I made my first contribution to OpenStack in October last year. Setting up your account and development environment could actually seem complex at first and yes, the process is a bit longer than you would expect but it’s actually quite straightforward.
First of all, if you’re totally new to OpenStack – like I was when I made my first contribution, you might be wondering what exactly it is. I’ll give the three most important facts about OpenStack:
- It is a cloud computing platform
- It is free and open source
- It is deployed as IaaS (Infrastructure as a Service)
You’ve probably already heard the terms above and you might be familiar with them, but in case you’re not entirely sure of what they are, I’d be going into further details about cloud computing, IaaS, PaaS etc in another article.
In this article, I’ll be giving a step-by-step guide on setting up your environment and submitting your first change for review.
It’s best to use a Linux system, you can use a Mac OS but the support is limited with OpenStack. The core contributors use Linux and the guides are mostly in Linux. You can use Ubuntu, Fedora, Debian, Mint or CentOS.
If you have a Windows machine like me, you can either install a virtual Linux environment on WSL or partition your hard disk and install a Linux OS on one partition. I’d advice you start with simply installing a virtual environment and using that till you’re sure you want to commit, then you can go ahead and partition your disk.
Ubuntu, in my opinion is the simplest Linux distribution for beginners and the community is amazing. Here is a simple guide for setting up Ubuntu on your Windows. Note that with this guide, you can only run the command line, which is really all you need for your first contribution.
You can do a google search on how to set up a Linux GUI and other accessories within your Windows system or you can go all the way and partition your hard disk, but I’d strongly advice you to just stick with the command line for now.
To become a contributor, you’d have to create an account with Open Infrastructure Foundation. This allows you get involved in all that OpenStack does and to also vote in elections. Next you would setup a task tracker account – this allows you report bugs and find new bugs to work on. In the past, OpenStack used Launchpad but now they use StoryBoard so you only need to set that up.
You can set up both OIF and StoryBoard accounts right here. Note that you should use the same email for both accounts and also for any other setup as you continue with OpenStack.
Set up IRC
This is where the OpenStack community meets, where you can ask questions and join discussions.
Setting up my account caused a bit of a headache for me and if you only have the Linux terminal installed on Windows, you might have to install a GUI to set this up. I hear Windows is bringing some Linux GUIs to the store, so depending on the time you read this, they might already exist for easy download. If not, then you can download VcXsrv. This tutorial should help in case you get stuck.
Once you have a GUI running, check here to set up IRC. Don’t just scheme through these instructions, follow as best as you can and also check the screenshots to ensure you’re on track.
Once you have an IRC username and password set up, you don’t need to bother yourself about these complex steps again even if you change your computer. Simply use your username and password to sign into any IRC web client and join the channel of your choice if you haven’t already during setup. There are many web clients, I’ve been using irccloud.com and it works great for me.
Set up your environment
The openstack docs I have linked for this part could be confusing if it’s your first time, so I’d advice that you first go through each step I have listed to have a broad idea of what to look out for in each link. Focus only on achieving each step.
- Install git
- Configure git with your username and email
- Setup gerrit. Note that once you input a username, you can never change it unless maybe you create a different account with a different email.
- Setup SSH. You will use this key to link your computer to your gerrit account.
- Install git review
- If your username on your computer is different from your gerrit username, you have to configure your git review with your gerrit username so gerrit recognizes your computer. If you’re wondering what your username is, in the example below the username is ‘mark’
Making your first contribution
Finally you’re all set up. Time to get your hands dirty by making your first contribution!
Finding a Bug
If you’ve already seen a bug you’d like to work on, you can go ahead and get started with the next steps. If not, check out tasks on the storyboard to find a bug that you can work on.
When you’ve found what you’d like to work on, you want to find the code base on opendev. OpenStack uses opendev to host their code (like github). If you don’t already have a link to the code base, you can either do a google search or simply ask on the community chat on IRC.
Starting a Change
- Open the terminal on your computer.
- Clone the repository from the link you got in the previous section.
- Create a new branch to work on:
git checkout -b TOPIC-BRANCH
Committing a Change
After making your changes and saving, return to the terminal and run the following line to commit your change:
git commit -a
This will open a text editor within your terminal where you will input your commit message. On the first line, where you see the blinking square, this is where you should summarize the change you made in 50 characters or less. If you then have any more details you will like to put in your message, you can do that in the following paragraphs. When you are done, close the editor and return to terminal.
To view your change and make sure everything is fine. Type
git show. This will show the changes you just made in green. To close this window, simply type
Submitting a Change
Finally! This is the last part of making your first change.
git review in your terminal. Gerrit should automatically assign a Change-Id, but in case you run into errors, check the link I will post at the end of this article. It might take a few minutes, and if you added any password while setting up SSH, you will be asked for the password. A few more minutes and you are done!
For more details on making changes, Change-Id and also updating your changes after submitting, check here.
Hope this was helpful in getting you started with Openstack!