"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "s2aio.sh" between
storlets-6.0.0.tar.gz and storlets-7.0.0.tar.gz

About: OpenStack Swift Storlets extend Swift with the capability to run computation near the data in a secure and isolated manner.
The "Wallaby" series (latest release).

s2aio.sh  (storlets-6.0.0):s2aio.sh  (storlets-7.0.0)
skipping to change at line 26 skipping to change at line 26
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DEVSTACK_DIR=~/devstack DEVSTACK_DIR=~/devstack
SWIFT_IP=127.0.0.1 SWIFT_IP=127.0.0.1
KEYSTONE_IP=$SWIFT_IP KEYSTONE_IP=$SWIFT_IP
KEYSTONE_PROTOCOL=http KEYSTONE_PROTOCOL=http
KEYSTONE_PUBLIC_URL=${KEYSTONE_PROTOCOL}://${KEYSTONE_IP}/identity/v3 KEYSTONE_PUBLIC_URL=${KEYSTONE_PROTOCOL}://${KEYSTONE_IP}/identity/v3
IDENTITY_API_VERSION=3 IDENTITY_API_VERSION=3
SWIFT_DATA_DIR=/opt/stack/data/swift SWIFT_DATA_DIR=/opt/stack/data/swift
usage() { function usage {
echo "Usage: s2aio.sh install" echo "Usage: s2aio.sh install"
echo " s2aio.sh start" echo " s2aio.sh start"
echo " s2aio.sh stop" echo " s2aio.sh stop"
exit 1 exit 1
} }
_prepare_devstack_env() { function _prepare_devstack_env {
# Checkout devstack # Checkout devstack
if [ ! -e $DEVSTACK_DIR ]; then if [ ! -e $DEVSTACK_DIR ]; then
git clone git://github.com/openstack-dev/devstack.git $DEVSTACK_DIR git clone git://github.com/openstack-dev/devstack.git $DEVSTACK_DIR
if [ ${USE_PYTHON3} == "False" ]; then if [ ${USE_PYTHON3} == "False" ]; then
cp devstack/localrc.py2.sample $DEVSTACK_DIR/localrc cp devstack/localrc.py2.sample $DEVSTACK_DIR/localrc
else else
cp devstack/localrc.sample $DEVSTACK_DIR/localrc cp devstack/localrc.sample $DEVSTACK_DIR/localrc
fi fi
fi fi
source $DEVSTACK_DIR/stackrc source $DEVSTACK_DIR/stackrc
source $DEVSTACK_DIR/functions source $DEVSTACK_DIR/functions
source $DEVSTACK_DIR/functions-common source $DEVSTACK_DIR/functions-common
source $DEVSTACK_DIR/lib/swift source $DEVSTACK_DIR/lib/swift
source devstack/plugin.sh source devstack/plugin.sh
} }
start_s2aio() { function start_s2aio {
set -e set -e
swift-init --run-dir ${SWIFT_DATA_DIR}/run/ all start swift-init --run-dir ${SWIFT_DATA_DIR}/run/ all start
/usr/local/bin/uwsgi /etc/keystone/keystone-uwsgi-public.ini &> /dev/null & /usr/local/bin/uwsgi /etc/keystone/keystone-uwsgi-public.ini &> /dev/null &
/usr/local/bin/uwsgi /etc/keystone/keystone-uwsgi-admin.ini &> /dev/null & /usr/local/bin/uwsgi /etc/keystone/keystone-uwsgi-admin.ini &> /dev/null &
exit 0 exit 0
} }
_stop_s2aio() { function _stop_s2aio {
set +e set +e
swift-init --run-dir ${SWIFT_DATA_DIR}/run/ all stop swift-init --run-dir ${SWIFT_DATA_DIR}/run/ all stop
sh -c 'ps aux | pgrep uwsgi | xargs kill -9' sh -c 'ps aux | pgrep uwsgi | xargs kill -9'
set -e set -e
} }
stop_s2aio() { function stop_s2aio {
_stop_s2aio _stop_s2aio
exit 0 exit 0
} }
install_swift_using_devstack() { function install_swift_using_devstack {
cd $DEVSTACK_DIR cd $DEVSTACK_DIR
./stack.sh ./stack.sh
stop_swift stop_swift
cd - cd -
# add entry to fstab # add entry to fstab
mount_added=$(grep swift.img /etc/fstab | wc -l) mount_added=$(grep swift.img /etc/fstab | wc -l)
if [ $mount_added -eq 0 ]; then if [ $mount_added -eq 0 ]; then
sudo sh -c 'echo "/opt/stack/data/swift/drives/images/swift.img /opt/sta ck/data/swift/drives/sdb1 xfs loop" >> /etc/fstab' sudo sh -c 'echo "/opt/stack/data/swift/drives/images/swift.img /opt/sta ck/data/swift/drives/sdb1 xfs loop" >> /etc/fstab'
fi fi
} }
install_s2aio() { function install_s2aio {
_prepare_devstack_env _prepare_devstack_env
install_swift_using_devstack install_swift_using_devstack
install_storlets install_storlets
echo "export OS_IDENTITY_API_VERSION=$KEYSTONE_IDENTITY_API_VERSION" >> ~/.b ashrc echo "export OS_IDENTITY_API_VERSION=$KEYSTONE_IDENTITY_API_VERSION" >> ~/.b ashrc
echo "export OS_USERNAME=$SWIFT_DEFAULT_USER; export OS_PASSWORD=$SWIFT_DEFA ULT_USER_PWD" >> ~/.bashrc echo "export OS_USERNAME=$SWIFT_DEFAULT_USER; export OS_PASSWORD=$SWIFT_DEFA ULT_USER_PWD" >> ~/.bashrc
echo "export OS_PROJECT_NAME=$SWIFT_DEFAULT_PROJECT; export OS_DEFAULT_DOMAI N=default" >> ~/.bashrc echo "export OS_PROJECT_NAME=$SWIFT_DEFAULT_PROJECT; export OS_DEFAULT_DOMAI N=default" >> ~/.bashrc
echo "export OS_AUTH_URL=$KEYSTONE_PUBLIC_URL" >> ~/.bashrc echo "export OS_AUTH_URL=$KEYSTONE_PUBLIC_URL" >> ~/.bashrc
} }
uninstall_swift_using_devstack() { function uninstall_swift_using_devstack {
_stop_s2aio _stop_s2aio
cd $DEVSTACK_DIR cd $DEVSTACK_DIR
./unstack.sh ./unstack.sh
cd - cd -
echo "Removing swift device mount, creating /etc/fstab.bak" echo "Removing swift device mount, creating /etc/fstab.bak"
sudo sed -i.bak '/swift.img/d' /etc/fstab sudo sed -i.bak '/swift.img/d' /etc/fstab
} }
uninstall_s2aio() { function uninstall_s2aio {
_prepare_devstack_env _prepare_devstack_env
echo "Removing all storlets run time data" echo "Removing all storlets run time data"
uninstall_storlets uninstall_storlets
echo "Uninstalling Swift" echo "Uninstalling Swift"
uninstall_swift_using_devstack uninstall_swift_using_devstack
} }
COMMAND="$1" COMMAND="$1"
 End of changes. 9 change blocks. 
9 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)