swift/doc/source/debian_package_guide.rst

4.4 KiB

Building and Deploying Custom Debian packages for Swift

This documents setting up the prerequisites, downloading the code and building Debian packages necessary to deploy the various components of the swift project code. These steps were done on a server running Ubuntu 10.04 LTS (Lucid Lynx), but should give a good idea what to do on other distros.

Instructions for Deploying Swift-Core PPAs

These packages are built from the current development branch "trunk"

  • Add swift-core/ppa repository. As root::

    apt-get install python-software-properties
    add-apt-repository ppa:swift-core/trunk
    apt-get update
  • Install the swift base packages:

    apt-get install python-swift
    apt-get install swift
  • Install the swift packages depending on your implementations:

    apt-get install swift-auth
    apt-get install swift-proxy
    apt-get install swift-account
    apt-get install swift-container
    apt-get install swift-object
  • Copy sample configuration files to /etc/swift directory and rename them to `*.conf files`:

    cp -a /usr/share/doc/swift/*.conf-sample /etc/swift/ 
    cd /etc/swift ; rename 's/\-sample$//' *.conf-sample
  • For servers running the swift-account, swift-container or swift-object the rsync.conf file should be moved to the /etc directory:

    cd /etc/swift
    mv rsyncd.conf /etc
  • Modify configuration files to meet your implementation requirements the defaults have been not been geared to a multi-server implementation.

Instructions for Building Debian Packages for Swift

  • Add swift-core/ppa repository and install prerequisites. As root:

    apt-get install python-software-properties
    add-apt-repository ppa:swift-core/release
    apt-get update
    apt-get install curl gcc bzr python-coverage python-dev python-nose python-setuptools python-simplejson python-xattr python-eventlet python-greenlet debhelper python-sphinx python-all python-openssl python-pastedeploy python-netifaces bzr-builddeb
  • As you

    1. Tell bzr who you are:

      bzr whoami '<Your Name> <youremail@.example.com>'
      bzr lp-login <your launchpad id>
    2. Create a local bazaar repository for dev/testing:

      bzr init-repo swift
    3. Pull down the swift/debian files:

      cd swift 
      bzr branch lp:~swift-core/swift/debian
    4. If you want to merge in a branch:

      cd debian
      bzr merge lp:<path-to-branch>
    5. Create the debian packages:

      cd debian 
      bzr bd --builder='debuild -uc -us'
    6. Upload packages to your target servers:

      cd .. 
      scp *.deb root@<swift-target-server>:~/.

Instructions for Deploying Debian Packages for Swift

  • On a Target Server, As root:
    1. Setup the swift ppa:

      add-apt-repository ppa:swift-core/release
      apt-get update
    2. Install dependencies:

      apt-get install rsync python-openssl python-setuptools
      python-simplejson python-xattr python-greenlet python-eventlet
      python-netifaces
    3. Install base packages:

      dpkg -i python-swift_<version>_all.deb 
      dpkg -i swift_<version>_all.deb
    4. Install packages depending on your implementation:

      dpkg -i swift-auth_<version>_all.deb    
      dpkg -i swift-proxy_<version>_all.deb
      dpkg -i swift-account_<version>_all.deb  
      dpkg -i swift-container_<version>_all.deb  
      dpkg -i swift-object_<version>_all.deb  
      dpkg -i swift-doc_<version>_all.deb
    5. Copy sample configuration files to /etc/swift directory and rename them to `*.conf files`:

      cp -a /usr/share/doc/swift/*.conf-sample /etc/swift/ 
      cd /etc/swift 
      rename 's/\-sample$//' *.conf-sample
    6. For servers running the swift-account, swift-container or swift-object the rsync.conf file should be moved to the /etc directory:

      cd /etc/swift/ 
      mv rsyncd.conf /etc
    7. Modify configuration files to meet your implementation requirements the defaults have been not been geared to a multi-server implementation.