CategoryOpenStack

Week 3

I’ve never written tests for any of my code.

Though I did write some for a class I had, a few semesters back with JUnit. But I wasn’t planning on becoming a tester so I didn’t see the point of digging deeper back then.

I spent the weekend reading up on nose, testr, pytests, mock etc. part of the blueprint requires me to write unit tests and integration tests; so now would be as good a time as any to really learn about it. I won’t try to squeeze in everything in this post, so maybe a series and I won’t be covering everything there is to testing, just the stuff I think is relevant to get things done. One huge benefit (from a non-tester’s POV) I see for writing tests for the code is that you can figure bits which could be made reusable. And reusable code = less typing for me.

Backups on Trove Part 1

Week 1-2 OPW 2015

Late blog post (already 2 weeks into the program) but better late than never.

I got in :D !

Huge thanks to my mentor Iccha Sethi and the rest of the OpenStack community for helping out with the bug fixes! I’ll be working on a blueprint (in review) to help users retrieve log files from a DB instance for the next 3 2 months.

Before the start of the internship, the first task assigned to me by Iccha was to read up on the architecture of Trove. YouTube has a good number of helpful videos on it.

She gave a rundown on the code flow for the creation of a DB instance and gave some pointers on how to track the calls made on various modules using logs. I’ll do a blog post on that soon and another one on debuggers.

Merry Christmas!

Setting up Trove wtih Devstack

Well first off you need to have VirtualBox and Vagrant installed – Installing Vagrant and Virtual box on Ubuntu 14.04 LTS. VMs are helpful when you want to experiment without messing up your system. Once that’s done, create a folder for your project mkdir devstack_trove and cd into that folder.

Run vagrant init in the folder. You’ll get a Vagrantfile, edit it and make the following changes:

config.vm.box = “precise32”

config.vm.network “forwarded_port”, guest: 80, host: 8080

The last line lets you access the dashboard(Horizon) on localhost:8080

Note: Best to setup devstack with 2GB RAM and a reasonably sized swap file.

Now we’re ready to start the VM vagrant up, once it’s up and running you can SSH into it vagrant ssh. You need to be root sudo su before you can execute these commands.

First update the VM and then install git: apt-get update && apt-get install git-core -y

Then cd ~ to the home directory

We’re going to clone trove-integration which will help us setup Trove with Devstack – git clone https://github.com/openstack/trove-integration.git

Go to the scripts directory cd trove-integration/scripts/

Using redstack we’re going to install Devstack with Trove ./redstack install this starts all the necessary services as well.

You can check if all the services are running by connecting to the screen screen -x stack

If you get an error:

Cannot open your terminal ‘/dev/pts/xx’

Then you can change the access permission for it by chmod 660 /dev/pts/xx

To detach from the screen type in Ctrl+A then D

After it’s been installed “successfully” you can kickstart the setup of Trove ./redstack kick-start mysql, it’s basically test-init and build-image packed into a single command. If everything goes well, you should get something like:

Starting tr-api cd /opt/stack/trove; /usr/local/bin/trove-api —config-file=/etc/trove/trove.conf —debug 2>&1 | tee /home/trove-try/trove-integration/scripts/../report/logs/trove-api.log…
Starting tr-tmgr cd /opt/stack/trove; /usr/local/bin/trove-taskmanager —config-file=/etc/trove/trove-taskmanager.conf —debug 2>&1 | tee /home/trove-try/trove-integration/scripts/../report/logs/trove-taskmanager.log…
Starting tr-cond cd /opt/stack/trove; /usr/local/bin/trove-conductor —config-file=/etc/trove/trove-conductor.conf —debug 2>&1 | tee /home/trove-try/trove-integration/scripts/../report/logs/trove-conductor.log…
Before you can use the trove CLI, you need to Set environment variables using the OpenStack RC file source openrc admin admin in the ~/devstack directory for admin rights.
Else you’re going to get errors like:
ERROR: You must provide a username via either —os_username or env[OS_USERNAME]
If you want to re-install:
killall -9 screen
screen -wipe
RECLONE=yes ./redstack install
./redstack kick-start mysql

© 2018 Anna Philips

Theme by Anders NorénUp ↑