forked from RedisGears/RedisGears
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem-setup.py
executable file
·117 lines (88 loc) · 4.51 KB
/
system-setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env python2
import sys
import os
import argparse
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "deps/readies"))
import paella
#----------------------------------------------------------------------------------------------
class RedisGearsSetup(paella.Setup):
def __init__(self, nop=False):
paella.Setup.__init__(self, nop)
def common_first(self):
self.install_downloaders()
self.setup_pip()
self.pip_install("wheel")
self.pip_install("setuptools --upgrade")
self.install("git")
def debian_compat(self):
self.install("build-essential autotools-dev autoconf libtool gawk")
self.install("libbz2-dev liblzma-dev lzma-dev libncurses5-dev libsqlite3-dev uuid-dev zlib1g-dev libssl-dev libreadline-dev libffi-dev")
if sh("apt-cache search libgdbm-compat-dev") != "":
self.install("libgdbm-compat-dev")
self.install("libgdbm-dev")
self.install("tcl-dev tix-dev tk-dev")
self.install("vim-common") # for xxd
self.install("lsb-release")
self.install("zip unzip")
# pip cannot build gevent on ARM
self.install("python-psutil python-gevent")
self.pip_install("pipenv")
def redhat_compat(self):
self.group_install("'Development Tools'")
self.install("autoconf automake libtool")
self.install("bzip2-devel expat-devel gdbm-devel glibc-devel gmp-devel libffi-devel libuuid-devel ncurses-devel "
"openssl-devel readline-devel sqlite-devel xz-devel zlib-devel")
self.install("tcl-devel tix-devel tk-devel")
self.install("redhat-lsb-core")
self.install("vim-common") # for xxd
self.install("zip unzip")
self.install("which") # required by pipenv (on docker)
self.install("libatomic file")
self.run("wget -q -O /tmp/epel-release-latest-7.noarch.rpm http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm")
self.run("rpm -Uv /tmp/epel-release-latest-7.noarch.rpm ")
self.run("""
dir=$(mktemp -d /tmp/tar.XXXXXX)
(cd $dir; wget -q -O tar.tgz http://redismodules.s3.amazonaws.com/gnu/gnu-tar-1.32-x64-centos7.tgz; tar -xzf tar.tgz -C /; )
rm -rf $dir
""")
# pip cannot build gevent on ARM
self.install("python-gevent python-ujson")
# uninstall and install psutil (order is important), otherwise RLTest fails
self.run("pip uninstall -y psutil || true")
self.install("python2-psutil")
self.pip_install("pipenv")
def fedora(self):
self.group_install("'Development Tools'")
self.install("autoconf automake libtool")
self.install("bzip2-devel expat-devel gdbm-devel glibc-devel gmp-devel libffi-devel libnsl2-devel libuuid-devel ncurses-devel "
"openssl-devel readline-devel sqlite-devel xz-devel zlib-devel")
self.install("tcl-devel tix-devel tk-devel")
self.install("vim-common") # for xxd
self.install("which libatomic file")
# uninstall and install psutil (order is important), otherwise RLTest fails
self.run("pip uninstall -y psutil || true")
self.install("python2-psutil")
self.install("python2-ujson")
self.pip_install("pipenv gevent")
def linux_last(self):
self.install("valgrind")
def macosx(self):
if sh('xcode-select -p') == '':
fatal("Xcode tools are not installed. Please run xcode-select --install.")
self.install("libtool autoconf automake llvm")
self.install("zlib openssl readline coreutils")
if not self.has_command("redis-server"):
self.install("redis")
self.install("binutils") # into /usr/local/opt/binutils
self.install_gnu_utils()
self.pip_install("pipenv gevent")
def common_last(self):
# redis-py-cluster should be installed from git due to redis-py dependency
self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master")
self.pip_install("--no-cache-dir git+https://github.com/RedisLabsModules/RLTest.git@master")
self.pip_install("--no-cache-dir git+https://github.com/RedisLabs/RAMP@master")
#----------------------------------------------------------------------------------------------
parser = argparse.ArgumentParser(description='Set up system for RedisGears build.')
parser.add_argument('-n', '--nop', action="store_true", help='no operation')
args = parser.parse_args()
RedisGearsSetup(nop = args.nop).setup()