Guest User

Untitled

a guest
Feb 17th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. MBXSPARK_VERSION="0.4.8"
  4.  
  5. yum -y remove gcc
  6. yum -y remove gcc
  7.  
  8. yum -y install gcc
  9. yum -y install gcc-c++
  10.  
  11. echo "installing gzip gunzip"
  12. yum -y install gzip gunzip
  13.  
  14. aws s3 cp s3://mapbox-qubole/mbxspark/mbxspark-${MBXSPARK_VERSION}.tar.gz /tmp
  15.  
  16. echo "copied mbxspark, now setting up python3 environment"
  17.  
  18. source /usr/lib/hustler/bin/qubole-bash-lib.sh
  19.  
  20. echo "sourcing qubole bash"
  21.  
  22. echo "copying tecumseh"
  23. aws s3 cp s3://mapbox-qubole/tecumseh/tecumseh-0.0.1.tar.gz /tmp/tecumseh-src.tar.gz
  24.  
  25. echo "gunzipping tecumseh"
  26. gunzip /tmp/tecumseh-src.tar.gz
  27.  
  28. echo "decompressing tecumseh tar and copying src files"
  29. mkdir /tmp/tecumseh && tar xf /tmp/tecumseh-src.tar -C /tmp/tecumseh --strip-components 1
  30.  
  31. sleep 3
  32.  
  33. package_management_enabled=$(nodeinfo_feature tapp.ui_enable_package_management)
  34. use_spark=$(nodeinfo use_spark)
  35. py_package_name=$(nodeinfo quboled_env_python_package_name)
  36.  
  37. echo "py package name is ${py_package_name} use spark is ${use_spark} and package management is ${package_management_enabled}"
  38.  
  39. if [[ ${package_management_enabled} = "true" && ${use_spark} = "1" ]]; then
  40. while [[ ! -d "/usr/lib/envs/${py_package_name}" ]] && [[ "${#py_package_name}" -ne "0" ]]
  41. do
  42. echo "python3 environment not ready. Sleeping for 3 secs!"
  43. sleep 3
  44. done
  45. echo "python3 environment ($py_package_name) ready, sleeping more to be sure!"
  46. sleep 30
  47. ##Start Health Check to decomission unhealthy nodes###
  48. if [ ! -d "/usr/lib/envs/${py_package_name}" ] ; then
  49. nodename=$(hostname)
  50. echo "Env is still not ready! Aborting and decomissioning the current node gracefully"
  51. shutdown -h
  52. fi
  53. echo "installing private module mbxspark-${MBXSPARK_VERSION}"
  54. /usr/lib/envs/${py_package_name}/bin/pip install /tmp/mbxspark-${MBXSPARK_VERSION}.tar.gz
  55. # Upgrade some packages
  56. /usr/lib/envs/${py_package_name}/bin/pip install --upgrade boto3 requests
  57.  
  58. #Installing setuptools
  59. /usr/lib/envs/${py_package_name}/bin/pip install setuptools
  60.  
  61. #Installing tecumseh
  62. /usr/lib/envs/${py_package_name}/bin/pip install /tmp/tecumseh
  63. fi
Add Comment
Please, Sign In to add comment