From 0fead33ba145554f9aa6d2fdf32356f8fad821cf Mon Sep 17 00:00:00 2001 From: Matthew Oliver Date: Mon, 14 Aug 2017 09:11:35 +1000 Subject: [PATCH] Add OpenSuse SAIO build instructions This patch adds OpenSuse to the build a SAIO development page. OpenSuse's libssl.so naming is different then other Linux distros and as such it can't simply use pip's cryptography wheel/binary, which by default is linked to libssl.so.10. To fix this, --no-binary cryptography was added to pip install: pip install --no-binary cryptography -r requirements.txt Which forces the cryptography module's binding to be compiled against the correct libssl.so library. Change-Id: I6a070f33d670edbb887433530c44e2cb509f0c58 --- bindep.txt | 9 ++++-- doc/source/development_saio.rst | 53 ++++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/bindep.txt b/bindep.txt index b2c61ebb62..80ce1bf915 100644 --- a/bindep.txt +++ b/bindep.txt @@ -3,7 +3,8 @@ build-essential [platform:dpkg] gcc [platform:rpm] -gettext +gettext [!platform:suse] +gettext-runtime [platform:suse] liberasurecode-dev [platform:dpkg] liberasurecode-devel [platform:rpm] libffi-dev [platform:dpkg] @@ -12,8 +13,10 @@ memcached python-dev [platform:dpkg] python-devel [platform:rpm] python3-dev [platform:dpkg] -python34-devel [platform:rpm] +python34-devel [platform:redhat] +python3-devel [platfrom:suse] rsync xfsprogs libssl-dev [platform:dpkg] -openssl-devel [platform:rpm] +openssl-devel [platform:redhat] +libopenssl-devel [platform:suse] diff --git a/doc/source/development_saio.rst b/doc/source/development_saio.rst index 7afe70d7fa..1325497efa 100644 --- a/doc/source/development_saio.rst +++ b/doc/source/development_saio.rst @@ -10,8 +10,10 @@ This section documents setting up a virtual machine for doing Swift development. The virtual machine will emulate running a four node Swift cluster. To begin: -* Get an Ubuntu 14.04 LTS server image or try something - Fedora/CentOS. +* Get a linux system server image, this guide will cover: + * Ubuntu 14.04 LTS + * Fedora/CentOS. + * OpenSuse * Create guest virtual machine from the image. @@ -57,6 +59,16 @@ Installing dependencies python-netifaces python-pip python-dns \ python-mock +* On ``OpenSuse``:: + + sudo zypper install curl gcc memcached rsync sqlite3 xfsprogs git-core \ + libffi-devel liberasurecode-devel python2-setuptools \ + libopenssl-devel + sudo zypper install python2-coverage python-devel python2-nose \ + python-xattr python-eventlet python2-greenlet \ + python2-netifaces python2-pip python2-dnspython \ + python2-mock + Note: This installs necessary system dependencies and *most* of the python dependencies. Later in the process setuptools/distribute or pip will install and/or upgrade packages. @@ -97,6 +109,13 @@ another device when creating the VM, and follow these instructions: # **Make sure to include the trailing slash after /srv/$x/** for x in {1..4}; do sudo chown -R ${USER}:${USER} /srv/$x/; done + Note: For OpenSuse users, a user's primary group is `users`, so you have 2 options: + + * Change `${USER}:${USER}` to `${USER}:users` in all references of this guide; or + * Create a group for your username and add yourself to it:: + + sudo groupadd ${USER} && sudo gpasswd -a ${USER} ${USER} + Note: We create the mount points and mount the storage disk under /mnt/sdb1. This disk will contain one directory per simulated swift node, each owned by the current swift user. @@ -147,6 +166,13 @@ these instructions: # **Make sure to include the trailing slash after /srv/$x/** for x in {1..4}; do sudo chown -R ${USER}:${USER} /srv/$x/; done + Note: For OpenSuse users, a user's primary group is `users`, so you have 2 options: + + * Change `${USER}:${USER}` to `${USER}:users` in all references of this guide; or + * Create a group for your username and add yourself to it:: + + sudo groupadd ${USER} && sudo gpasswd -a ${USER} ${USER} + Note: We create the mount points and mount the loopback file under /mnt/sdb1. This file will contain one directory per simulated swift node, each owned by the current swift user. @@ -173,6 +199,8 @@ Note that on some systems you might have to create ``/etc/rc.local``. On Fedora 19 or later, you need to place these in ``/etc/rc.d/rc.local``. +On OpenSuse you need to place these in ``/etc/init.d/boot.local``. + ---------------- Getting the code ---------------- @@ -196,7 +224,10 @@ Getting the code #. Build a development installation of swift:: - cd $HOME/swift; sudo pip install -r requirements.txt; sudo python setup.py develop; cd - + cd $HOME/swift; sudo pip install --no-binary cryptography -r requirements.txt; sudo python setup.py develop; cd - + + Note: Due to a difference in libssl.so naming in OpenSuse to other Linux distros the wheel/binary wont work so the + cryptography must be built, thus the ``--no-binary cryptography``. Fedora 19 or later users might have to perform the following if development installation of swift fails:: @@ -231,6 +262,8 @@ Setting up rsync One might have to create the above files to perform the edits. + On OpenSuse, nothing needs to happen here. + #. On platforms with SELinux in ``Enforcing`` mode, either set to ``Permissive``:: sudo setenforce Permissive @@ -256,6 +289,11 @@ Setting up rsync sudo systemctl enable rsyncd.service sudo systemctl start rsyncd.service + * On OpenSuse, run:: + + sudo systemctl enable rsyncd.service + sudo systemctl start rsyncd.service + * On other xinetd based systems simply run:: sudo service xinetd restart @@ -304,6 +342,13 @@ Optional: Setting up rsyslog for individual logging sudo cp $HOME/swift/doc/saio/rsyslog.d/10-swift.conf /etc/rsyslog.d/ + Note: OpenSuse may have the systemd logger installed, so if you want this + to work, you need to install rsyslog:: + + sudo zypper install rsyslog + sudo systemctl start rsyslog.service + sudo systemctl enable rsyslog.service + Be sure to review that conf file to determine if you want all the logs in one file vs. all the logs separated out, and if you want hourly logs for stats processing. For convenience, we provide its default contents @@ -332,7 +377,7 @@ Optional: Setting up rsyslog for individual logging sudo chmod -R g+w /var/log/swift sudo service rsyslog restart - * On Fedora:: + * On Fedora and OpenSuse:: sudo chown -R root:adm /var/log/swift sudo chmod -R g+w /var/log/swift