Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added installation script for MacOS - Darwin
- Loading branch information
1 parent
2ba497a
commit 97bf000
Showing
3 changed files
with
130 additions
and
46 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# define installation log file | ||
truncate -s 0 install.log | ||
install_log="install.log" | ||
echo "Installing CloudARK. Installation logs stored in $install_log" | ||
|
||
virtenv="cloudark-virtenv" | ||
virtenvbin=`pwd`/$virtenv/bin | ||
echo "Creating virtual environment $virtenv" &>> $install_log | ||
virtualenv $virtenv &>> $install_log | ||
source $virtenv/bin/activate &>> $install_log | ||
|
||
pip install -r requirements.txt &>> $install_log | ||
cd client | ||
../$virtenv/bin/python setup.py install &>> $install_log | ||
|
||
[[ ":$PATH:" != *":`pwd`:"* ]] && PATH="`pwd`:${PATH}" | ||
[[ ":$PATH:" != *":$virtenvbin:"* ]] && PATH="$virtenvbin:${PATH}" | ||
echo '### Added by CloudARK' >> ~/.profile | ||
echo "export PATH=$PATH" >> ~/.profile | ||
echo '### Added by CloudARK' >> ~/.bashrc | ||
echo "export PATH=$PATH" >> ~/.bashrc | ||
|
||
[[ ":$PYTHONPATH:" != *":`pwd`:"* ]] && PYTHONPATH="`pwd`:${PYTHONPATH}" | ||
[[ ":$PYTHONPATH:" != *":$virtenvbin:"* ]] && PYTHONPATH="$virtenvbin:${PYTHONPATH}" | ||
echo '### Added by CloudARK' >> ~/.profile | ||
echo "export PYTHONPATH=$PYTHONPATH" >> ~/.profile | ||
echo '### Added by CloudARK' >> ~/.bashrc | ||
echo "export PYTHONPATH=$PYTHONPATH" >> ~/.bashrc | ||
|
||
echo "Installing cloudark client done." &>> $install_log | ||
|
||
cd .. | ||
echo "Starting server.." &>> $install_log | ||
ps -eaf | grep 'python server/fmserver.py' | awk '{print $2}' | xargs kill &>> $install_log | ||
python server/fmserver.py 1>>cld-server.log 2>&1 & | ||
|
||
has_server_started=`ps -eaf | grep fmserver` | ||
|
||
if [[ ! -z "${has_server_started}" ]]; then | ||
echo "CloudARK successfully installed." | ||
echo "Next steps:" | ||
echo "- Quick test: Run 'cld --help'" | ||
echo "- Try sample programs from cloudark-samples repository (https://github.com/cloud-ark/cloudark-samples.git)" | ||
# Check if running as root -- if so, exit | ||
if (( $EUID == 0 )); then | ||
echo "Looks like you are trying to run install.sh as root." | ||
echo "That is not required actually." | ||
echo "Just run ./install.sh as regular user." | ||
exit | ||
fi | ||
|
||
# Check if the platform is one that we support | ||
declare -a supported_platform_list=("Ubuntu 14.04", "Ubuntu 16.04", "OS X - Darwin"); | ||
platform=`uname -a | grep -E "Ubuntu|Darwin"` | ||
|
||
# Activate virtual environment | ||
/bin/bash -c ". $virtenv/bin/activate; exec /bin/bash -i" | ||
|
||
if [[ -z "$platform" ]]; then | ||
echo "Unsupported platform. Currently supported platforms: ${supported_platform_list[@]}" | ||
exit | ||
fi | ||
|
||
host_platform=`uname -a | awk '{print $4}'` | ||
|
||
if [ "$host_platform" = "Darwin" ]; then | ||
echo "Host OS: Mac OS X" | ||
source lib/install-mac.sh | ||
elif [[ "$host_platform" =~ "Ubuntu" ]]; then | ||
echo "Host OS: Ubuntu" | ||
source lib/install-ubuntu.sh | ||
else | ||
echo "Unknown platform" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
# define installation log file | ||
rm -rf install.log | ||
touch install.log | ||
install_log="install.log" | ||
echo "Installing CloudARK. Installation logs stored in $install_log" | ||
|
||
virtenv="cloudark-virtenv" | ||
virtenvbin=`pwd`/$virtenv/bin | ||
echo "Creating virtual environment $virtenv" >> $install_log | ||
virtualenv $virtenv >> $install_log | ||
source $virtenv/bin/activate >> $install_log | ||
|
||
pip install -r requirements.txt >> $install_log | ||
cd client | ||
../$virtenv/bin/python setup.py install >> $install_log | ||
|
||
[[ ":$PATH:" != *":`pwd`:"* ]] && PATH="`pwd`:${PATH}" | ||
[[ ":$PATH:" != *":$virtenvbin:"* ]] && PATH="$virtenvbin:${PATH}" | ||
echo '### Added by CloudARK' >> ~/.profile | ||
echo "export PATH=$PATH" >> ~/.profile | ||
echo '### Added by CloudARK' >> ~/.bashrc | ||
echo "export PATH=$PATH" >> ~/.bashrc | ||
|
||
[[ ":$PYTHONPATH:" != *":`pwd`:"* ]] && PYTHONPATH="`pwd`:${PYTHONPATH}" | ||
[[ ":$PYTHONPATH:" != *":$virtenvbin:"* ]] && PYTHONPATH="$virtenvbin:${PYTHONPATH}" | ||
echo '### Added by CloudARK' >> ~/.profile | ||
echo "export PYTHONPATH=$PYTHONPATH" >> ~/.profile | ||
echo '### Added by CloudARK' >> ~/.bashrc | ||
echo "export PYTHONPATH=$PYTHONPATH" >> ~/.bashrc | ||
|
||
echo "Installing cloudark client done." >> $install_log | ||
|
||
cd .. | ||
echo "Starting server.." >> $install_log | ||
ps -eaf | grep 'python server/fmserver.py' | awk '{print $2}' | xargs kill >> $install_log | ||
python server/fmserver.py 1>>cld-server.log 2>&1 & | ||
|
||
has_server_started=`ps -eaf | grep fmserver` | ||
|
||
if [[ ! -z "${has_server_started}" ]]; then | ||
echo "CloudARK successfully installed." | ||
echo "Next steps:" | ||
echo "- Quick test: Run 'cld --help'" | ||
echo "- Try sample programs from cloudark-samples repository (https://github.com/cloud-ark/cloudark-samples.git)" | ||
fi | ||
|
||
|
||
# Activate virtual environment | ||
/bin/bash -c ". $virtenv/bin/activate; exec /bin/bash -i" | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# define installation log file | ||
truncate -s 0 install.log | ||
install_log="install.log" | ||
echo "Installing CloudARK. Installation logs stored in $install_log" | ||
|
||
virtenv="cloudark-virtenv" | ||
virtenvbin=`pwd`/$virtenv/bin | ||
echo "Creating virtual environment $virtenv" &>> $install_log | ||
virtualenv $virtenv &>> $install_log | ||
source $virtenv/bin/activate &>> $install_log | ||
|
||
pip install -r requirements.txt &>> $install_log | ||
cd client | ||
../$virtenv/bin/python setup.py install &>> $install_log | ||
|
||
[[ ":$PATH:" != *":`pwd`:"* ]] && PATH="`pwd`:${PATH}" | ||
[[ ":$PATH:" != *":$virtenvbin:"* ]] && PATH="$virtenvbin:${PATH}" | ||
echo '### Added by CloudARK' >> ~/.profile | ||
echo "export PATH=$PATH" >> ~/.profile | ||
echo '### Added by CloudARK' >> ~/.bashrc | ||
echo "export PATH=$PATH" >> ~/.bashrc | ||
|
||
[[ ":$PYTHONPATH:" != *":`pwd`:"* ]] && PYTHONPATH="`pwd`:${PYTHONPATH}" | ||
[[ ":$PYTHONPATH:" != *":$virtenvbin:"* ]] && PYTHONPATH="$virtenvbin:${PYTHONPATH}" | ||
echo '### Added by CloudARK' >> ~/.profile | ||
echo "export PYTHONPATH=$PYTHONPATH" >> ~/.profile | ||
echo '### Added by CloudARK' >> ~/.bashrc | ||
echo "export PYTHONPATH=$PYTHONPATH" >> ~/.bashrc | ||
|
||
echo "Installing cloudark client done." &>> $install_log | ||
|
||
cd .. | ||
echo "Starting server.." &>> $install_log | ||
ps -eaf | grep 'python server/fmserver.py' | awk '{print $2}' | xargs kill &>> $install_log | ||
python server/fmserver.py 1>>cld-server.log 2>&1 & | ||
|
||
has_server_started=`ps -eaf | grep fmserver` | ||
|
||
if [[ ! -z "${has_server_started}" ]]; then | ||
echo "CloudARK successfully installed." | ||
echo "Next steps:" | ||
echo "- Quick test: Run 'cld --help'" | ||
echo "- Try sample programs from cloudark-samples repository (https://github.com/cloud-ark/cloudark-samples.git)" | ||
fi | ||
|
||
|
||
# Activate virtual environment | ||
/bin/bash -c ". $virtenv/bin/activate; exec /bin/bash -i" | ||
|
||
|
||
|