Posts

Setting up OpenStack dev environment the hard way

As you may already know, OpenStack is a big software project that running on stacks of servers so you cannot just folk it to your computer and run. Fortunately, the OpenStack community had built a minimal version of the OpenStack called devstack that help you have a developing environment without using a lot of resources. But, devstack still eats lots of CPU and memory of your computer so in my opinion, it's better to have a dedicated machine for running devstack (mine is a computer with 16GB). So the last things you need to do to start working on your patches are: 1. SSH to the devstack server 2. Make sure that the service outputs logs to some files (such as /opt/stack/logs/tacker.log) For Tacker or services that have settings file under /etc/<service name>/<service name>.conf, you can change the parameter to output logs to file 3. Using tmux or byobu to have multiple ssh console screens that you can easily switch to and for 4. Use VI or NANO to ma...

How to dev and test python libs on your OpenStack's devstack

In OpenStack Devstack, the python packages/libs such as python-tackerclient, tacker-horizon are not easy to dev because normally they will be installed under python's site-packages. So, to make it easier for us to developing these libs, follow the instructions below: 1. Clone the python packages that you want, for example: tacker-horizon: cd /opt/stack/ git clone git://git.openstack.org/openstack/tacker-horizon 2. Go inside the cloned directory and install it using pip : cd tacker-horizon sudo pip install -U -e . 3. Make the changes and enjoy Note:  if you work with tacker-horizon, you may have to restart apache2 server: sudo systemctl restart apache2

How to fix "F821 undefined name 'unicode'" error when running tox

If you get this following error when running "tox -e pep8": ... # F821 undefined name 'unicode' if isinstance(config, str) or isinstance(config, unicode): ... Modify the tox.ini as following to fix it: [flake8] builtins = unicode

How to fix "db type could not be determined" when running tox

If you get this error when running "tox -e py35": "db type could not be determined"  do this trick to get rid of it: rm .testrepository/times.dbm Life is good now.

Quote of the day

Image
"The man who moves a mountain begins by carrying away small stones" ~Phil Knight

Install a python package from a local directory with pip

Normally you will use pip to install a python package from pypi. But, actually you can do it from a local directory using the "-e" parameter: pip install -e /local/directory

Reinstall docker-ce after a purge and config dir deleted.

I purged the docker-ce package and deleted the /etc/docker directory and It brings me trouble... I cannot reinstall it. Every time I try to reinstall with the following command: sudo apt install --reinstall docker-ce ... Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for detail s. invoke-rc.d: initscript docker, action "start" failed. ● docker.service - Docker Application Container Engine    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)   Drop-In: /etc/systemd/system/docker.service.d            └─docker.conf    Active: activating (auto-restart) (Result: exit-code) since 토 2018-02-17 22:54:41 KST; 5ms ago      Docs: https://docs.docker.com   Process: 28307 ExecStart=/usr/bin/dockerd --config-file=/etc/docker/daemon.json (code=exited, status=1/FAILURE)  Main PID: ...