Created
April 15, 2016 02:07
-
-
Save redbo/3ba9b5b474e8c62d26e20d11cb02c247 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# update and install some necessary system dependencies | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install build-essential memcached rsync xfsprogs git-core libffi-dev python-dev liberasurecode-dev python-virtualenv curl | |
# set up some directories we'll need to run everything | |
sudo mkdir -p /var/cache/swift /var/cache/swift2 /var/cache/swift3 /var/cache/swift4 /var/run/swift /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4 /var/run/hummingbird /etc/hummingbird /etc/swift | |
sudo chown -R "${USER}" /etc/swift /etc/hummingbird /srv/* /var/cache/swift* /var/run/swift /var/run/hummingbird | |
mkdir -p ~/bin ~/gocode/src/github.com/openstack ~/swift-venv | |
# set up some environment variables | |
export PATH="$PATH:$HOME/swift-venv/bin:$HOME/bin" | |
export GOPATH="$HOME/gocode" | |
# those values are necessary for everything to work, so let's go ahead and persist them | |
echo 'export PATH=$PATH:$HOME/swift-venv/bin:$HOME/bin' >> ~/.bashrc | |
echo 'export GOPATH=$HOME/gocode' >> ~/.bashrc | |
# fetch swift and swiftclient | |
git clone 'https://github.com/openstack/swift.git' ~/swift | |
git clone https://review.openstack.org/openstack/python-swiftclient.git ~/swiftclient | |
# install swift and swiftclient in a new virtualenv | |
virtualenv ~/swift-venv | |
~/swift-venv/bin/pip install -U pip setuptools | |
~/swift-venv/bin/pip install -r ~/swift/requirements.txt | |
~/swift-venv/bin/pip install -r ~/swift/test-requirements.txt | |
~/swift-venv/bin/pip install -r ~/swiftclient/requirements.txt | |
cd ~/swift; ~/swift-venv/bin/python setup.py develop | |
cd ~/swiftclient; ~/swift-venv/bin/python setup.py develop | |
cp ~/swift/doc/saio/bin/* ~/swift-venv/bin | |
# set up swift's config files | |
cp -r ~/swift/doc/saio/swift/* /etc/swift | |
cp ~/swift/test/sample.conf /etc/swift/test.conf | |
find /etc/swift/ -name "*.conf" | xargs sed -i "s/<your-user-name>/${USER}/" | |
printf "[swift-hash]\nswift_hash_path_prefix = changeme\nswift_hash_path_suffix = changeme\n" > /etc/swift/swift.conf | |
# make some rings | |
remakerings | |
# install go and build hummingbird | |
curl 'https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz' | sudo tar -xz -C /usr/local | |
ln -s /usr/local/go/bin/* ~/bin | |
ln -s ~/swift ~/gocode/src/github.com/openstack/swift | |
cd ~/gocode/src/github.com/openstack/swift; git checkout origin/feature/hummingbird | |
cd ~/gocode/src/github.com/openstack/swift/go; make get test bin/hummingbird | |
ln -s ~/gocode/src/github.com/openstack/swift/go/bin/hummingbird ~/bin | |
# finally, start up the servers | |
swift-init start container | |
swift-init start account | |
swift-init start proxy | |
hummingbird start object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment